diff mbox series

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

Message ID 20200913165958.419744-1-insafonov@gmail.com (mailing list archive)
State Accepted
Commit d10f6af58ef4dfb01cf07ef10f4f82f8e9dddc14
Delegated to: Kalle Valo
Headers show
Series wireless: rtw88: rtw8822c: eliminate code duplication, use native swap() function | expand

Commit Message

Ivan Safonov Sept. 13, 2020, 4:59 p.m. UTC
swap_u32() duplicate native swap(), so replace swap_u32() with swap().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/rtw8822c.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

Comments

Kalle Valo Sept. 16, 2020, 6:09 a.m. UTC | #1
Ivan Safonov <insafonov@gmail.com> wrote:

> swap_u32() duplicate native swap(), so replace swap_u32() with swap().
> 
> Signed-off-by: Ivan Safonov <insafonov@gmail.com>

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

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

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
index 426808413baa..e196d7939025 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);
 	}
 }