From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Martin Kaiser <martin@kaiser.cx>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
Pavel Skripkin <paskripkin@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: r8188eu: remove NULL check for usb_kill_urb
Date: Wed, 11 Jan 2023 23:09:47 +0100 [thread overview]
Message-ID: <b910456d-6306-d532-224e-81f862636930@gmail.com> (raw)
In-Reply-To: <20230111100201.251905-1-martin@kaiser.cx>
On 1/11/23 11:02, Martin Kaiser wrote:
> usb_kill_urb handles a NULL parameter. There's no need for NULL checks
> before we call usb_kill_urb.
>
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
> index 62106d2f82ad..583533631133 100644
> --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
> +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
> @@ -29,8 +29,7 @@ void rtw_read_port_cancel(struct adapter *padapter)
>
> for (i = 0; i < NR_RECVBUFF; i++) {
> precvbuf->reuse = true;
> - if (precvbuf->purb)
> - usb_kill_urb(precvbuf->purb);
> + usb_kill_urb(precvbuf->purb);
> precvbuf++;
> }
> }
> @@ -153,15 +152,13 @@ void rtw_write_port_cancel(struct adapter *padapter)
> padapter->bWritePortCancel = true;
>
> for (i = 0; i < NR_XMITBUFF; i++) {
> - if (pxmitbuf->pxmit_urb)
> - usb_kill_urb(pxmitbuf->pxmit_urb);
> + usb_kill_urb(pxmitbuf->pxmit_urb);
> pxmitbuf++;
> }
>
> pxmitbuf = (struct xmit_buf *)padapter->xmitpriv.pxmit_extbuf;
> for (i = 0; i < NR_XMIT_EXTBUFF; i++) {
> - if (pxmitbuf->pxmit_urb)
> - usb_kill_urb(pxmitbuf->pxmit_urb);
> + usb_kill_urb(pxmitbuf->pxmit_urb);
> pxmitbuf++;
> }
> }
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
prev parent reply other threads:[~2023-01-11 22:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 10:02 Martin Kaiser
2023-01-11 22:09 ` Philipp Hortmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b910456d-6306-d532-224e-81f862636930@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=martin@kaiser.cx \
--cc=paskripkin@gmail.com \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®