* [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb()
@ 2023-10-08 2:58 Jinjie Ruan
2023-10-09 5:55 ` Sascha Hauer
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jinjie Ruan @ 2023-10-08 2:58 UTC (permalink / raw)
To: linux-wireless, Ping-Ke Shih, Kalle Valo, neo_jou, Sascha Hauer,
Hans Ulli Kroll
Cc: ruanjinjie
Both usb_kill_urb() and usb_free_urb() do the NULL check itself, so there
is no need to duplicate it prior to calling.
Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
drivers/net/wireless/realtek/rtw88/usb.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
index d879d7e3dc81..e6ab1ac6d709 100644
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -611,8 +611,7 @@ static void rtw_usb_cancel_rx_bufs(struct rtw_usb *rtwusb)
for (i = 0; i < RTW_USB_RXCB_NUM; i++) {
rxcb = &rtwusb->rx_cb[i];
- if (rxcb->rx_urb)
- usb_kill_urb(rxcb->rx_urb);
+ usb_kill_urb(rxcb->rx_urb);
}
}
@@ -623,10 +622,8 @@ static void rtw_usb_free_rx_bufs(struct rtw_usb *rtwusb)
for (i = 0; i < RTW_USB_RXCB_NUM; i++) {
rxcb = &rtwusb->rx_cb[i];
- if (rxcb->rx_urb) {
- usb_kill_urb(rxcb->rx_urb);
- usb_free_urb(rxcb->rx_urb);
- }
+ usb_kill_urb(rxcb->rx_urb);
+ usb_free_urb(rxcb->rx_urb);
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb()
2023-10-08 2:58 [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() Jinjie Ruan
@ 2023-10-09 5:55 ` Sascha Hauer
2023-10-11 1:03 ` Ping-Ke Shih
2023-10-11 9:18 ` Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2023-10-09 5:55 UTC (permalink / raw)
To: Jinjie Ruan
Cc: linux-wireless, Ping-Ke Shih, Kalle Valo, neo_jou,
Hans Ulli Kroll
On Sun, Oct 08, 2023 at 10:58:52AM +0800, Jinjie Ruan wrote:
> Both usb_kill_urb() and usb_free_urb() do the NULL check itself, so there
> is no need to duplicate it prior to calling.
>
> Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> drivers/net/wireless/realtek/rtw88/usb.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha
>
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> index d879d7e3dc81..e6ab1ac6d709 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.c
> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> @@ -611,8 +611,7 @@ static void rtw_usb_cancel_rx_bufs(struct rtw_usb *rtwusb)
>
> for (i = 0; i < RTW_USB_RXCB_NUM; i++) {
> rxcb = &rtwusb->rx_cb[i];
> - if (rxcb->rx_urb)
> - usb_kill_urb(rxcb->rx_urb);
> + usb_kill_urb(rxcb->rx_urb);
> }
> }
>
> @@ -623,10 +622,8 @@ static void rtw_usb_free_rx_bufs(struct rtw_usb *rtwusb)
>
> for (i = 0; i < RTW_USB_RXCB_NUM; i++) {
> rxcb = &rtwusb->rx_cb[i];
> - if (rxcb->rx_urb) {
> - usb_kill_urb(rxcb->rx_urb);
> - usb_free_urb(rxcb->rx_urb);
> - }
> + usb_kill_urb(rxcb->rx_urb);
> + usb_free_urb(rxcb->rx_urb);
> }
> }
>
> --
> 2.34.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] 4+ messages in thread
* RE: [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb()
2023-10-08 2:58 [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() Jinjie Ruan
2023-10-09 5:55 ` Sascha Hauer
@ 2023-10-11 1:03 ` Ping-Ke Shih
2023-10-11 9:18 ` Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Ping-Ke Shih @ 2023-10-11 1:03 UTC (permalink / raw)
To: Jinjie Ruan, linux-wireless@vger.kernel.org, Kalle Valo, neo_jou,
Sascha Hauer, Hans Ulli Kroll
> -----Original Message-----
> From: Jinjie Ruan <ruanjinjie@huawei.com>
> Sent: Sunday, October 8, 2023 10:59 AM
> To: linux-wireless@vger.kernel.org; Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo <kvalo@kernel.org>;
> neo_jou <neo_jou@realtek.com>; Sascha Hauer <s.hauer@pengutronix.de>; Hans Ulli Kroll
> <linux@ulli-kroll.de>
> Cc: ruanjinjie@huawei.com
> Subject: [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb()
>
> Both usb_kill_urb() and usb_free_urb() do the NULL check itself, so there
> is no need to duplicate it prior to calling.
>
> Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb()
2023-10-08 2:58 [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() Jinjie Ruan
2023-10-09 5:55 ` Sascha Hauer
2023-10-11 1:03 ` Ping-Ke Shih
@ 2023-10-11 9:18 ` Kalle Valo
2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2023-10-11 9:18 UTC (permalink / raw)
To: Jinjie Ruan
Cc: linux-wireless, Ping-Ke Shih, neo_jou, Sascha Hauer,
Hans Ulli Kroll, ruanjinjie
Jinjie Ruan <ruanjinjie@huawei.com> wrote:
> Both usb_kill_urb() and usb_free_urb() do the NULL check itself, so there
> is no need to duplicate it prior to calling.
>
> Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Patch applied to wireless-next.git, thanks.
de8dd0969498 wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb()
--
https://patchwork.kernel.org/project/linux-wireless/patch/20231008025852.1239450-1-ruanjinjie@huawei.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-11 9:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-08 2:58 [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() Jinjie Ruan
2023-10-09 5:55 ` Sascha Hauer
2023-10-11 1:03 ` Ping-Ke Shih
2023-10-11 9:18 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).