All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int
@ 2023-05-08  8:55 Ping-Ke Shih
  2023-05-08  8:58 ` Sascha Hauer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ping-Ke Shih @ 2023-05-08  8:55 UTC (permalink / raw)
  To: kvalo, tony0620emma; +Cc: s.hauer, stable, dan.carpenter, linux-wireless

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]'

Cc: stable@vger.kernel.org
Fixes: a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/linux-wireless/c3f70197-829d-48ed-ae15-66a9de80fa90@kili.mountain/
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/usb.h b/drivers/net/wireless/realtek/rtw88/usb.h
index 30647f0dd61c6..ad1d7955c6a51 100644
--- a/drivers/net/wireless/realtek/rtw88/usb.h
+++ b/drivers/net/wireless/realtek/rtw88/usb.h
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int
  2023-05-08  8:55 [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int Ping-Ke Shih
@ 2023-05-08  8:58 ` Sascha Hauer
  2023-05-08  9:32 ` David Laight
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2023-05-08  8:58 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: kvalo, tony0620emma, stable, dan.carpenter, linux-wireless

On Mon, May 08, 2023 at 04:55:39PM +0800, Ping-Ke Shih wrote:
> 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]'
> 
> Cc: stable@vger.kernel.org
> Fixes: a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Link: https://lore.kernel.org/linux-wireless/c3f70197-829d-48ed-ae15-66a9de80fa90@kili.mountain/
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha

> ---
>  drivers/net/wireless/realtek/rtw88/usb.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.h b/drivers/net/wireless/realtek/rtw88/usb.h
> index 30647f0dd61c6..ad1d7955c6a51 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.h
> +++ b/drivers/net/wireless/realtek/rtw88/usb.h
> @@ -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;
> -- 
> 2.25.1
> 
> 

-- 
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 |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int
  2023-05-08  8:55 [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int Ping-Ke Shih
  2023-05-08  8:58 ` Sascha Hauer
@ 2023-05-08  9:32 ` David Laight
  2023-05-08 18:59 ` Larry Finger
  2023-05-15 18:16 ` Kalle Valo
  3 siblings, 0 replies; 5+ messages in thread
From: David Laight @ 2023-05-08  9:32 UTC (permalink / raw)
  To: 'Ping-Ke Shih', kvalo, tony0620emma
  Cc: s.hauer, stable, dan.carpenter, linux-wireless

From: Ping-Ke Shih
> 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

> 
> Cc: stable@vger.kernel.org
> Fixes: a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Link: https://lore.kernel.org/linux-wireless/c3f70197-829d-48ed-ae15-66a9de80fa90@kili.mountain/
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
>  drivers/net/wireless/realtek/rtw88/usb.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.h b/drivers/net/wireless/realtek/rtw88/usb.h
> index 30647f0dd61c6..ad1d7955c6a51 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.h
> +++ b/drivers/net/wireless/realtek/rtw88/usb.h
> @@ -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;
> --
> 2.25.1

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int
  2023-05-08  8:55 [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int Ping-Ke Shih
  2023-05-08  8:58 ` Sascha Hauer
  2023-05-08  9:32 ` David Laight
@ 2023-05-08 18:59 ` Larry Finger
  2023-05-15 18:16 ` Kalle Valo
  3 siblings, 0 replies; 5+ messages in thread
From: Larry Finger @ 2023-05-08 18:59 UTC (permalink / raw)
  To: Ping-Ke Shih, kvalo, tony0620emma
  Cc: s.hauer, stable, dan.carpenter, linux-wireless

On 5/8/23 03:55, Ping-Ke Shih wrote:
> 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]'
> 
> Cc: stable@vger.kernel.org
> Fixes: a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Link: https://lore.kernel.org/linux-wireless/c3f70197-829d-48ed-ae15-66a9de80fa90@kili.mountain/
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> ---

Tested-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int
  2023-05-08  8:55 [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int Ping-Ke Shih
                   ` (2 preceding siblings ...)
  2023-05-08 18:59 ` Larry Finger
@ 2023-05-15 18:16 ` Kalle Valo
  3 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2023-05-15 18:16 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: tony0620emma, s.hauer, stable, dan.carpenter, linux-wireless

Ping-Ke Shih <pkshih@realtek.com> wrote:

> 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]'
> 
> Cc: stable@vger.kernel.org
> Fixes: a6f187f92bcc ("wifi: rtw88: usb: fix priority queue to endpoint mapping")
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Link: https://lore.kernel.org/linux-wireless/c3f70197-829d-48ed-ae15-66a9de80fa90@kili.mountain/
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> Tested-by: Larry Finger <Larry.Finger@lwfinger.net>

Patch applied to wireless.git, thanks.

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

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230508085539.46795-1-pkshih@realtek.com/

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-15 18:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08  8:55 [PATCH] wifi: rtw88: correct qsel_to_ep[] type as int Ping-Ke Shih
2023-05-08  8:58 ` Sascha Hauer
2023-05-08  9:32 ` David Laight
2023-05-08 18:59 ` Larry Finger
2023-05-15 18:16 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.