Re: [PATCH v3 3/3] media: uvcvideo: Enclose UVC_INFO_* macros in parentheses

From: Laurent Pinchart

Date: Tue Dec 01 2026 - 01:32:43 EST


On Tue, Dec 01, 2026 at 06:20:45AM +0000, Ricardo Ribalda wrote:
> Wrap the values around UVC_INFO_QUIRK() and UVC_INFO_META() in
> parentheses to fix checkpatch.pl errors:
>
> ERROR: Macros with complex values should be enclosed in parentheses

It's one of those cases where I would have ignored checkpatch, as those
macros are used in very specific contexts that should make them safe
without parentheses. If you think parentheses are better, I don't mind.

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

> No functional change intended.
>
> Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
> ---
> drivers/media/usb/uvc/uvc_driver.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 81373cafad2c..4ca3502df2a2 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -2536,9 +2536,10 @@ static const struct uvc_device_info uvc_quirk_force_y8 = {
> .quirks = UVC_QUIRK_FORCE_Y8,
> };
>
> -#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
> -#define UVC_INFO_META(m) (kernel_ulong_t)&(struct uvc_device_info) \
> - {.meta_format = m}
> +#define UVC_INFO_QUIRK(q) \
> + ((kernel_ulong_t)&(struct uvc_device_info){ .quirks = (q) })
> +#define UVC_INFO_META(m) \
> + ((kernel_ulong_t)&(struct uvc_device_info){ .meta_format = (m) })
> #define UVC_INFO_VERSION(v) \
> ((kernel_ulong_t)&(const struct uvc_device_info){ .uvc_version = (v) })
>

--
Regards,

Laurent Pinchart