diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2023-01-27 00:14:55 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-31 09:40:42 +0100 |
commit | 8ecb17a86c0fbb86ea9fb4fa26e742600e945794 (patch) | |
tree | c4b2923d9a52e4615f2d8d4e64289307cba791a5 /drivers/media/common | |
parent | 466be4c9a6f0b7810991b4ac6c3e55345ea63954 (diff) |
usb: uvc: make uvc_format_desc table const
Since the uvc_fmts array can not be modified we declare it const and
change every user of the uvc_format_by_guid function aswell.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Tested-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20230126231456.3402323-5-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/uvc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/common/uvc.c b/drivers/media/common/uvc.c index bb96d9e26d80..2b4df3e8f48a 100644 --- a/drivers/media/common/uvc.c +++ b/drivers/media/common/uvc.c @@ -11,7 +11,7 @@ * Video formats */ -static struct uvc_format_desc uvc_fmts[] = { +static const struct uvc_format_desc uvc_fmts[] = { { .name = "YUV 4:2:2 (YUYV)", .guid = UVC_GUID_FORMAT_YUY2, @@ -204,7 +204,7 @@ static struct uvc_format_desc uvc_fmts[] = { }, }; -struct uvc_format_desc *uvc_format_by_guid(const u8 guid[16]) +const struct uvc_format_desc *uvc_format_by_guid(const u8 guid[16]) { unsigned int len = ARRAY_SIZE(uvc_fmts); unsigned int i; |