linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Ladislav Michl <ladis@linux-mips.org>
Cc: linux-usb@vger.kernel.org, Johan Hovold <johan@kernel.org>
Subject: USB: serial: Avoid goto in bulk callbacks
Date: Mon, 11 Dec 2017 11:13:51 +0100	[thread overview]
Message-ID: <20171211101351.GI5672@localhost> (raw)

On Mon, Dec 11, 2017 at 12:11:52AM +0100, Ladislav Michl wrote:
> Refactor bulk callback functions to make use of goto pointless.
> 
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> ---
>  drivers/usb/serial/generic.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
> index 2274d9625f63..d1a09ba10b6f 100644
> --- a/drivers/usb/serial/generic.c
> +++ b/drivers/usb/serial/generic.c
> @@ -389,6 +389,9 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
>  							urb->actual_length);
>  	switch (status) {
>  	case 0:
> +		usb_serial_debug_data(&port->dev, __func__,
> +					urb->actual_length, data);
> +		port->serial->type->process_read_urb(urb);
>  		break;

So as for the ti driver, I prefer keeping the success path out of the
switch statement.

Thanks,
Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2017-12-11 10:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 10:13 Johan Hovold [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-12-11 11:16 USB: serial: Avoid goto in bulk callbacks Ladislav Michl
2017-12-11 10:58 Oliver Neukum
2017-12-10 23:11 Ladislav Michl

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=20171211101351.GI5672@localhost \
    --to=johan@kernel.org \
    --cc=ladis@linux-mips.org \
    --cc=linux-usb@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).