wifi: rtw88: correct qsel_to_ep[] type as int
Subsystems (2)
Ping-Ke Shih
maintainerPATCH 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]'
--- drivers/net/wireless/realtek/rtw88/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/usb.h +1 -1
@@ -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
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:219rtw_usb_parse()warn:
assigning (-22) to unsigned variable 'rtwusb->qsel_to_ep[8]'Fixes a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")Reported-by Dan Carpenter <[email protected]>Cc Sascha Hauer <[email protected]>Signed-off-by Ping-Ke Shih <[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@@ -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 |
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:219rtw_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")Reported-by Dan Carpenter <[email protected]>Cc Sascha Hauer <[email protected]>Signed-off-by Ping-Ke Shih <[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@@ -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)
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")Reported-by Dan Carpenter <[email protected]>Cc Sascha Hauer <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>---
Larry
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:219rtw_usb_parse()warn:
assigning (-22) to unsigned variable 'rtwusb->qsel_to_ep[8]'
Quoted 8 lines
Fixes a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")Reported-by Dan Carpenter <[email protected]>Cc Sascha Hauer <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>Acked-by Sascha Hauer <[email protected]>Tested-by Larry Finger <[email protected]>
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