Skip to contentSkip to conversation

wireless: rtw88: rtw8822c: eliminate code duplication, use native swap() function

PATCH In review Ivan Safonov 2 participants 2 messages Sep 13, 2020 – Sep 16, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wireless: rtw88: rtw8822c: eliminate code duplication, use native swap() function

swap_u32() duplicate native swap(), so replace swap_u32() with swap().

---
 drivers/net/wireless/realtek/rtw88/rtw8822c.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/net/wireless/realtek/rtw88/rtw8822c.c +3 -12
index 426808413baa..e196d7939025 100644
@@ -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);
 	}
 }
 
Signature · 1 line
2.26.2
#1 lore raw

Re: rtw88: rtw8822c: eliminate code duplication, use native swap() function

Quoted 3 lines · Ivan Safonov

swap_u32() duplicate native swap(), so replace swap_u32() with swap().

Patch applied to wireless-drivers-next.git, thanks.

d10f6af58ef4 rtw88: rtw8822c: eliminate code duplication, use native swap() function

Signature · 3 lines
https://patchwork.kernel.org/patch/11772397/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches