usb: uvcvideo: remove unneeded goto
Commit Message
The goto statement in uvc_v4l2_try_format can simply be replaced by an
direct return. There is no further user of the label, so remove it.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/media/usb/uvc/uvc_v4l2.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Hi Michael,
On Thu, Jun 16, 2022 at 09:54:54PM +0200, Michael Grzeschik wrote:
> The goto statement in uvc_v4l2_try_format can simply be replaced by an
> direct return. There is no further user of the label, so remove it.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
> drivers/media/usb/uvc/uvc_v4l2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
> index 26cf0517e36195..957f44f44a9a14 100644
> --- a/drivers/media/usb/uvc/uvc_v4l2.c
> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> @@ -254,7 +254,7 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
> ret = uvc_probe_video(stream, probe);
> mutex_unlock(&stream->mutex);
> if (ret < 0)
> - goto done;
> + return ret;
>
> /* After the probe, update fmt with the values returned from
> * negotiation with the device. Some devices return invalid bFormatIndex
> @@ -300,7 +300,6 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
> if (uvc_frame != NULL)
> *uvc_frame = frame;
>
> -done:
> return ret;
> }
>
> --
> 2.30.2
>
Hi Michael,
Thank you for the patch.
On Thu, Jun 16, 2022 at 09:54:54PM +0200, Michael Grzeschik wrote:
> The goto statement in uvc_v4l2_try_format can simply be replaced by an
> direct return. There is no further user of the label, so remove it.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
With s/usb: /media: / in the subject line,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I'll fix this when applying.
> ---
> drivers/media/usb/uvc/uvc_v4l2.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
> index 26cf0517e36195..957f44f44a9a14 100644
> --- a/drivers/media/usb/uvc/uvc_v4l2.c
> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> @@ -254,7 +254,7 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
> ret = uvc_probe_video(stream, probe);
> mutex_unlock(&stream->mutex);
> if (ret < 0)
> - goto done;
> + return ret;
>
> /* After the probe, update fmt with the values returned from
> * negotiation with the device. Some devices return invalid bFormatIndex
> @@ -300,7 +300,6 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
> if (uvc_frame != NULL)
> *uvc_frame = frame;
>
> -done:
> return ret;
> }
>
@@ -254,7 +254,7 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
ret = uvc_probe_video(stream, probe);
mutex_unlock(&stream->mutex);
if (ret < 0)
- goto done;
+ return ret;
/* After the probe, update fmt with the values returned from
* negotiation with the device. Some devices return invalid bFormatIndex
@@ -300,7 +300,6 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
if (uvc_frame != NULL)
*uvc_frame = frame;
-done:
return ret;
}