Re: [PATCH] media: uvcvideo: Make uvc_event_control attribute name array const

Ricardo Ribalda <[email protected]> Thu, 6 Aug 2026 11:06:01 +0200
Newsgroups org.kernel.vger.linux-media
Message-ID <CANiDSCvhLt7kWn1bfz_h2Tw+SMs7AsLM-pFyhADZh2-Aor=gxA@mail.gmail.com>
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, イムティヤズ <[email protected]> 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: イムティヤズ <[email protected]>
Reviewed-by: Ricardo Ribalda <[email protected]>
> 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