Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: rtl8xxxu: fix txdw7 assignment of TX DESC v3

Type of txdw7 is __le16, so assign __le32 is wrong. Also, the
TXDESC_ANTENNA_SELECT_C is defined for __le32, so shift 16 bits to fit
the value. Compile test only.

sparse warnings: (new ones prefixed by >>)
>> rtl8xxxu_core.c:5198:24: sparse: sparse: invalid assignment: |=
>> rtl8xxxu_core.c:5198:24: sparse: left side has type restricted __le16
>> rtl8xxxu_core.c:5198:24: sparse: right side has type restricted __le32

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230119113146.9640-1-pkshih@realtek.com

authored by

Ping-Ke Shih and committed by
Kalle Valo
6869ba49 2cef0aee

+1 -1
+1 -1
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
··· 5250 5250 5251 5251 tx_desc->txdw2 |= cpu_to_le32(TXDESC_ANTENNA_SELECT_A | 5252 5252 TXDESC_ANTENNA_SELECT_B); 5253 - tx_desc->txdw7 |= cpu_to_le32(TXDESC_ANTENNA_SELECT_C); 5253 + tx_desc->txdw7 |= cpu_to_le16(TXDESC_ANTENNA_SELECT_C >> 16); 5254 5254 } 5255 5255 5256 5256 static void rtl8xxxu_tx(struct ieee80211_hw *hw,