diff mbox series

media: uvcvideo: Use uvc_query_name in uvc_get_video_ctrl

Message ID 20241129151723.48275-1-xndchn@gmail.com (mailing list archive)
State New
Headers show
Series media: uvcvideo: Use uvc_query_name in uvc_get_video_ctrl | expand

Commit Message

Xiong Nandi Nov. 29, 2024, 3:17 p.m. UTC
uvc_query_name was introduced to print query name in uvc_query_ctrl.
So we can also use it in uvc_get_video_ctrl.

Signed-off-by: Xiong Nandi <xndchn@gmail.com>
---
 drivers/media/usb/uvc/uvc_video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ricardo Ribalda Nov. 29, 2024, 6:18 p.m. UTC | #1
On Fri, 29 Nov 2024 at 16:18, Xiong Nandi <xndchn@gmail.com> wrote:
>
> uvc_query_name was introduced to print query name in uvc_query_ctrl.
> So we can also use it in uvc_get_video_ctrl.
>
> Signed-off-by: Xiong Nandi <xndchn@gmail.com>
> ---
>  drivers/media/usb/uvc/uvc_video.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index e00f38dd07d9..93cacd2c8721 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -297,8 +297,8 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
>                 goto out;
>         } else if (ret != size) {
>                 dev_err(&stream->intf->dev,
> -                       "Failed to query (%u) UVC %s control : %d (exp. %u).\n",
> -                       query, probe ? "probe" : "commit", ret, size);
> +                       "Failed to query (%s) UVC %s control : %d (exp. %u).\n",
> +                       uvc_query_name(query), probe ? "probe" : "commit", ret, size);
nit: This is above 80 characters. Please move size to the next line,
aligned to uvc_query_name

With that change:

Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>

>                 ret = (ret == -EPROTO) ? -EPROTO : -EIO;
>                 goto out;
>         }
> --
> 2.25.1
>
>
Laurent Pinchart Nov. 29, 2024, 9:43 p.m. UTC | #2
On Fri, Nov 29, 2024 at 07:18:55PM +0100, Ricardo Ribalda wrote:
> On Fri, 29 Nov 2024 at 16:18, Xiong Nandi <xndchn@gmail.com> wrote:
> >
> > uvc_query_name was introduced to print query name in uvc_query_ctrl.
> > So we can also use it in uvc_get_video_ctrl.
> >
> > Signed-off-by: Xiong Nandi <xndchn@gmail.com>
> > ---
> >  drivers/media/usb/uvc/uvc_video.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> > index e00f38dd07d9..93cacd2c8721 100644
> > --- a/drivers/media/usb/uvc/uvc_video.c
> > +++ b/drivers/media/usb/uvc/uvc_video.c
> > @@ -297,8 +297,8 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
> >                 goto out;
> >         } else if (ret != size) {
> >                 dev_err(&stream->intf->dev,
> > -                       "Failed to query (%u) UVC %s control : %d (exp. %u).\n",
> > -                       query, probe ? "probe" : "commit", ret, size);
> > +                       "Failed to query (%s) UVC %s control : %d (exp. %u).\n",
> > +                       uvc_query_name(query), probe ? "probe" : "commit", ret, size);
>
> nit: This is above 80 characters. Please move size to the next line,
> aligned to uvc_query_name

I can make that change when applying the patch, no need to send a new
version.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


> With that change:
> 
> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> 
> >                 ret = (ret == -EPROTO) ? -EPROTO : -EIO;
> >                 goto out;
> >         }
Hans de Goede Dec. 2, 2024, 3:04 p.m. UTC | #3
Hi,

On 29-Nov-24 4:17 PM, Xiong Nandi wrote:
> uvc_query_name was introduced to print query name in uvc_query_ctrl.
> So we can also use it in uvc_get_video_ctrl.
> 
> Signed-off-by: Xiong Nandi <xndchn@gmail.com>

Thank you for your patch.

I have merged this into:

https://gitlab.freedesktop.org/linux-media/users/uvc/-/commits/next/

with the line-wrapping fixed to 80 chars.

Regards,

Hans


> ---
>  drivers/media/usb/uvc/uvc_video.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index e00f38dd07d9..93cacd2c8721 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -297,8 +297,8 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
>  		goto out;
>  	} else if (ret != size) {
>  		dev_err(&stream->intf->dev,
> -			"Failed to query (%u) UVC %s control : %d (exp. %u).\n",
> -			query, probe ? "probe" : "commit", ret, size);
> +			"Failed to query (%s) UVC %s control : %d (exp. %u).\n",
> +			uvc_query_name(query), probe ? "probe" : "commit", ret, size);
>  		ret = (ret == -EPROTO) ? -EPROTO : -EIO;
>  		goto out;
>  	}
diff mbox series

Patch

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index e00f38dd07d9..93cacd2c8721 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -297,8 +297,8 @@  static int uvc_get_video_ctrl(struct uvc_streaming *stream,
 		goto out;
 	} else if (ret != size) {
 		dev_err(&stream->intf->dev,
-			"Failed to query (%u) UVC %s control : %d (exp. %u).\n",
-			query, probe ? "probe" : "commit", ret, size);
+			"Failed to query (%s) UVC %s control : %d (exp. %u).\n",
+			uvc_query_name(query), probe ? "probe" : "commit", ret, size);
 		ret = (ret == -EPROTO) ? -EPROTO : -EIO;
 		goto out;
 	}