* [PATCH] media: uvcvideo: Make uvc_event_control attribute name array const
@ 2026-08-05 9:34 イムティヤズ
2026-08-06 9:06 ` Ricardo Ribalda
2026-09-29 14:30 ` Hans de Goede
0 siblings, 2 replies; 5+ messages in thread
From: イムティヤズ @ 2026-08-05 9:34 UTC (permalink / raw)
To: laurent.pinchart, hansg
Cc: linux-media, イムティヤズ
The attrs array in uvc_event_control() is only ever read, never
modified. Declare it as static const char *const so the pointer array
itself is also immutable.
Signed-off-by: イムティヤズ <reza1234khan1234@gmail.com>
Assisted-by: opencode:auto/best-free
---
drivers/media/usb/uvc/uvc_status.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
index b632cf5e3fe9..97c939206302 100644
--- a/drivers/media/usb/uvc/uvc_status.c
+++ b/drivers/media/usb/uvc/uvc_status.c
@@ -165,7 +165,7 @@ static struct uvc_control *uvc_event_find_ctrl(struct uvc_device *dev,
static bool uvc_event_control(struct urb *urb,
const struct uvc_status *status, int len)
{
- static const char *attrs[] = { "value", "info", "failure", "min", "max" };
+ static const char *const attrs[] = { "value", "info", "failure", "min", "max" };
struct uvc_device *dev = urb->context;
struct uvc_video_chain *chain;
struct uvc_control *ctrl;
--
2.55.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] media: uvcvideo: Make uvc_event_control attribute name array const
2026-08-05 9:34 [PATCH] media: uvcvideo: Make uvc_event_control attribute name array const イムティヤズ
@ 2026-08-06 9:06 ` Ricardo Ribalda
2026-08-06 9:45 ` イムティヤズ
2026-09-29 14:30 ` Hans de Goede
1 sibling, 1 reply; 5+ messages in thread
From: Ricardo Ribalda @ 2026-08-06 9:06 UTC (permalink / raw)
To: イムティヤズ
Cc: laurent.pinchart, hansg, linux-media
Hi イムティヤズ
Thanks for the change. Have you checked if there are other variables
that could be constified like this?
Grouping all that family of changes would be more sustainable than
reviewing 10s of similar patches (if that was your plan :))
Thanks
On Wed, 5 Aug 2026 at 11:36, イムティヤズ <reza1234khan1234@gmail.com> wrote:
>
> The attrs array in uvc_event_control() is only ever read, never
> modified. Declare it as static const char *const so the pointer array
> itself is also immutable.
>
> Signed-off-by: イムティヤズ <reza1234khan1234@gmail.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> Assisted-by: opencode:auto/best-free
> ---
> drivers/media/usb/uvc/uvc_status.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
> index b632cf5e3fe9..97c939206302 100644
> --- a/drivers/media/usb/uvc/uvc_status.c
> +++ b/drivers/media/usb/uvc/uvc_status.c
> @@ -165,7 +165,7 @@ static struct uvc_control *uvc_event_find_ctrl(struct uvc_device *dev,
> static bool uvc_event_control(struct urb *urb,
> const struct uvc_status *status, int len)
> {
> - static const char *attrs[] = { "value", "info", "failure", "min", "max" };
> + static const char *const attrs[] = { "value", "info", "failure", "min", "max" };
> struct uvc_device *dev = urb->context;
> struct uvc_video_chain *chain;
> struct uvc_control *ctrl;
> --
> 2.55.0
>
>
--
Ricardo Ribalda
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] media: uvcvideo: Make uvc_event_control attribute name array const
2026-08-05 9:34 [PATCH] media: uvcvideo: Make uvc_event_control attribute name array const イムティヤズ
2026-08-06 9:06 ` Ricardo Ribalda
@ 2026-09-29 14:30 ` Hans de Goede
1 sibling, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2026-09-29 14:30 UTC (permalink / raw)
To: イムティヤズ,
laurent.pinchart
Cc: linux-media
Hi,
On 5-Aug-26 11:34, イムティヤズ wrote:
> The attrs array in uvc_event_control() is only ever read, never
> modified. Declare it as static const char *const so the pointer array
> itself is also immutable.
>
> Signed-off-by: イムティヤズ <reza1234khan1234@gmail.com>
> Assisted-by: opencode:auto/best-free
Thank you for your patch.
I have merged this into:
https://gitlab.freedesktop.org/linux-media/users/uvc/-/commits/for-next/
Regards,
Hans
> ---
> drivers/media/usb/uvc/uvc_status.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
> index b632cf5e3fe9..97c939206302 100644
> --- a/drivers/media/usb/uvc/uvc_status.c
> +++ b/drivers/media/usb/uvc/uvc_status.c
> @@ -165,7 +165,7 @@ static struct uvc_control *uvc_event_find_ctrl(struct uvc_device *dev,
> static bool uvc_event_control(struct urb *urb,
> const struct uvc_status *status, int len)
> {
> - static const char *attrs[] = { "value", "info", "failure", "min", "max" };
> + static const char *const attrs[] = { "value", "info", "failure", "min", "max" };
> struct uvc_device *dev = urb->context;
> struct uvc_video_chain *chain;
> struct uvc_control *ctrl;
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-29 14:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 9:34 [PATCH] media: uvcvideo: Make uvc_event_control attribute name array const イムティヤズ
2026-08-06 9:06 ` Ricardo Ribalda
2026-08-06 9:45 ` イムティヤズ
[not found] ` <CANQ=N_CC=Wzzq5XG+a+7K5KDOOHo6Z=xBXWyK8AxYmKOVOY7uw@mail.gmail.com>
2026-08-10 8:27 ` Ricardo Ribalda
2026-09-29 14:30 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox