All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net
Subject: Re: [PATCH] usb: storage: freecom: drop useless assignment in init_freecom()
Date: Mon, 22 Jan 2024 13:53:51 -0500	[thread overview]
Message-ID: <0ce435c2-5ee4-4d3b-b6e2-f185f1d34749@rowland.harvard.edu> (raw)
In-Reply-To: <cc7434e0-804c-82d6-3f57-dcceef8b461e@omp.ru>

On Mon, Jan 22, 2024 at 09:26:51PM +0300, Sergey Shtylyov wrote:
> On 12/7/23 7:16 PM, Sergey Shtylyov wrote:
> 
> [...]
> >>> In init_freecom(), the results of usb_stor_control_msg() calls are stored
> >>> in the local variable and then printed out by usb_stor_dbg() (if enabled),
> >>> except for the 1st call, the result of which is completely ignored.  Drop
> >>> the useless assignment.
> >>
> >> Instead, you should check the return value and handle it properly, don't
> >> just drop the checking entirely, that's not good.
> > 
> >    Hmm... I wonder if you'd actually read the patch...
> >    I'm not dropping any checking because there's none, even at the further
> > call sites of usb_stor_control_msg() -- the most init_freecom() currently
> > is doing is printing out the result of the calls...
> 
>    Alan, haven't heard your opinion on this patch... What do you think?

Oh, sorry about that.  There's nothing wrong with the patch.  None of 
the return values in that function are used for anything other than 
debug log messages.  (It's a little surprising that the original author 
of this driver didn't put any error checking here.)

Greg, feel free to merge the patch.

Acked-by: Alan Stern <stern@rowland.harvard.edu>

Alan Stern

      reply	other threads:[~2024-01-22 18:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 20:43 [PATCH] usb: storage: freecom: drop useless assignment in init_freecom() Sergey Shtylyov
2023-12-04  7:04 ` Greg Kroah-Hartman
2023-12-07 16:16   ` Sergey Shtylyov
2024-01-22 18:26     ` Sergey Shtylyov
2024-01-22 18:53       ` Alan Stern [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=0ce435c2-5ee4-4d3b-b6e2-f185f1d34749@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=s.shtylyov@omp.ru \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.