public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Johan Hovold <johan@kernel.org>
Cc: cgel.zte@gmail.com, 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: ftdi_sio: remove the unneeded result variable
Date: Mon, 12 Sep 2022 16:33:06 +0200	[thread overview]
Message-ID: <Yx9DIpc3oTwhdRPi@kroah.com> (raw)
In-Reply-To: <Yx8/dtzrkRE4iFea@hovoldconsulting.com>

On Mon, Sep 12, 2022 at 04:17:26PM +0200, Johan Hovold wrote:
> On Mon, Sep 12, 2022 at 04:05:39PM +0200, Greg Kroah-Hartman wrote:
> > On Mon, Sep 12, 2022 at 01:38:27PM +0000, cgel.zte@gmail.com wrote:
> > > From: Xu Panda <xu.panda@zte.com.cn>
> > > 
> > > Return the value 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>
> 
> > > -       rv = usb_control_msg(port->serial->dev,
> > > -                           usb_sndctrlpipe(port->serial->dev, 0),
> > > -                           FTDI_SIO_SET_BAUDRATE_REQUEST,
> > > -                           FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE,
> > > -                           value, index,
> > > -                           NULL, 0, WDR_SHORT_TIMEOUT);
> > > -       return rv;
> > > +       return usb_control_msg(port->serial->dev,
> > > +                              usb_sndctrlpipe(port->serial->dev, 0),
> > > +                              FTDI_SIO_SET_BAUDRATE_REQUEST,
> > > +                              FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE,
> > > +                              value, index,
> > > +                              NULL, 0, WDR_SHORT_TIMEOUT);
> > >  }
> > 
> > That's really not the correct use of the return value of
> > usb_control_msg().  Can you fix this up to properly handle the return
> > value, or better yet, use the usb_control_msg_send() call?
> 
> It is actually correct since the buffer length is zero here (i.e. it
> returns a negative errno or 0).

Yeah, that's a hack :)

> But I'm also ignoring patches from this email address as it is used by
> multiple users, and of which none so far has replied to feedback (as if
> it's all automated).

Great, that's the correct thing to do here, thanks.

greg k-h

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 13:38 [PATCH linux-next] USB: serial: ftdi_sio: remove the unneeded result variable cgel.zte
2022-09-12 14:05 ` Greg KH
2022-09-12 14:17   ` Johan Hovold
2022-09-12 14:33     ` Greg KH [this message]
2022-09-12 14:06 ` Greg KH

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=Yx9DIpc3oTwhdRPi@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=cgel.zte@gmail.com \
    --cc=johan@kernel.org \
    --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