diff options
author | Ivan Safonov | 2020-09-13 19:59:59 +0300 |
---|---|---|
committer | Kalle Valo | 2020-09-16 09:08:36 +0300 |
commit | d10f6af58ef4dfb01cf07ef10f4f82f8e9dddc14 (patch) | |
tree | 1c4991dd620819bd5f610972929452cfe8dfe4e4 | |
parent | d06e2f8b41b67bf6b58d9a636ecec901fd3fb47d (diff) |
rtw88: rtw8822c: eliminate code duplication, use native swap() function
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
-rw-r--r-- | drivers/net/wireless/realtek/rtw88/rtw8822c.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c index ed1c14af082b..dd216a23fc99 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c @@ -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); } } |