public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: cgel.zte@gmail.com
Cc: balbi@kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, Xu Panda <xu.panda@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] USB: serial: keyspan_pda: remove the unneeded result variable
Date: Mon, 12 Sep 2022 16:08:42 +0200	[thread overview]
Message-ID: <Yx89armgxAEn61TL@kroah.com> (raw)
In-Reply-To: <20220912103700.18338-1-xu.panda@zte.com.cn>

On Mon, Sep 12, 2022 at 10:37:01AM +0000, cgel.zte@gmail.com wrote:
> From: Xu Panda <xu.panda@zte.com.cn>
> 
> Return the usb_control_msg() directly instead of storing it in
> another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
> ---
>  drivers/usb/serial/keyspan_pda.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
> index 6fd15cd9e1eb..902675ac7f5c 100644
> --- a/drivers/usb/serial/keyspan_pda.c
> +++ b/drivers/usb/serial/keyspan_pda.c
> @@ -393,12 +393,10 @@ static int keyspan_pda_get_modem_info(struct usb_serial *serial,
>  static int keyspan_pda_set_modem_info(struct usb_serial *serial,
>                                       unsigned char value)
>  {
> -       int rc;
> -       rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
> -                            3, /* set pins */
> -                            USB_TYPE_VENDOR|USB_RECIP_INTERFACE|USB_DIR_OUT,
> -                            value, 0, NULL, 0, 2000);
> -       return rc;
> +       return usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
> +                              3, /* set pins */
> +                              USB_TYPE_VENDOR|USB_RECIP_INTERFACE|USB_DIR_OUT,
> +                              value, 0, NULL, 0, 2000);
>  }

Again, incorrect use of the usb_control_msg() return value.

      reply	other threads:[~2022-09-12 14:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 10:37 [PATCH linux-next] USB: serial: keyspan_pda: remove the unneeded result variable cgel.zte
2022-09-12 14:08 ` Greg KH [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=Yx89armgxAEn61TL@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@kernel.org \
    --cc=cgel.zte@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=xu.panda@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /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