diff mbox series

[3/3,v3] wifi: rtw88: remove unused USB bulkout size set

Message ID 20230616085917.60662-3-dmantipov@yandex.ru (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series [1/3,v3] wifi: rtw88: delete timer and free skb queue when unloading | expand

Commit Message

Dmitry Antipov June 16, 2023, 8:59 a.m. UTC
Drop no longer used 'bulkout_size' of 'struct rtw_usb'
and related macros from usb.h, but preserve sanity check
in 'rtw_usb_parse()'. This follows commit 462c8db6a011
("wifi: rtw88: usb: drop now unnecessary URB size check").

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/realtek/rtw88/usb.c | 5 -----
 drivers/net/wireless/realtek/rtw88/usb.h | 5 -----
 2 files changed, 10 deletions(-)

Comments

Ping-Ke Shih June 20, 2023, 3:49 a.m. UTC | #1
// add rtw88 USB author Sascha for his comments.

> -----Original Message-----
> From: Dmitry Antipov <dmantipov@yandex.ru>
> Sent: Friday, June 16, 2023 4:59 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; Dmitry Antipov <dmantipov@yandex.ru>
> Subject: [PATCH 3/3] [v3] wifi: rtw88: remove unused USB bulkout size set
> 
> Drop no longer used 'bulkout_size' of 'struct rtw_usb'
> and related macros from usb.h, but preserve sanity check
> in 'rtw_usb_parse()'. This follows commit 462c8db6a011
> ("wifi: rtw88: usb: drop now unnecessary URB size check").
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
>  drivers/net/wireless/realtek/rtw88/usb.c | 5 -----
>  drivers/net/wireless/realtek/rtw88/usb.h | 5 -----
>  2 files changed, 10 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> index 6862338b1d51..40e614f58349 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.c
> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> @@ -186,13 +186,8 @@ static int rtw_usb_parse(struct rtw_dev *rtwdev,
>         switch (usbd->speed) {
>         case USB_SPEED_LOW:
>         case USB_SPEED_FULL:
> -               rtwusb->bulkout_size = RTW_USB_FULL_SPEED_BULK_SIZE;
> -               break;
>         case USB_SPEED_HIGH:
> -               rtwusb->bulkout_size = RTW_USB_HIGH_SPEED_BULK_SIZE;
> -               break;
>         case USB_SPEED_SUPER:
> -               rtwusb->bulkout_size = RTW_USB_SUPER_SPEED_BULK_SIZE;
>                 break;
>         default:
>                 rtw_err(rtwdev, "failed to detect usb speed\n");

If we decide to remove rtwusb->bulkout_size, I suggest to remove whole
switch..case chunk.
Sascha Hauer June 21, 2023, 7:48 a.m. UTC | #2
On Tue, Jun 20, 2023 at 03:49:19AM +0000, Ping-Ke Shih wrote:
> // add rtw88 USB author Sascha for his comments.
> 
> > -----Original Message-----
> > From: Dmitry Antipov <dmantipov@yandex.ru>
> > Sent: Friday, June 16, 2023 4:59 PM
> > To: Ping-Ke Shih <pkshih@realtek.com>
> > Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; Dmitry Antipov <dmantipov@yandex.ru>
> > Subject: [PATCH 3/3] [v3] wifi: rtw88: remove unused USB bulkout size set
> > 
> > Drop no longer used 'bulkout_size' of 'struct rtw_usb'
> > and related macros from usb.h, but preserve sanity check
> > in 'rtw_usb_parse()'. This follows commit 462c8db6a011
> > ("wifi: rtw88: usb: drop now unnecessary URB size check").
> > 
> > Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> > ---
> >  drivers/net/wireless/realtek/rtw88/usb.c | 5 -----
> >  drivers/net/wireless/realtek/rtw88/usb.h | 5 -----
> >  2 files changed, 10 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> > index 6862338b1d51..40e614f58349 100644
> > --- a/drivers/net/wireless/realtek/rtw88/usb.c
> > +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> > @@ -186,13 +186,8 @@ static int rtw_usb_parse(struct rtw_dev *rtwdev,
> >         switch (usbd->speed) {
> >         case USB_SPEED_LOW:
> >         case USB_SPEED_FULL:
> > -               rtwusb->bulkout_size = RTW_USB_FULL_SPEED_BULK_SIZE;
> > -               break;
> >         case USB_SPEED_HIGH:
> > -               rtwusb->bulkout_size = RTW_USB_HIGH_SPEED_BULK_SIZE;
> > -               break;
> >         case USB_SPEED_SUPER:
> > -               rtwusb->bulkout_size = RTW_USB_SUPER_SPEED_BULK_SIZE;
> >                 break;
> >         default:
> >                 rtw_err(rtwdev, "failed to detect usb speed\n");
> 
> If we decide to remove rtwusb->bulkout_size, I suggest to remove whole
> switch..case chunk.

I didn't realize rtwusb->bulkout_size becomes unused with 462c8db6a011.
Removing this field makes sense and in that case: +1 for removing the
switch/case as well.

Sascha
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
index 6862338b1d51..40e614f58349 100644
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -186,13 +186,8 @@  static int rtw_usb_parse(struct rtw_dev *rtwdev,
 	switch (usbd->speed) {
 	case USB_SPEED_LOW:
 	case USB_SPEED_FULL:
-		rtwusb->bulkout_size = RTW_USB_FULL_SPEED_BULK_SIZE;
-		break;
 	case USB_SPEED_HIGH:
-		rtwusb->bulkout_size = RTW_USB_HIGH_SPEED_BULK_SIZE;
-		break;
 	case USB_SPEED_SUPER:
-		rtwusb->bulkout_size = RTW_USB_SUPER_SPEED_BULK_SIZE;
 		break;
 	default:
 		rtw_err(rtwdev, "failed to detect usb speed\n");
diff --git a/drivers/net/wireless/realtek/rtw88/usb.h b/drivers/net/wireless/realtek/rtw88/usb.h
index fad998005ec8..86697a5c0103 100644
--- a/drivers/net/wireless/realtek/rtw88/usb.h
+++ b/drivers/net/wireless/realtek/rtw88/usb.h
@@ -18,10 +18,6 @@ 
 
 #define RTW_USB_VENQT_CMD_IDX		0x00
 
-#define RTW_USB_SUPER_SPEED_BULK_SIZE	1024
-#define RTW_USB_HIGH_SPEED_BULK_SIZE	512
-#define RTW_USB_FULL_SPEED_BULK_SIZE	64
-
 #define RTW_USB_TX_SEL_HQ		BIT(0)
 #define RTW_USB_TX_SEL_LQ		BIT(1)
 #define RTW_USB_TX_SEL_NQ		BIT(2)
@@ -73,7 +69,6 @@  struct rtw_usb {
 	__le32 *usb_data;
 	unsigned int usb_data_index;
 
-	u32 bulkout_size;
 	u8 pipe_interrupt;
 	u8 pipe_in;
 	u8 out_ep[RTW_USB_EP_MAX];