Skip to contentSkip to conversation

wifi: rtw88: correct qsel_to_ep[] type as int

PATCH In review Ping-Ke Shih 5 participants 5 messages May 8, 2023 – May 15, 2023

Subsystems (2)
lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtw88: correct qsel_to_ep[] type as int

qsel_to_ep[] can be assigned negative value, so change type from 'u8' to 'int'. Otherwise, Smatch static checker warns:
drivers/net/wireless/realtek/rtw88/usb.c:219 rtw_usb_parse() warn:
assigning (-22) to unsigned variable 'rtwusb->qsel_to_ep[8]'

Fixes a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
Cc Sascha Hauer <[email protected]>
---
 drivers/net/wireless/realtek/rtw88/usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/usb.h +1 -1
index 30647f0dd61c6..ad1d7955c6a51 100644
@@ -78,7 +78,7 @@ struct rtw_usb {
 	u8 pipe_interrupt;
 	u8 pipe_in;
 	u8 out_ep[RTW_USB_EP_MAX];
-	u8 qsel_to_ep[TX_DESC_QSEL_MAX];
+	int qsel_to_ep[TX_DESC_QSEL_MAX];
 	u8 usb_txagg_num;
 
 	struct workqueue_struct *txwq, *rxwq;
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Ping-Ke Shih

qsel_to_ep[] can be assigned negative value, so change type from 'u8' to 'int'. Otherwise, Smatch static checker warns:
drivers/net/wireless/realtek/rtw88/usb.c:219 rtw_usb_parse() warn:
assigning (-22) to unsigned variable 'rtwusb->qsel_to_ep[8]'

Fixes a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
Cc Sascha Hauer <[email protected]>

Sascha

Quoted 21 lines
---
 drivers/net/wireless/realtek/rtw88/usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/usb.h +1 -1
index 30647f0dd61c6..ad1d7955c6a51 100644
@@ -78,7 +78,7 @@ struct rtw_usb {
 	u8 pipe_interrupt;
 	u8 pipe_in;
 	u8 out_ep[RTW_USB_EP_MAX];
-	u8 qsel_to_ep[TX_DESC_QSEL_MAX];
+	int qsel_to_ep[TX_DESC_QSEL_MAX];
 	u8 usb_txagg_num;
 
 	struct workqueue_struct *txwq, *rxwq;
Signature · 1 line
2.25.1
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#2 lore raw
In reply to Ping-Ke Shih

From: Ping-Ke Shih

Quoted 6 lines

Sent: 08 May 2023 09:56

qsel_to_ep[] can be assigned negative value, so change type from 'u8' to 'int'. Otherwise, Smatch static checker warns:
drivers/net/wireless/realtek/rtw88/usb.c:219 rtw_usb_parse() warn:
assigning (-22) to unsigned variable 'rtwusb->qsel_to_ep[8]'

I think s8 would do.
Either that or an alternative error value.

David

Quoted 25 lines
Fixes a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
Cc Sascha Hauer <[email protected]>
---
 drivers/net/wireless/realtek/rtw88/usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/usb.h +1 -2
index 30647f0dd61c6..ad1d7955c6a51 100644
@@ -78,7 +78,7 @@ struct rtw_usb {
 	u8 pipe_interrupt;
 	u8 pipe_in;
 	u8 out_ep[RTW_USB_EP_MAX];
-	u8 qsel_to_ep[TX_DESC_QSEL_MAX];
+	int qsel_to_ep[TX_DESC_QSEL_MAX];
 	u8 usb_txagg_num;
 
 	struct workqueue_struct *txwq, *rxwq;
--
Quoted 1 line

2.25.1

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

Tested-by on v1 1/1
#3 lore raw
In reply to Ping-Ke Shih
Quoted 5 lines · Ping-Ke Shih

qsel_to_ep[] can be assigned negative value, so change type from 'u8' to 'int'. Otherwise, Smatch static checker warns:

   drivers/net/wireless/realtek/rtw88/usb.c:219 rtw_usb_parse() warn:
   assigning (-22) to unsigned variable 'rtwusb->qsel_to_ep[8]'
Quoted 7 lines
Fixes a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
Cc Sascha Hauer <[email protected]>

---

Larry

#4 lore raw
In reply to Ping-Ke Shih
Quoted 5 lines · Ping-Ke Shih

qsel_to_ep[] can be assigned negative value, so change type from 'u8' to 'int'. Otherwise, Smatch static checker warns:
drivers/net/wireless/realtek/rtw88/usb.c:219 rtw_usb_parse() warn:
assigning (-22) to unsigned variable 'rtwusb->qsel_to_ep[8]'

Quoted 8 lines

Patch applied to wireless.git, thanks.

8e4942db5f5e wifi: rtw88: correct qsel_to_ep[] type as int

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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