LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michael Straube <straube.linux@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>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/10] staging: r8188eu: set pipe only once
Date: Sun, 22 Aug 2021 16:05:12 +0200	[thread overview]
Message-ID: <088d6fbb-b231-e669-1f0d-5adea7ac4685@gmail.com> (raw)
In-Reply-To: <20210821164859.4351-10-martin@kaiser.cx>

On 8/21/21 6:48 PM, Martin Kaiser wrote:
> Set the pipe for reading or writing in usbctrl_vendorreq only once.
> There's no need to set it again for every retry.
> 
> This patch is an adaptation of commit 889ed8b5e374 ("staging: rtl8188eu:
> set pipe only once") for the new r8188eu driver.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>   drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 ++++++++-------
>   1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
> index 5408383ccec3..5a55ee38d7b8 100644
> --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
> +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
> @@ -40,15 +40,16 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, void *pdata,
>   		goto release_mutex;
>   	}
>   
> -	while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
> -		memset(pIo_buf, 0, len);
> +	if (requesttype == REALTEK_USB_VENQT_READ)
> +		pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
> +	else
> +		pipe = usb_sndctrlpipe(udev, 0);/* write_out */
>   
> -		if (requesttype == REALTEK_USB_VENQT_READ) {
> -			pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
> -		} else {
> -			pipe = usb_sndctrlpipe(udev, 0);/* write_out */
> +	while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
> +		if (requesttype == REALTEK_USB_VENQT_READ)
> +			memset(pIo_buf, 0, len);
> +		else
>   			memcpy(pIo_buf, pdata, len);
> -		}
>   
>   		status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ,
>   					 requesttype, value, REALTEK_USB_VENQT_CMD_IDX,
> 

Looks good to me.

Acked-by: Michael Straube <straube.linux@gmail.com>

Thanks,
Michael

  parent reply	other threads:[~2021-08-22 14:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-21 16:48 [PATCH 01/10] staging: r8188eu: remove unnecessary cast Martin Kaiser
2021-08-21 16:48 ` [PATCH 02/10] staging: r8188eu: remove unused define Martin Kaiser
2021-08-21 17:27   ` Phillip Potter
2021-08-22 11:56   ` Michael Straube
2021-08-21 16:48 ` [PATCH 03/10] staging: rtl8188eu: use actual request type as parameter Martin Kaiser
2021-08-21 17:44   ` Phillip Potter
2021-08-22 12:08   ` Michael Straube
2021-08-21 16:48 ` [PATCH 04/10] staging: r8188eu: rewrite usb vendor request defines Martin Kaiser
2021-08-21 17:45   ` Phillip Potter
2021-08-22 12:18   ` Michael Straube
2021-08-21 16:48 ` [PATCH 05/10] staging: r8188eu: remove an unused enum Martin Kaiser
2021-08-21 17:29   ` Phillip Potter
2021-08-22 12:19   ` Michael Straube
2021-08-21 16:48 ` [PATCH 06/10] staging: r8188eu: clean up the usb_readXY functions Martin Kaiser
2021-08-21 17:45   ` Phillip Potter
2021-08-22 12:25   ` Michael Straube
2021-08-21 16:48 ` [PATCH 07/10] staging: r8188eu: clean up the usb_writeXY functions Martin Kaiser
2021-08-21 17:46   ` Phillip Potter
2021-08-22 12:27   ` Michael Straube
2021-08-21 16:48 ` [PATCH 08/10] staging: r8188eu: clean up the usb_writeN Martin Kaiser
2021-08-21 17:47   ` Phillip Potter
2021-08-22 13:24   ` Michael Straube
2021-08-22 16:58     ` Martin Kaiser
2021-08-22 17:17       ` Michael Straube
2021-08-21 16:48 ` [PATCH 09/10] staging: r8188eu: remove unused members of struct _io_ops Martin Kaiser
2021-08-21 17:29   ` Phillip Potter
2021-08-22 13:28   ` Michael Straube
2021-08-21 16:48 ` [PATCH 10/10] staging: r8188eu: set pipe only once Martin Kaiser
2021-08-21 17:47   ` Phillip Potter
2021-08-22 14:05   ` Michael Straube [this message]
2021-08-21 17:27 ` [PATCH 01/10] staging: r8188eu: remove unnecessary cast Phillip Potter
2021-08-22 17:04   ` Martin Kaiser
2021-08-22 23:49     ` Phillip Potter
2021-08-22 11:54 ` Michael Straube

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=088d6fbb-b231-e669-1f0d-5adea7ac4685@gmail.com \
    --to=straube.linux@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=phil@philpotter.co.uk \
    --subject='Re: [PATCH 10/10] staging: r8188eu: set pipe only once' \
    /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

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