Skip to content

Commit

Permalink
rtw88: rtw8822c: eliminate code duplication, use native swap() function
Browse files Browse the repository at this point in the history
swap_u32() duplicate native swap(), so replace swap_u32() with swap().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200913165958.419744-1-insafonov@gmail.com
  • Loading branch information
insafonov authored and Kalle Valo committed Sep 16, 2020
1 parent e864202 commit c55d289
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions rtw8822c.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,16 @@ static void rtw8822c_rf_minmax_cmp(struct rtw_dev *rtwdev, u32 value,
}
}

static void swap_u32(u32 *v1, u32 *v2)
{
u32 tmp;

tmp = *v1;
*v1 = *v2;
*v2 = tmp;
}

static void __rtw8822c_dac_iq_sort(struct rtw_dev *rtwdev, u32 *v1, u32 *v2)
{
if (*v1 >= 0x200 && *v2 >= 0x200) {
if (*v1 > *v2)
swap_u32(v1, v2);
swap(*v1, *v2);
} else if (*v1 < 0x200 && *v2 < 0x200) {
if (*v1 > *v2)
swap_u32(v1, v2);
swap(*v1, *v2);
} else if (*v1 < 0x200 && *v2 >= 0x200) {
swap_u32(v1, v2);
swap(*v1, *v2);
}
}

Expand Down

0 comments on commit c55d289

Please sign in to comment.