Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1737695
| From | Julia Lawall <julia.lawall@lip6.fr> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] [media] spca500: Use common error handling code in spca500_synch310() |
| Date | 2017-09-22 19:10 +0200 |
| Message-ID | <uszCG-kW-5@gated-at.bofh.it> (permalink) |
| References | <uszCG-kW-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, 22 Sep 2017, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Sep 2017 18:45:07 +0200
>
> Adjust a jump target so that a bit of exception handling can be better
> reused at the end of this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/media/usb/gspca/spca500.c | 21 ++++++++++-----------
> 1 file changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/media/usb/gspca/spca500.c b/drivers/media/usb/gspca/spca500.c
> index da2d9027914c..1f224f5e5b19 100644
> --- a/drivers/media/usb/gspca/spca500.c
> +++ b/drivers/media/usb/gspca/spca500.c
> @@ -501,7 +501,6 @@ static int spca500_full_reset(struct gspca_dev *gspca_dev)
> static int spca500_synch310(struct gspca_dev *gspca_dev)
> {
> - if (usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0) < 0) {
> - PERR("Set packet size: set interface error");
> - goto error;
> - }
> + if (usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0) < 0)
> + goto report_failure;
> +
> spca500_ping310(gspca_dev);
> @@ -514,12 +513,12 @@ static int spca500_synch310(struct gspca_dev *gspca_dev)
> /* Windoze use pipe with altsetting 6 why 7 here */
> - if (usb_set_interface(gspca_dev->dev,
> - gspca_dev->iface,
> - gspca_dev->alt) < 0) {
> - PERR("Set packet size: set interface error");
> - goto error;
> - }
> + if (usb_set_interface(gspca_dev->dev, gspca_dev->iface, gspca_dev->alt)
> + < 0)
> + goto report_failure;
> +
> return 0;
> -error:
> +
> +report_failure:
> + PERR("Set packet size: set interface error");
> return -EBUSY;
> }
Why change the label name? They are both equally uninformative.
julia
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] [media] spca500: Use common error handling code in spca500_synch310() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-22 19:10 +0200
Re: [PATCH] [media] spca500: Use common error handling code in spca500_synch310() Julia Lawall <julia.lawall@lip6.fr> - 2017-09-22 19:10 +0200
Re: [media] spca500: Use common error handling code in spca500_synch310() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-22 19:50 +0200
Re: [media] spca500: Use common error handling code in spca500_synch310() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-22 19:50 +0200
Re: [media] spca500: Use common error handling code in spca500_synch310() Daniele Nicolodi <daniele@grinta.net> - 2017-09-22 20:40 +0200
Re: [media] spca500: Use common error handling code in spca500_synch310() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-22 22:50 +0200
Re: [media] spca500: Use common error handling code in spca500_synch310() Joe Perches <joe@perches.com> - 2017-09-22 20:40 +0200
Re: [media] spca500: Use common error handling code in spca500_synch310() Julia Lawall <julia.lawall@lip6.fr> - 2017-09-22 19:50 +0200
csiph-web