Commit 9373ed28 authored by Jiapeng Chong's avatar Jiapeng Chong Committed by Ping-Ke Shih
Browse files

wifi: rtw89: chan: Use swap() in rtw89_swap_sub_entity()



Use existing swap() function instead of keeping duplicate source code.

./drivers/net/wireless/realtek/rtw89/chan.c:2336:32-33: WARNING opportunity for swap().

Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9174


Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240529020244.129027-1-jiapeng.chong@linux.alibaba.com
parent 9c4fde42
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -2322,7 +2322,6 @@ static void rtw89_swap_sub_entity(struct rtw89_dev *rtwdev,
				  enum rtw89_sub_entity_idx idx2)
{
	struct rtw89_hal *hal = &rtwdev->hal;
	struct rtw89_sub_entity tmp;
	struct rtw89_vif *rtwvif;
	u8 cur;

@@ -2332,9 +2331,7 @@ static void rtw89_swap_sub_entity(struct rtw89_dev *rtwdev,
	hal->sub[idx1].cfg->idx = idx2;
	hal->sub[idx2].cfg->idx = idx1;

	tmp = hal->sub[idx1];
	hal->sub[idx1] = hal->sub[idx2];
	hal->sub[idx2] = tmp;
	swap(hal->sub[idx1], hal->sub[idx2]);

	rtw89_for_each_rtwvif(rtwdev, rtwvif) {
		if (!rtwvif->chanctx_assigned)