Re: [PATCH] staging: gdm72xx: remove unneeded test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 27, 2015 at 5:25 PM, Laurent Navet <laurent.navet@xxxxxxxxx> wrote:
> The same code is executed regardless ret value, so this test can be
> removed.
>
> Signed-off-by: Laurent Navet <laurent.navet@xxxxxxxxx>
> ---
>  drivers/staging/gdm72xx/usb_boot.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/gdm72xx/usb_boot.c b/drivers/staging/gdm72xx/usb_boot.c
> index 3ccc447..7f80553 100644
> --- a/drivers/staging/gdm72xx/usb_boot.c
> +++ b/drivers/staging/gdm72xx/usb_boot.c
> @@ -255,8 +255,6 @@ static int em_wait_ack(struct usb_device *usbdev, int send_zlp)
>
>         /*Wait for ACK*/
>         ret = gdm_wibro_recv(usbdev, &ack, sizeof(ack));
> -       if (ret < 0)
> -               goto out;
>  out:
>         return ret;
>  }

What about removing the 'out' label like this?

--- a/drivers/staging/gdm72xx/usb_boot.c
+++ b/drivers/staging/gdm72xx/usb_boot.c
@@ -250,15 +250,11 @@ static int em_wait_ack(struct usb_device *usbdev, int send
                /*Send ZLP*/
                ret = gdm_wibro_send(usbdev, NULL, 0);
                if (ret < 0)
-                       goto out;
+                       return ret;
        }

        /*Wait for ACK*/
-       ret = gdm_wibro_recv(usbdev, &ack, sizeof(ack));
-       if (ret < 0)
-               goto out;
-out:
-       return ret;
+       return gdm_wibro_recv(usbdev, &ack, sizeof(ack));
 }
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux