public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: webcam: Make g_webcam loadable again
@ 2023-12-08 12:52 Andrzej Pietrasiewicz
  2023-12-08 13:13 ` [PATCH v2] " Andrzej Pietrasiewicz
  2023-12-08 13:22 ` [PATCH] " Laurent Pinchart
  0 siblings, 2 replies; 17+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-12-08 12:52 UTC (permalink / raw)
  To: linux-usb
  Cc: Laurent Pinchart, Daniel Scally, Greg Kroah-Hartman,
	Michael Grzeschik, Andrzej Pietrasiewicz, kernel

commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")

has rendered the precomposed (aka legacy) webcam gadget unloadable.

uvc_alloc() since then has depended on certain config groups being
available in configfs tree related to the UVC function. However, legacy
gadgets do not create anything in configfs, so uvc_alloc() must fail
with -ENOENT no matter what.

This patch mimics the required configfs hierarchy to satisfy the code which
inspects formats and frames found in uvcg_streaming_header.

This has been tested with guvcview on the host side, using vivid as a
source of video stream on the device side and using the userspace program
found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
---
 drivers/usb/gadget/function/f_uvc.c |  45 +++---
 drivers/usb/gadget/function/u_uvc.h |   6 +
 drivers/usb/gadget/legacy/webcam.c  | 232 ++++++++++++++++++++++------
 3 files changed, 215 insertions(+), 68 deletions(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 786379f1b7b7..3b46de85ca01 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -960,7 +960,8 @@ static void uvc_free(struct usb_function *f)
 	struct uvc_device *uvc = to_uvc(f);
 	struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts,
 					       func_inst);
-	config_item_put(&uvc->header->item);
+	if (!opts->header)
+		config_item_put(&uvc->header->item);
 	--opts->refcnt;
 	kfree(uvc);
 }
@@ -1052,25 +1053,29 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
 	uvc->desc.hs_streaming = opts->hs_streaming;
 	uvc->desc.ss_streaming = opts->ss_streaming;
 
-	streaming = config_group_find_item(&opts->func_inst.group, "streaming");
-	if (!streaming)
-		goto err_config;
-
-	header = config_group_find_item(to_config_group(streaming), "header");
-	config_item_put(streaming);
-	if (!header)
-		goto err_config;
-
-	h = config_group_find_item(to_config_group(header), "h");
-	config_item_put(header);
-	if (!h)
-		goto err_config;
-
-	uvc->header = to_uvcg_streaming_header(h);
-	if (!uvc->header->linked) {
-		mutex_unlock(&opts->lock);
-		kfree(uvc);
-		return ERR_PTR(-EBUSY);
+	if (opts->header) {
+		uvc->header = opts->header;
+	} else {
+		streaming = config_group_find_item(&opts->func_inst.group, "streaming");
+		if (!streaming)
+			goto err_config;
+
+		header = config_group_find_item(to_config_group(streaming), "header");
+		config_item_put(streaming);
+		if (!header)
+			goto err_config;
+
+		h = config_group_find_item(to_config_group(header), "h");
+		config_item_put(header);
+		if (!h)
+			goto err_config;
+
+		uvc->header = to_uvcg_streaming_header(h);
+		if (!uvc->header->linked) {
+			mutex_unlock(&opts->lock);
+			kfree(uvc);
+			return ERR_PTR(-EBUSY);
+		}
 	}
 
 	uvc->desc.extension_units = &opts->extension_units;
diff --git a/drivers/usb/gadget/function/u_uvc.h b/drivers/usb/gadget/function/u_uvc.h
index 1ce58f61253c..3ac392cbb779 100644
--- a/drivers/usb/gadget/function/u_uvc.h
+++ b/drivers/usb/gadget/function/u_uvc.h
@@ -98,6 +98,12 @@ struct f_uvc_opts {
 	 */
 	struct mutex			lock;
 	int				refcnt;
+
+	/*
+	 * Only for legacy gadget. Shall be NULL for configfs-composed gadgets,
+	 * which is guaranteed by alloc_inst implementation of f_uvc doing kzalloc.
+	 */
+	struct uvcg_streaming_header	*header;
 };
 
 #endif /* U_UVC_H */
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
index c06dd1af7a0c..6700c5e17055 100644
--- a/drivers/usb/gadget/legacy/webcam.c
+++ b/drivers/usb/gadget/legacy/webcam.c
@@ -12,6 +12,7 @@
 #include <linux/usb/video.h>
 
 #include "u_uvc.h"
+#include "uvc_configfs.h"
 
 USB_GADGET_COMPOSITE_OPTIONS();
 
@@ -84,8 +85,6 @@ static struct usb_device_descriptor webcam_device_descriptor = {
 	.bNumConfigurations	= 0, /* dynamic */
 };
 
-DECLARE_UVC_HEADER_DESCRIPTOR(1);
-
 static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
 	.bLength		= UVC_DT_HEADER_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -158,21 +157,44 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
 	.bmaControls[1][0]	= 4,
 };
 
-static const struct uvc_format_uncompressed uvc_format_yuv = {
-	.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
-	.bFormatIndex		= 1,
-	.bNumFrameDescriptors	= 2,
-	.guidFormat		=
-		{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
-		 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71},
-	.bBitsPerPixel		= 16,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static const struct uvcg_color_matching uvcg_color_matching = {
+	.desc = {
+		.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_COLORFORMAT,
+		.bColorPrimaries	= 1,
+		.bTransferCharacteristics	= 1,
+		.bMatrixCoefficients	= 4,
+	},
+};
+
+static struct uvcg_uncompressed uvcg_format_yuv = {
+	.fmt = {
+		.type			= UVCG_UNCOMPRESSED,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
+		.bFormatIndex		= 1,
+		.bNumFrameDescriptors	= 2,
+		.guidFormat		= {
+			'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
+			 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
+		},
+		.bBitsPerPixel		= 16,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_yuv = {
+	.fmt = &uvcg_format_yuv.fmt,
 };
 
 DECLARE_UVC_FRAME_UNCOMPRESSED(1);
@@ -196,6 +218,29 @@ static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
 	.dwFrameInterval[2]	= cpu_to_le32(5000000),
 };
 
+static const struct uvcg_frame uvcg_frame_yuv_360p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= uvc_frame_yuv_360p.bLength,
+		.b_descriptor_type		= uvc_frame_yuv_360p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_yuv_360p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_yuv_360p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_yuv_360p.bmCapabilities,
+		.w_width			= uvc_frame_yuv_360p.wWidth,
+		.w_height			= uvc_frame_yuv_360p.wHeight,
+		.dw_min_bit_rate		= uvc_frame_yuv_360p.dwMinBitRate,
+		.dw_max_bit_rate		= uvc_frame_yuv_360p.dwMaxBitRate,
+		.dw_max_video_frame_buffer_size	= uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize,
+		.dw_default_frame_interval	= uvc_frame_yuv_360p.dwDefaultFrameInterval,
+		.b_frame_interval_type		= uvc_frame_yuv_360p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= (u32 *)uvc_frame_yuv_360p.dwFrameInterval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_360p,
+};
+
 static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -212,18 +257,52 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.dwFrameInterval[0]	= cpu_to_le32(5000000),
 };
 
-static const struct uvc_format_mjpeg uvc_format_mjpg = {
-	.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
-	.bFormatIndex		= 2,
-	.bNumFrameDescriptors	= 2,
-	.bmFlags		= 0,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static const struct uvcg_frame uvcg_frame_yuv_720p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= uvc_frame_yuv_720p.bLength,
+		.b_descriptor_type		= uvc_frame_yuv_720p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_yuv_720p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_yuv_720p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_yuv_720p.bmCapabilities,
+		.w_width			= uvc_frame_yuv_720p.wWidth,
+		.w_height			= uvc_frame_yuv_720p.wHeight,
+		.dw_min_bit_rate		= uvc_frame_yuv_720p.dwMinBitRate,
+		.dw_max_bit_rate		= uvc_frame_yuv_720p.dwMaxBitRate,
+		.dw_max_video_frame_buffer_size	= uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize,
+		.dw_default_frame_interval	= uvc_frame_yuv_720p.dwDefaultFrameInterval,
+		.b_frame_interval_type		= uvc_frame_yuv_720p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= (u32 *)uvc_frame_yuv_720p.dwFrameInterval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_720p,
+};
+
+static struct uvcg_mjpeg uvcg_format_mjpeg = {
+	.fmt = {
+		.type			= UVCG_MJPEG,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
+		.bFormatIndex		= 2,
+		.bNumFrameDescriptors	= 2,
+		.bmFlags		= 0,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_mjpeg = {
+	.fmt = &uvcg_format_mjpeg.fmt,
 };
 
 DECLARE_UVC_FRAME_MJPEG(1);
@@ -247,6 +326,29 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
 	.dwFrameInterval[2]	= cpu_to_le32(5000000),
 };
 
+static const struct uvcg_frame uvcg_frame_mjpeg_360p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= uvc_frame_mjpg_360p.bLength,
+		.b_descriptor_type		= uvc_frame_mjpg_360p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_mjpg_360p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_mjpg_360p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_mjpg_360p.bmCapabilities,
+		.w_width			= uvc_frame_mjpg_360p.wWidth,
+		.w_height			= uvc_frame_mjpg_360p.wHeight,
+		.dw_min_bit_rate		= uvc_frame_mjpg_360p.dwMinBitRate,
+		.dw_max_bit_rate		= uvc_frame_mjpg_360p.dwMaxBitRate,
+		.dw_max_video_frame_buffer_size	= uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize,
+		.dw_default_frame_interval	= uvc_frame_mjpg_360p.dwDefaultFrameInterval,
+		.b_frame_interval_type		= uvc_frame_mjpg_360p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= (u32 *)uvc_frame_mjpg_360p.dwFrameInterval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
+};
+
 static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.bLength		= UVC_DT_FRAME_MJPEG_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -263,13 +365,30 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.dwFrameInterval[0]	= cpu_to_le32(5000000),
 };
 
-static const struct uvc_color_matching_descriptor uvc_color_matching = {
-	.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_COLORFORMAT,
-	.bColorPrimaries	= 1,
-	.bTransferCharacteristics	= 1,
-	.bMatrixCoefficients	= 4,
+static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= uvc_frame_mjpg_720p.bLength,
+		.b_descriptor_type		= uvc_frame_mjpg_720p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_mjpg_720p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_mjpg_720p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_mjpg_720p.bmCapabilities,
+		.w_width			= uvc_frame_mjpg_720p.wWidth,
+		.w_height			= uvc_frame_mjpg_720p.wHeight,
+		.dw_min_bit_rate		= uvc_frame_mjpg_720p.dwMinBitRate,
+		.dw_max_bit_rate		= uvc_frame_mjpg_720p.dwMaxBitRate,
+		.dw_max_video_frame_buffer_size	= uvc_frame_mjpg_720p.dwMaxVideoFrameBufferSize,
+		.dw_default_frame_interval	= uvc_frame_mjpg_720p.dwDefaultFrameInterval,
+		.b_frame_interval_typ		= uvc_frame_mjpg_720p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= (u32 *)uvc_frame_mjpg_720p.dwFrameInterval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
+};
+
+static struct uvcg_streaming_header uvcg_streaming_header = {
 };
 
 static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
@@ -290,40 +409,40 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
 
 static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
@@ -387,6 +506,23 @@ webcam_bind(struct usb_composite_dev *cdev)
 	uvc_opts->hs_streaming = uvc_hs_streaming_cls;
 	uvc_opts->ss_streaming = uvc_ss_streaming_cls;
 
+	INIT_LIST_HEAD(&uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_360p.entry, &uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_720p.entry, &uvcg_format_yuv.fmt.frames);
+	uvcg_format_yuv.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_360p.entry, &uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_720p.entry, &uvcg_format_mjpeg.fmt.frames);
+	uvcg_format_mjpeg.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_yuv.entry, &uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_mjpeg.entry, &uvcg_streaming_header.formats);
+	uvcg_streaming_header.num_fmt = 2;
+
+	uvc_opts->header = &uvcg_streaming_header;
+
 	/* Allocate string descriptor numbers ... note that string contents
 	 * can be overridden by the composite_dev glue.
 	 */

base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-08 12:52 [PATCH] usb: gadget: webcam: Make g_webcam loadable again Andrzej Pietrasiewicz
@ 2023-12-08 13:13 ` Andrzej Pietrasiewicz
  2023-12-08 23:56   ` kernel test robot
                     ` (4 more replies)
  2023-12-08 13:22 ` [PATCH] " Laurent Pinchart
  1 sibling, 5 replies; 17+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-12-08 13:13 UTC (permalink / raw)
  To: linux-usb
  Cc: Laurent Pinchart, Daniel Scally, Greg Kroah-Hartman,
	Michael Grzeschik, Andrzej Pietrasiewicz, kernel

commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")

has rendered the precomposed (aka legacy) webcam gadget unloadable.

uvc_alloc() since then has depended on certain config groups being
available in configfs tree related to the UVC function. However, legacy
gadgets do not create anything in configfs, so uvc_alloc() must fail
with -ENOENT no matter what.

This patch mimics the required configfs hierarchy to satisfy the code which
inspects formats and frames found in uvcg_streaming_header.

This has been tested with guvcview on the host side, using vivid as a
source of video stream on the device side and using the userspace program
found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
---
v1..v2:
- fixed a typo (missing character) in one of uvcg_frame_mjpeg_720p's members

 drivers/usb/gadget/function/f_uvc.c |  45 +++---
 drivers/usb/gadget/function/u_uvc.h |   6 +
 drivers/usb/gadget/legacy/webcam.c  | 232 ++++++++++++++++++++++------
 3 files changed, 215 insertions(+), 68 deletions(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 786379f1b7b7..3b46de85ca01 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -960,7 +960,8 @@ static void uvc_free(struct usb_function *f)
 	struct uvc_device *uvc = to_uvc(f);
 	struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts,
 					       func_inst);
-	config_item_put(&uvc->header->item);
+	if (!opts->header)
+		config_item_put(&uvc->header->item);
 	--opts->refcnt;
 	kfree(uvc);
 }
@@ -1052,25 +1053,29 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
 	uvc->desc.hs_streaming = opts->hs_streaming;
 	uvc->desc.ss_streaming = opts->ss_streaming;
 
-	streaming = config_group_find_item(&opts->func_inst.group, "streaming");
-	if (!streaming)
-		goto err_config;
-
-	header = config_group_find_item(to_config_group(streaming), "header");
-	config_item_put(streaming);
-	if (!header)
-		goto err_config;
-
-	h = config_group_find_item(to_config_group(header), "h");
-	config_item_put(header);
-	if (!h)
-		goto err_config;
-
-	uvc->header = to_uvcg_streaming_header(h);
-	if (!uvc->header->linked) {
-		mutex_unlock(&opts->lock);
-		kfree(uvc);
-		return ERR_PTR(-EBUSY);
+	if (opts->header) {
+		uvc->header = opts->header;
+	} else {
+		streaming = config_group_find_item(&opts->func_inst.group, "streaming");
+		if (!streaming)
+			goto err_config;
+
+		header = config_group_find_item(to_config_group(streaming), "header");
+		config_item_put(streaming);
+		if (!header)
+			goto err_config;
+
+		h = config_group_find_item(to_config_group(header), "h");
+		config_item_put(header);
+		if (!h)
+			goto err_config;
+
+		uvc->header = to_uvcg_streaming_header(h);
+		if (!uvc->header->linked) {
+			mutex_unlock(&opts->lock);
+			kfree(uvc);
+			return ERR_PTR(-EBUSY);
+		}
 	}
 
 	uvc->desc.extension_units = &opts->extension_units;
diff --git a/drivers/usb/gadget/function/u_uvc.h b/drivers/usb/gadget/function/u_uvc.h
index 1ce58f61253c..3ac392cbb779 100644
--- a/drivers/usb/gadget/function/u_uvc.h
+++ b/drivers/usb/gadget/function/u_uvc.h
@@ -98,6 +98,12 @@ struct f_uvc_opts {
 	 */
 	struct mutex			lock;
 	int				refcnt;
+
+	/*
+	 * Only for legacy gadget. Shall be NULL for configfs-composed gadgets,
+	 * which is guaranteed by alloc_inst implementation of f_uvc doing kzalloc.
+	 */
+	struct uvcg_streaming_header	*header;
 };
 
 #endif /* U_UVC_H */
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
index c06dd1af7a0c..4658de9369e2 100644
--- a/drivers/usb/gadget/legacy/webcam.c
+++ b/drivers/usb/gadget/legacy/webcam.c
@@ -12,6 +12,7 @@
 #include <linux/usb/video.h>
 
 #include "u_uvc.h"
+#include "uvc_configfs.h"
 
 USB_GADGET_COMPOSITE_OPTIONS();
 
@@ -84,8 +85,6 @@ static struct usb_device_descriptor webcam_device_descriptor = {
 	.bNumConfigurations	= 0, /* dynamic */
 };
 
-DECLARE_UVC_HEADER_DESCRIPTOR(1);
-
 static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
 	.bLength		= UVC_DT_HEADER_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -158,21 +157,44 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
 	.bmaControls[1][0]	= 4,
 };
 
-static const struct uvc_format_uncompressed uvc_format_yuv = {
-	.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
-	.bFormatIndex		= 1,
-	.bNumFrameDescriptors	= 2,
-	.guidFormat		=
-		{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
-		 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71},
-	.bBitsPerPixel		= 16,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static const struct uvcg_color_matching uvcg_color_matching = {
+	.desc = {
+		.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_COLORFORMAT,
+		.bColorPrimaries	= 1,
+		.bTransferCharacteristics	= 1,
+		.bMatrixCoefficients	= 4,
+	},
+};
+
+static struct uvcg_uncompressed uvcg_format_yuv = {
+	.fmt = {
+		.type			= UVCG_UNCOMPRESSED,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
+		.bFormatIndex		= 1,
+		.bNumFrameDescriptors	= 2,
+		.guidFormat		= {
+			'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
+			 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
+		},
+		.bBitsPerPixel		= 16,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_yuv = {
+	.fmt = &uvcg_format_yuv.fmt,
 };
 
 DECLARE_UVC_FRAME_UNCOMPRESSED(1);
@@ -196,6 +218,29 @@ static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
 	.dwFrameInterval[2]	= cpu_to_le32(5000000),
 };
 
+static const struct uvcg_frame uvcg_frame_yuv_360p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= uvc_frame_yuv_360p.bLength,
+		.b_descriptor_type		= uvc_frame_yuv_360p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_yuv_360p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_yuv_360p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_yuv_360p.bmCapabilities,
+		.w_width			= uvc_frame_yuv_360p.wWidth,
+		.w_height			= uvc_frame_yuv_360p.wHeight,
+		.dw_min_bit_rate		= uvc_frame_yuv_360p.dwMinBitRate,
+		.dw_max_bit_rate		= uvc_frame_yuv_360p.dwMaxBitRate,
+		.dw_max_video_frame_buffer_size	= uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize,
+		.dw_default_frame_interval	= uvc_frame_yuv_360p.dwDefaultFrameInterval,
+		.b_frame_interval_type		= uvc_frame_yuv_360p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= (u32 *)uvc_frame_yuv_360p.dwFrameInterval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_360p,
+};
+
 static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -212,18 +257,52 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.dwFrameInterval[0]	= cpu_to_le32(5000000),
 };
 
-static const struct uvc_format_mjpeg uvc_format_mjpg = {
-	.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
-	.bFormatIndex		= 2,
-	.bNumFrameDescriptors	= 2,
-	.bmFlags		= 0,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static const struct uvcg_frame uvcg_frame_yuv_720p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= uvc_frame_yuv_720p.bLength,
+		.b_descriptor_type		= uvc_frame_yuv_720p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_yuv_720p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_yuv_720p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_yuv_720p.bmCapabilities,
+		.w_width			= uvc_frame_yuv_720p.wWidth,
+		.w_height			= uvc_frame_yuv_720p.wHeight,
+		.dw_min_bit_rate		= uvc_frame_yuv_720p.dwMinBitRate,
+		.dw_max_bit_rate		= uvc_frame_yuv_720p.dwMaxBitRate,
+		.dw_max_video_frame_buffer_size	= uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize,
+		.dw_default_frame_interval	= uvc_frame_yuv_720p.dwDefaultFrameInterval,
+		.b_frame_interval_type		= uvc_frame_yuv_720p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= (u32 *)uvc_frame_yuv_720p.dwFrameInterval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_720p,
+};
+
+static struct uvcg_mjpeg uvcg_format_mjpeg = {
+	.fmt = {
+		.type			= UVCG_MJPEG,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
+		.bFormatIndex		= 2,
+		.bNumFrameDescriptors	= 2,
+		.bmFlags		= 0,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_mjpeg = {
+	.fmt = &uvcg_format_mjpeg.fmt,
 };
 
 DECLARE_UVC_FRAME_MJPEG(1);
@@ -247,6 +326,29 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
 	.dwFrameInterval[2]	= cpu_to_le32(5000000),
 };
 
+static const struct uvcg_frame uvcg_frame_mjpeg_360p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= uvc_frame_mjpg_360p.bLength,
+		.b_descriptor_type		= uvc_frame_mjpg_360p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_mjpg_360p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_mjpg_360p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_mjpg_360p.bmCapabilities,
+		.w_width			= uvc_frame_mjpg_360p.wWidth,
+		.w_height			= uvc_frame_mjpg_360p.wHeight,
+		.dw_min_bit_rate		= uvc_frame_mjpg_360p.dwMinBitRate,
+		.dw_max_bit_rate		= uvc_frame_mjpg_360p.dwMaxBitRate,
+		.dw_max_video_frame_buffer_size	= uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize,
+		.dw_default_frame_interval	= uvc_frame_mjpg_360p.dwDefaultFrameInterval,
+		.b_frame_interval_type		= uvc_frame_mjpg_360p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= (u32 *)uvc_frame_mjpg_360p.dwFrameInterval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
+};
+
 static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.bLength		= UVC_DT_FRAME_MJPEG_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -263,13 +365,30 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.dwFrameInterval[0]	= cpu_to_le32(5000000),
 };
 
-static const struct uvc_color_matching_descriptor uvc_color_matching = {
-	.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_COLORFORMAT,
-	.bColorPrimaries	= 1,
-	.bTransferCharacteristics	= 1,
-	.bMatrixCoefficients	= 4,
+static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= uvc_frame_mjpg_720p.bLength,
+		.b_descriptor_type		= uvc_frame_mjpg_720p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_mjpg_720p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_mjpg_720p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_mjpg_720p.bmCapabilities,
+		.w_width			= uvc_frame_mjpg_720p.wWidth,
+		.w_height			= uvc_frame_mjpg_720p.wHeight,
+		.dw_min_bit_rate		= uvc_frame_mjpg_720p.dwMinBitRate,
+		.dw_max_bit_rate		= uvc_frame_mjpg_720p.dwMaxBitRate,
+		.dw_max_video_frame_buffer_size	= uvc_frame_mjpg_720p.dwMaxVideoFrameBufferSize,
+		.dw_default_frame_interval	= uvc_frame_mjpg_720p.dwDefaultFrameInterval,
+		.b_frame_interval_type		= uvc_frame_mjpg_720p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= (u32 *)uvc_frame_mjpg_720p.dwFrameInterval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
+};
+
+static struct uvcg_streaming_header uvcg_streaming_header = {
 };
 
 static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
@@ -290,40 +409,40 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
 
 static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
@@ -387,6 +506,23 @@ webcam_bind(struct usb_composite_dev *cdev)
 	uvc_opts->hs_streaming = uvc_hs_streaming_cls;
 	uvc_opts->ss_streaming = uvc_ss_streaming_cls;
 
+	INIT_LIST_HEAD(&uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_360p.entry, &uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_720p.entry, &uvcg_format_yuv.fmt.frames);
+	uvcg_format_yuv.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_360p.entry, &uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_720p.entry, &uvcg_format_mjpeg.fmt.frames);
+	uvcg_format_mjpeg.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_yuv.entry, &uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_mjpeg.entry, &uvcg_streaming_header.formats);
+	uvcg_streaming_header.num_fmt = 2;
+
+	uvc_opts->header = &uvcg_streaming_header;
+
 	/* Allocate string descriptor numbers ... note that string contents
 	 * can be overridden by the composite_dev glue.
 	 */

base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-08 12:52 [PATCH] usb: gadget: webcam: Make g_webcam loadable again Andrzej Pietrasiewicz
  2023-12-08 13:13 ` [PATCH v2] " Andrzej Pietrasiewicz
@ 2023-12-08 13:22 ` Laurent Pinchart
  1 sibling, 0 replies; 17+ messages in thread
From: Laurent Pinchart @ 2023-12-08 13:22 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz
  Cc: linux-usb, Daniel Scally, Greg Kroah-Hartman, Michael Grzeschik,
	kernel

Hi Andrzej,

Thank you for the patch.

On Fri, Dec 08, 2023 at 01:52:31PM +0100, Andrzej Pietrasiewicz wrote:
> commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
> 
> has rendered the precomposed (aka legacy) webcam gadget unloadable.

I personally think that that commit was a bad idea. I'll thus let
Michael review and test this patch.

> uvc_alloc() since then has depended on certain config groups being
> available in configfs tree related to the UVC function. However, legacy
> gadgets do not create anything in configfs, so uvc_alloc() must fail
> with -ENOENT no matter what.
> 
> This patch mimics the required configfs hierarchy to satisfy the code which
> inspects formats and frames found in uvcg_streaming_header.
> 
> This has been tested with guvcview on the host side, using vivid as a
> source of video stream on the device side and using the userspace program
> found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.
> 
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
> ---
>  drivers/usb/gadget/function/f_uvc.c |  45 +++---
>  drivers/usb/gadget/function/u_uvc.h |   6 +
>  drivers/usb/gadget/legacy/webcam.c  | 232 ++++++++++++++++++++++------
>  3 files changed, 215 insertions(+), 68 deletions(-)
> 
> diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
> index 786379f1b7b7..3b46de85ca01 100644
> --- a/drivers/usb/gadget/function/f_uvc.c
> +++ b/drivers/usb/gadget/function/f_uvc.c
> @@ -960,7 +960,8 @@ static void uvc_free(struct usb_function *f)
>  	struct uvc_device *uvc = to_uvc(f);
>  	struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts,
>  					       func_inst);
> -	config_item_put(&uvc->header->item);
> +	if (!opts->header)
> +		config_item_put(&uvc->header->item);
>  	--opts->refcnt;
>  	kfree(uvc);
>  }
> @@ -1052,25 +1053,29 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
>  	uvc->desc.hs_streaming = opts->hs_streaming;
>  	uvc->desc.ss_streaming = opts->ss_streaming;
>  
> -	streaming = config_group_find_item(&opts->func_inst.group, "streaming");
> -	if (!streaming)
> -		goto err_config;
> -
> -	header = config_group_find_item(to_config_group(streaming), "header");
> -	config_item_put(streaming);
> -	if (!header)
> -		goto err_config;
> -
> -	h = config_group_find_item(to_config_group(header), "h");
> -	config_item_put(header);
> -	if (!h)
> -		goto err_config;
> -
> -	uvc->header = to_uvcg_streaming_header(h);
> -	if (!uvc->header->linked) {
> -		mutex_unlock(&opts->lock);
> -		kfree(uvc);
> -		return ERR_PTR(-EBUSY);
> +	if (opts->header) {
> +		uvc->header = opts->header;
> +	} else {
> +		streaming = config_group_find_item(&opts->func_inst.group, "streaming");
> +		if (!streaming)
> +			goto err_config;
> +
> +		header = config_group_find_item(to_config_group(streaming), "header");
> +		config_item_put(streaming);
> +		if (!header)
> +			goto err_config;
> +
> +		h = config_group_find_item(to_config_group(header), "h");
> +		config_item_put(header);
> +		if (!h)
> +			goto err_config;
> +
> +		uvc->header = to_uvcg_streaming_header(h);
> +		if (!uvc->header->linked) {
> +			mutex_unlock(&opts->lock);
> +			kfree(uvc);
> +			return ERR_PTR(-EBUSY);
> +		}
>  	}
>  
>  	uvc->desc.extension_units = &opts->extension_units;
> diff --git a/drivers/usb/gadget/function/u_uvc.h b/drivers/usb/gadget/function/u_uvc.h
> index 1ce58f61253c..3ac392cbb779 100644
> --- a/drivers/usb/gadget/function/u_uvc.h
> +++ b/drivers/usb/gadget/function/u_uvc.h
> @@ -98,6 +98,12 @@ struct f_uvc_opts {
>  	 */
>  	struct mutex			lock;
>  	int				refcnt;
> +
> +	/*
> +	 * Only for legacy gadget. Shall be NULL for configfs-composed gadgets,
> +	 * which is guaranteed by alloc_inst implementation of f_uvc doing kzalloc.
> +	 */
> +	struct uvcg_streaming_header	*header;
>  };
>  
>  #endif /* U_UVC_H */
> diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
> index c06dd1af7a0c..6700c5e17055 100644
> --- a/drivers/usb/gadget/legacy/webcam.c
> +++ b/drivers/usb/gadget/legacy/webcam.c
> @@ -12,6 +12,7 @@
>  #include <linux/usb/video.h>
>  
>  #include "u_uvc.h"
> +#include "uvc_configfs.h"
>  
>  USB_GADGET_COMPOSITE_OPTIONS();
>  
> @@ -84,8 +85,6 @@ static struct usb_device_descriptor webcam_device_descriptor = {
>  	.bNumConfigurations	= 0, /* dynamic */
>  };
>  
> -DECLARE_UVC_HEADER_DESCRIPTOR(1);
> -
>  static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
>  	.bLength		= UVC_DT_HEADER_SIZE(1),
>  	.bDescriptorType	= USB_DT_CS_INTERFACE,
> @@ -158,21 +157,44 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
>  	.bmaControls[1][0]	= 4,
>  };
>  
> -static const struct uvc_format_uncompressed uvc_format_yuv = {
> -	.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
> -	.bDescriptorType	= USB_DT_CS_INTERFACE,
> -	.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
> -	.bFormatIndex		= 1,
> -	.bNumFrameDescriptors	= 2,
> -	.guidFormat		=
> -		{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
> -		 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71},
> -	.bBitsPerPixel		= 16,
> -	.bDefaultFrameIndex	= 1,
> -	.bAspectRatioX		= 0,
> -	.bAspectRatioY		= 0,
> -	.bmInterlaceFlags	= 0,
> -	.bCopyProtect		= 0,
> +static const struct uvcg_color_matching uvcg_color_matching = {
> +	.desc = {
> +		.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
> +		.bDescriptorType	= USB_DT_CS_INTERFACE,
> +		.bDescriptorSubType	= UVC_VS_COLORFORMAT,
> +		.bColorPrimaries	= 1,
> +		.bTransferCharacteristics	= 1,
> +		.bMatrixCoefficients	= 4,
> +	},
> +};
> +
> +static struct uvcg_uncompressed uvcg_format_yuv = {
> +	.fmt = {
> +		.type			= UVCG_UNCOMPRESSED,
> +		/* add to .frames and fill .num_frames at runtime */
> +		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
> +	},
> +	.desc = {
> +		.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
> +		.bDescriptorType	= USB_DT_CS_INTERFACE,
> +		.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
> +		.bFormatIndex		= 1,
> +		.bNumFrameDescriptors	= 2,
> +		.guidFormat		= {
> +			'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
> +			 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
> +		},
> +		.bBitsPerPixel		= 16,
> +		.bDefaultFrameIndex	= 1,
> +		.bAspectRatioX		= 0,
> +		.bAspectRatioY		= 0,
> +		.bmInterlaceFlags	= 0,
> +		.bCopyProtect		= 0,
> +	},
> +};
> +
> +static struct uvcg_format_ptr uvcg_format_ptr_yuv = {
> +	.fmt = &uvcg_format_yuv.fmt,
>  };
>  
>  DECLARE_UVC_FRAME_UNCOMPRESSED(1);
> @@ -196,6 +218,29 @@ static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
>  	.dwFrameInterval[2]	= cpu_to_le32(5000000),
>  };
>  
> +static const struct uvcg_frame uvcg_frame_yuv_360p = {
> +	.fmt_type		= UVCG_UNCOMPRESSED,
> +	.frame = {
> +		.b_length			= uvc_frame_yuv_360p.bLength,
> +		.b_descriptor_type		= uvc_frame_yuv_360p.bDescriptorType,
> +		.b_descriptor_subtype		= uvc_frame_yuv_360p.bDescriptorSubType,
> +		.b_frame_index			= uvc_frame_yuv_360p.bFrameIndex,
> +		.bm_capabilities		= uvc_frame_yuv_360p.bmCapabilities,
> +		.w_width			= uvc_frame_yuv_360p.wWidth,
> +		.w_height			= uvc_frame_yuv_360p.wHeight,
> +		.dw_min_bit_rate		= uvc_frame_yuv_360p.dwMinBitRate,
> +		.dw_max_bit_rate		= uvc_frame_yuv_360p.dwMaxBitRate,
> +		.dw_max_video_frame_buffer_size	= uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize,
> +		.dw_default_frame_interval	= uvc_frame_yuv_360p.dwDefaultFrameInterval,
> +		.b_frame_interval_type		= uvc_frame_yuv_360p.bFrameIntervalType,
> +	},
> +	.dw_frame_interval	= (u32 *)uvc_frame_yuv_360p.dwFrameInterval,
> +};
> +
> +static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_360p = {
> +	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_360p,
> +};
> +
>  static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
>  	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
>  	.bDescriptorType	= USB_DT_CS_INTERFACE,
> @@ -212,18 +257,52 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
>  	.dwFrameInterval[0]	= cpu_to_le32(5000000),
>  };
>  
> -static const struct uvc_format_mjpeg uvc_format_mjpg = {
> -	.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
> -	.bDescriptorType	= USB_DT_CS_INTERFACE,
> -	.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
> -	.bFormatIndex		= 2,
> -	.bNumFrameDescriptors	= 2,
> -	.bmFlags		= 0,
> -	.bDefaultFrameIndex	= 1,
> -	.bAspectRatioX		= 0,
> -	.bAspectRatioY		= 0,
> -	.bmInterlaceFlags	= 0,
> -	.bCopyProtect		= 0,
> +static const struct uvcg_frame uvcg_frame_yuv_720p = {
> +	.fmt_type		= UVCG_UNCOMPRESSED,
> +	.frame = {
> +		.b_length			= uvc_frame_yuv_720p.bLength,
> +		.b_descriptor_type		= uvc_frame_yuv_720p.bDescriptorType,
> +		.b_descriptor_subtype		= uvc_frame_yuv_720p.bDescriptorSubType,
> +		.b_frame_index			= uvc_frame_yuv_720p.bFrameIndex,
> +		.bm_capabilities		= uvc_frame_yuv_720p.bmCapabilities,
> +		.w_width			= uvc_frame_yuv_720p.wWidth,
> +		.w_height			= uvc_frame_yuv_720p.wHeight,
> +		.dw_min_bit_rate		= uvc_frame_yuv_720p.dwMinBitRate,
> +		.dw_max_bit_rate		= uvc_frame_yuv_720p.dwMaxBitRate,
> +		.dw_max_video_frame_buffer_size	= uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize,
> +		.dw_default_frame_interval	= uvc_frame_yuv_720p.dwDefaultFrameInterval,
> +		.b_frame_interval_type		= uvc_frame_yuv_720p.bFrameIntervalType,
> +	},
> +	.dw_frame_interval	= (u32 *)uvc_frame_yuv_720p.dwFrameInterval,
> +};
> +
> +static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_720p = {
> +	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_720p,
> +};
> +
> +static struct uvcg_mjpeg uvcg_format_mjpeg = {
> +	.fmt = {
> +		.type			= UVCG_MJPEG,
> +		/* add to .frames and fill .num_frames at runtime */
> +		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
> +	},
> +	.desc = {
> +		.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
> +		.bDescriptorType	= USB_DT_CS_INTERFACE,
> +		.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
> +		.bFormatIndex		= 2,
> +		.bNumFrameDescriptors	= 2,
> +		.bmFlags		= 0,
> +		.bDefaultFrameIndex	= 1,
> +		.bAspectRatioX		= 0,
> +		.bAspectRatioY		= 0,
> +		.bmInterlaceFlags	= 0,
> +		.bCopyProtect		= 0,
> +	},
> +};
> +
> +static struct uvcg_format_ptr uvcg_format_ptr_mjpeg = {
> +	.fmt = &uvcg_format_mjpeg.fmt,
>  };
>  
>  DECLARE_UVC_FRAME_MJPEG(1);
> @@ -247,6 +326,29 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
>  	.dwFrameInterval[2]	= cpu_to_le32(5000000),
>  };
>  
> +static const struct uvcg_frame uvcg_frame_mjpeg_360p = {
> +	.fmt_type		= UVCG_MJPEG,
> +	.frame = {
> +		.b_length			= uvc_frame_mjpg_360p.bLength,
> +		.b_descriptor_type		= uvc_frame_mjpg_360p.bDescriptorType,
> +		.b_descriptor_subtype		= uvc_frame_mjpg_360p.bDescriptorSubType,
> +		.b_frame_index			= uvc_frame_mjpg_360p.bFrameIndex,
> +		.bm_capabilities		= uvc_frame_mjpg_360p.bmCapabilities,
> +		.w_width			= uvc_frame_mjpg_360p.wWidth,
> +		.w_height			= uvc_frame_mjpg_360p.wHeight,
> +		.dw_min_bit_rate		= uvc_frame_mjpg_360p.dwMinBitRate,
> +		.dw_max_bit_rate		= uvc_frame_mjpg_360p.dwMaxBitRate,
> +		.dw_max_video_frame_buffer_size	= uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize,
> +		.dw_default_frame_interval	= uvc_frame_mjpg_360p.dwDefaultFrameInterval,
> +		.b_frame_interval_type		= uvc_frame_mjpg_360p.bFrameIntervalType,
> +	},
> +	.dw_frame_interval	= (u32 *)uvc_frame_mjpg_360p.dwFrameInterval,
> +};
> +
> +static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_360p = {
> +	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
> +};
> +
>  static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
>  	.bLength		= UVC_DT_FRAME_MJPEG_SIZE(1),
>  	.bDescriptorType	= USB_DT_CS_INTERFACE,
> @@ -263,13 +365,30 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
>  	.dwFrameInterval[0]	= cpu_to_le32(5000000),
>  };
>  
> -static const struct uvc_color_matching_descriptor uvc_color_matching = {
> -	.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
> -	.bDescriptorType	= USB_DT_CS_INTERFACE,
> -	.bDescriptorSubType	= UVC_VS_COLORFORMAT,
> -	.bColorPrimaries	= 1,
> -	.bTransferCharacteristics	= 1,
> -	.bMatrixCoefficients	= 4,
> +static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
> +	.fmt_type		= UVCG_MJPEG,
> +	.frame = {
> +		.b_length			= uvc_frame_mjpg_720p.bLength,
> +		.b_descriptor_type		= uvc_frame_mjpg_720p.bDescriptorType,
> +		.b_descriptor_subtype		= uvc_frame_mjpg_720p.bDescriptorSubType,
> +		.b_frame_index			= uvc_frame_mjpg_720p.bFrameIndex,
> +		.bm_capabilities		= uvc_frame_mjpg_720p.bmCapabilities,
> +		.w_width			= uvc_frame_mjpg_720p.wWidth,
> +		.w_height			= uvc_frame_mjpg_720p.wHeight,
> +		.dw_min_bit_rate		= uvc_frame_mjpg_720p.dwMinBitRate,
> +		.dw_max_bit_rate		= uvc_frame_mjpg_720p.dwMaxBitRate,
> +		.dw_max_video_frame_buffer_size	= uvc_frame_mjpg_720p.dwMaxVideoFrameBufferSize,
> +		.dw_default_frame_interval	= uvc_frame_mjpg_720p.dwDefaultFrameInterval,
> +		.b_frame_interval_typ		= uvc_frame_mjpg_720p.bFrameIntervalType,
> +	},
> +	.dw_frame_interval	= (u32 *)uvc_frame_mjpg_720p.dwFrameInterval,
> +};
> +
> +static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_720p = {
> +	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
> +};
> +
> +static struct uvcg_streaming_header uvcg_streaming_header = {
>  };
>  
>  static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
> @@ -290,40 +409,40 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
>  
>  static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = {
>  	(const struct uvc_descriptor_header *) &uvc_input_header,
> -	(const struct uvc_descriptor_header *) &uvc_format_yuv,
> +	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
>  	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
>  	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> -	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
> +	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
>  	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
>  	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
>  	NULL,
>  };
>  
>  static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
>  	(const struct uvc_descriptor_header *) &uvc_input_header,
> -	(const struct uvc_descriptor_header *) &uvc_format_yuv,
> +	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
>  	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
>  	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> -	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
> +	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
>  	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
>  	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
>  	NULL,
>  };
>  
>  static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
>  	(const struct uvc_descriptor_header *) &uvc_input_header,
> -	(const struct uvc_descriptor_header *) &uvc_format_yuv,
> +	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
>  	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
>  	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> -	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
> +	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
>  	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
>  	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
>  	NULL,
>  };
>  
> @@ -387,6 +506,23 @@ webcam_bind(struct usb_composite_dev *cdev)
>  	uvc_opts->hs_streaming = uvc_hs_streaming_cls;
>  	uvc_opts->ss_streaming = uvc_ss_streaming_cls;
>  
> +	INIT_LIST_HEAD(&uvcg_format_yuv.fmt.frames);
> +	list_add_tail(&uvcg_frame_ptr_yuv_360p.entry, &uvcg_format_yuv.fmt.frames);
> +	list_add_tail(&uvcg_frame_ptr_yuv_720p.entry, &uvcg_format_yuv.fmt.frames);
> +	uvcg_format_yuv.fmt.num_frames = 2;
> +
> +	INIT_LIST_HEAD(&uvcg_format_mjpeg.fmt.frames);
> +	list_add_tail(&uvcg_frame_ptr_mjpeg_360p.entry, &uvcg_format_mjpeg.fmt.frames);
> +	list_add_tail(&uvcg_frame_ptr_mjpeg_720p.entry, &uvcg_format_mjpeg.fmt.frames);
> +	uvcg_format_mjpeg.fmt.num_frames = 2;
> +
> +	INIT_LIST_HEAD(&uvcg_streaming_header.formats);
> +	list_add_tail(&uvcg_format_ptr_yuv.entry, &uvcg_streaming_header.formats);
> +	list_add_tail(&uvcg_format_ptr_mjpeg.entry, &uvcg_streaming_header.formats);
> +	uvcg_streaming_header.num_fmt = 2;
> +
> +	uvc_opts->header = &uvcg_streaming_header;
> +
>  	/* Allocate string descriptor numbers ... note that string contents
>  	 * can be overridden by the composite_dev glue.
>  	 */
> 
> base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-08 13:13 ` [PATCH v2] " Andrzej Pietrasiewicz
@ 2023-12-08 23:56   ` kernel test robot
  2023-12-09 10:20   ` kernel test robot
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2023-12-08 23:56 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz, linux-usb
  Cc: oe-kbuild-all, Laurent Pinchart, Daniel Scally,
	Greg Kroah-Hartman, Michael Grzeschik, Andrzej Pietrasiewicz,
	kernel

Hi Andrzej,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 33cc938e65a98f1d29d0a18403dbbee050dcad9a]

url:    https://github.com/intel-lab-lkp/linux/commits/Andrzej-Pietrasiewicz/usb-gadget-webcam-Make-g_webcam-loadable-again/20231208-211513
base:   33cc938e65a98f1d29d0a18403dbbee050dcad9a
patch link:    https://lore.kernel.org/r/20231208131342.65671-1-andrzej.p%40collabora.com
patch subject: [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
config: i386-buildonly-randconfig-002-20231209 (https://download.01.org/0day-ci/archive/20231209/202312090717.dUYTE5cM-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231209/202312090717.dUYTE5cM-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312090717.dUYTE5cM-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/usb/gadget/legacy/webcam.c:368:32: warning: 'uvcg_frame_mjpeg_720p' defined but not used [-Wunused-const-variable=]
     368 | static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
         |                                ^~~~~~~~~~~~~~~~~~~~~


vim +/uvcg_frame_mjpeg_720p +368 drivers/usb/gadget/legacy/webcam.c

   367	
 > 368	static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
   369		.fmt_type		= UVCG_MJPEG,
   370		.frame = {
   371			.b_length			= uvc_frame_mjpg_720p.bLength,
   372			.b_descriptor_type		= uvc_frame_mjpg_720p.bDescriptorType,
   373			.b_descriptor_subtype		= uvc_frame_mjpg_720p.bDescriptorSubType,
   374			.b_frame_index			= uvc_frame_mjpg_720p.bFrameIndex,
   375			.bm_capabilities		= uvc_frame_mjpg_720p.bmCapabilities,
   376			.w_width			= uvc_frame_mjpg_720p.wWidth,
   377			.w_height			= uvc_frame_mjpg_720p.wHeight,
   378			.dw_min_bit_rate		= uvc_frame_mjpg_720p.dwMinBitRate,
   379			.dw_max_bit_rate		= uvc_frame_mjpg_720p.dwMaxBitRate,
   380			.dw_max_video_frame_buffer_size	= uvc_frame_mjpg_720p.dwMaxVideoFrameBufferSize,
   381			.dw_default_frame_interval	= uvc_frame_mjpg_720p.dwDefaultFrameInterval,
   382			.b_frame_interval_type		= uvc_frame_mjpg_720p.bFrameIntervalType,
   383		},
   384		.dw_frame_interval	= (u32 *)uvc_frame_mjpg_720p.dwFrameInterval,
   385	};
   386	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-08 13:13 ` [PATCH v2] " Andrzej Pietrasiewicz
  2023-12-08 23:56   ` kernel test robot
@ 2023-12-09 10:20   ` kernel test robot
  2023-12-09 10:41   ` kernel test robot
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2023-12-09 10:20 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz, linux-usb
  Cc: oe-kbuild-all, Laurent Pinchart, Daniel Scally,
	Greg Kroah-Hartman, Michael Grzeschik, Andrzej Pietrasiewicz,
	kernel

Hi Andrzej,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 33cc938e65a98f1d29d0a18403dbbee050dcad9a]

url:    https://github.com/intel-lab-lkp/linux/commits/Andrzej-Pietrasiewicz/usb-gadget-webcam-Make-g_webcam-loadable-again/20231208-211513
base:   33cc938e65a98f1d29d0a18403dbbee050dcad9a
patch link:    https://lore.kernel.org/r/20231208131342.65671-1-andrzej.p%40collabora.com
patch subject: [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
config: m68k-randconfig-r132-20231209 (https://download.01.org/0day-ci/archive/20231209/202312091817.u3BjKBcF-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231209/202312091817.u3BjKBcF-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312091817.u3BjKBcF-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/usb/gadget/legacy/webcam.c:229:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] w_width @@     got restricted __le16 static const [toplevel] [usertype] wWidth @@
   drivers/usb/gadget/legacy/webcam.c:229:69: sparse:     expected unsigned short [usertype] w_width
   drivers/usb/gadget/legacy/webcam.c:229:69: sparse:     got restricted __le16 static const [toplevel] [usertype] wWidth
>> drivers/usb/gadget/legacy/webcam.c:230:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] w_height @@     got restricted __le16 static const [toplevel] [usertype] wHeight @@
   drivers/usb/gadget/legacy/webcam.c:230:69: sparse:     expected unsigned short [usertype] w_height
   drivers/usb/gadget/legacy/webcam.c:230:69: sparse:     got restricted __le16 static const [toplevel] [usertype] wHeight
>> drivers/usb/gadget/legacy/webcam.c:231:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_min_bit_rate @@     got restricted __le32 static const [toplevel] [usertype] dwMinBitRate @@
   drivers/usb/gadget/legacy/webcam.c:231:69: sparse:     expected unsigned int [usertype] dw_min_bit_rate
   drivers/usb/gadget/legacy/webcam.c:231:69: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMinBitRate
>> drivers/usb/gadget/legacy/webcam.c:232:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_max_bit_rate @@     got restricted __le32 static const [toplevel] [usertype] dwMaxBitRate @@
   drivers/usb/gadget/legacy/webcam.c:232:69: sparse:     expected unsigned int [usertype] dw_max_bit_rate
   drivers/usb/gadget/legacy/webcam.c:232:69: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMaxBitRate
>> drivers/usb/gadget/legacy/webcam.c:233:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_max_video_frame_buffer_size @@     got restricted __le32 static const [toplevel] [usertype] dwMaxVideoFrameBufferSize @@
   drivers/usb/gadget/legacy/webcam.c:233:69: sparse:     expected unsigned int [usertype] dw_max_video_frame_buffer_size
   drivers/usb/gadget/legacy/webcam.c:233:69: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMaxVideoFrameBufferSize
>> drivers/usb/gadget/legacy/webcam.c:234:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_default_frame_interval @@     got restricted __le32 static const [toplevel] [usertype] dwDefaultFrameInterval @@
   drivers/usb/gadget/legacy/webcam.c:234:69: sparse:     expected unsigned int [usertype] dw_default_frame_interval
   drivers/usb/gadget/legacy/webcam.c:234:69: sparse:     got restricted __le32 static const [toplevel] [usertype] dwDefaultFrameInterval
   drivers/usb/gadget/legacy/webcam.c:268:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] w_width @@     got restricted __le16 static const [toplevel] [usertype] wWidth @@
   drivers/usb/gadget/legacy/webcam.c:268:69: sparse:     expected unsigned short [usertype] w_width
   drivers/usb/gadget/legacy/webcam.c:268:69: sparse:     got restricted __le16 static const [toplevel] [usertype] wWidth
   drivers/usb/gadget/legacy/webcam.c:269:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] w_height @@     got restricted __le16 static const [toplevel] [usertype] wHeight @@
   drivers/usb/gadget/legacy/webcam.c:269:69: sparse:     expected unsigned short [usertype] w_height
   drivers/usb/gadget/legacy/webcam.c:269:69: sparse:     got restricted __le16 static const [toplevel] [usertype] wHeight
   drivers/usb/gadget/legacy/webcam.c:270:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_min_bit_rate @@     got restricted __le32 static const [toplevel] [usertype] dwMinBitRate @@
   drivers/usb/gadget/legacy/webcam.c:270:69: sparse:     expected unsigned int [usertype] dw_min_bit_rate
   drivers/usb/gadget/legacy/webcam.c:270:69: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMinBitRate
   drivers/usb/gadget/legacy/webcam.c:271:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_max_bit_rate @@     got restricted __le32 static const [toplevel] [usertype] dwMaxBitRate @@
   drivers/usb/gadget/legacy/webcam.c:271:69: sparse:     expected unsigned int [usertype] dw_max_bit_rate
   drivers/usb/gadget/legacy/webcam.c:271:69: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMaxBitRate
   drivers/usb/gadget/legacy/webcam.c:272:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_max_video_frame_buffer_size @@     got restricted __le32 static const [toplevel] [usertype] dwMaxVideoFrameBufferSize @@
   drivers/usb/gadget/legacy/webcam.c:272:69: sparse:     expected unsigned int [usertype] dw_max_video_frame_buffer_size
   drivers/usb/gadget/legacy/webcam.c:272:69: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMaxVideoFrameBufferSize
   drivers/usb/gadget/legacy/webcam.c:273:69: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_default_frame_interval @@     got restricted __le32 static const [toplevel] [usertype] dwDefaultFrameInterval @@
   drivers/usb/gadget/legacy/webcam.c:273:69: sparse:     expected unsigned int [usertype] dw_default_frame_interval
   drivers/usb/gadget/legacy/webcam.c:273:69: sparse:     got restricted __le32 static const [toplevel] [usertype] dwDefaultFrameInterval
   drivers/usb/gadget/legacy/webcam.c:337:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] w_width @@     got restricted __le16 static const [toplevel] [usertype] wWidth @@
   drivers/usb/gadget/legacy/webcam.c:337:70: sparse:     expected unsigned short [usertype] w_width
   drivers/usb/gadget/legacy/webcam.c:337:70: sparse:     got restricted __le16 static const [toplevel] [usertype] wWidth
   drivers/usb/gadget/legacy/webcam.c:338:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] w_height @@     got restricted __le16 static const [toplevel] [usertype] wHeight @@
   drivers/usb/gadget/legacy/webcam.c:338:70: sparse:     expected unsigned short [usertype] w_height
   drivers/usb/gadget/legacy/webcam.c:338:70: sparse:     got restricted __le16 static const [toplevel] [usertype] wHeight
   drivers/usb/gadget/legacy/webcam.c:339:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_min_bit_rate @@     got restricted __le32 static const [toplevel] [usertype] dwMinBitRate @@
   drivers/usb/gadget/legacy/webcam.c:339:70: sparse:     expected unsigned int [usertype] dw_min_bit_rate
   drivers/usb/gadget/legacy/webcam.c:339:70: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMinBitRate
   drivers/usb/gadget/legacy/webcam.c:340:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_max_bit_rate @@     got restricted __le32 static const [toplevel] [usertype] dwMaxBitRate @@
   drivers/usb/gadget/legacy/webcam.c:340:70: sparse:     expected unsigned int [usertype] dw_max_bit_rate
   drivers/usb/gadget/legacy/webcam.c:340:70: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMaxBitRate
   drivers/usb/gadget/legacy/webcam.c:341:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_max_video_frame_buffer_size @@     got restricted __le32 static const [toplevel] [usertype] dwMaxVideoFrameBufferSize @@
   drivers/usb/gadget/legacy/webcam.c:341:70: sparse:     expected unsigned int [usertype] dw_max_video_frame_buffer_size
   drivers/usb/gadget/legacy/webcam.c:341:70: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMaxVideoFrameBufferSize
   drivers/usb/gadget/legacy/webcam.c:342:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_default_frame_interval @@     got restricted __le32 static const [toplevel] [usertype] dwDefaultFrameInterval @@
   drivers/usb/gadget/legacy/webcam.c:342:70: sparse:     expected unsigned int [usertype] dw_default_frame_interval
   drivers/usb/gadget/legacy/webcam.c:342:70: sparse:     got restricted __le32 static const [toplevel] [usertype] dwDefaultFrameInterval
   drivers/usb/gadget/legacy/webcam.c:376:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] w_width @@     got restricted __le16 static const [toplevel] [usertype] wWidth @@
   drivers/usb/gadget/legacy/webcam.c:376:70: sparse:     expected unsigned short [usertype] w_width
   drivers/usb/gadget/legacy/webcam.c:376:70: sparse:     got restricted __le16 static const [toplevel] [usertype] wWidth
   drivers/usb/gadget/legacy/webcam.c:377:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] w_height @@     got restricted __le16 static const [toplevel] [usertype] wHeight @@
   drivers/usb/gadget/legacy/webcam.c:377:70: sparse:     expected unsigned short [usertype] w_height
   drivers/usb/gadget/legacy/webcam.c:377:70: sparse:     got restricted __le16 static const [toplevel] [usertype] wHeight
   drivers/usb/gadget/legacy/webcam.c:378:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_min_bit_rate @@     got restricted __le32 static const [toplevel] [usertype] dwMinBitRate @@
   drivers/usb/gadget/legacy/webcam.c:378:70: sparse:     expected unsigned int [usertype] dw_min_bit_rate
   drivers/usb/gadget/legacy/webcam.c:378:70: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMinBitRate
   drivers/usb/gadget/legacy/webcam.c:379:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_max_bit_rate @@     got restricted __le32 static const [toplevel] [usertype] dwMaxBitRate @@
   drivers/usb/gadget/legacy/webcam.c:379:70: sparse:     expected unsigned int [usertype] dw_max_bit_rate
   drivers/usb/gadget/legacy/webcam.c:379:70: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMaxBitRate
   drivers/usb/gadget/legacy/webcam.c:380:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_max_video_frame_buffer_size @@     got restricted __le32 static const [toplevel] [usertype] dwMaxVideoFrameBufferSize @@
   drivers/usb/gadget/legacy/webcam.c:380:70: sparse:     expected unsigned int [usertype] dw_max_video_frame_buffer_size
   drivers/usb/gadget/legacy/webcam.c:380:70: sparse:     got restricted __le32 static const [toplevel] [usertype] dwMaxVideoFrameBufferSize
   drivers/usb/gadget/legacy/webcam.c:381:70: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] dw_default_frame_interval @@     got restricted __le32 static const [toplevel] [usertype] dwDefaultFrameInterval @@
   drivers/usb/gadget/legacy/webcam.c:381:70: sparse:     expected unsigned int [usertype] dw_default_frame_interval
   drivers/usb/gadget/legacy/webcam.c:381:70: sparse:     got restricted __le32 static const [toplevel] [usertype] dwDefaultFrameInterval
   drivers/usb/gadget/legacy/webcam.c: note: in included file (through include/linux/rculist.h, include/linux/pid.h, include/linux/sched.h, ...):
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true

vim +229 drivers/usb/gadget/legacy/webcam.c

   220	
   221	static const struct uvcg_frame uvcg_frame_yuv_360p = {
   222		.fmt_type		= UVCG_UNCOMPRESSED,
   223		.frame = {
   224			.b_length			= uvc_frame_yuv_360p.bLength,
   225			.b_descriptor_type		= uvc_frame_yuv_360p.bDescriptorType,
   226			.b_descriptor_subtype		= uvc_frame_yuv_360p.bDescriptorSubType,
   227			.b_frame_index			= uvc_frame_yuv_360p.bFrameIndex,
   228			.bm_capabilities		= uvc_frame_yuv_360p.bmCapabilities,
 > 229			.w_width			= uvc_frame_yuv_360p.wWidth,
 > 230			.w_height			= uvc_frame_yuv_360p.wHeight,
 > 231			.dw_min_bit_rate		= uvc_frame_yuv_360p.dwMinBitRate,
 > 232			.dw_max_bit_rate		= uvc_frame_yuv_360p.dwMaxBitRate,
 > 233			.dw_max_video_frame_buffer_size	= uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize,
 > 234			.dw_default_frame_interval	= uvc_frame_yuv_360p.dwDefaultFrameInterval,
   235			.b_frame_interval_type		= uvc_frame_yuv_360p.bFrameIntervalType,
   236		},
   237		.dw_frame_interval	= (u32 *)uvc_frame_yuv_360p.dwFrameInterval,
   238	};
   239	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-08 13:13 ` [PATCH v2] " Andrzej Pietrasiewicz
  2023-12-08 23:56   ` kernel test robot
  2023-12-09 10:20   ` kernel test robot
@ 2023-12-09 10:41   ` kernel test robot
  2023-12-09 22:17   ` kernel test robot
  2023-12-11 12:38   ` [PATCH v3] " Andrzej Pietrasiewicz
  4 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2023-12-09 10:41 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz, linux-usb
  Cc: oe-kbuild-all, Laurent Pinchart, Daniel Scally,
	Greg Kroah-Hartman, Michael Grzeschik, Andrzej Pietrasiewicz,
	kernel

Hi Andrzej,

kernel test robot noticed the following build errors:

[auto build test ERROR on 33cc938e65a98f1d29d0a18403dbbee050dcad9a]

url:    https://github.com/intel-lab-lkp/linux/commits/Andrzej-Pietrasiewicz/usb-gadget-webcam-Make-g_webcam-loadable-again/20231208-211513
base:   33cc938e65a98f1d29d0a18403dbbee050dcad9a
patch link:    https://lore.kernel.org/r/20231208131342.65671-1-andrzej.p%40collabora.com
patch subject: [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
config: x86_64-randconfig-r111-20231209 (https://download.01.org/0day-ci/archive/20231209/202312091825.1MSZeBRA-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231209/202312091825.1MSZeBRA-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312091825.1MSZeBRA-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/usb/gadget/legacy/webcam.c:224:17: error: initializer element is not constant
      .b_length   = uvc_frame_yuv_360p.bLength,
                    ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:224:17: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_length')
   drivers/usb/gadget/legacy/webcam.c:225:25: error: initializer element is not constant
      .b_descriptor_type  = uvc_frame_yuv_360p.bDescriptorType,
                            ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:225:25: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_descriptor_type')
   drivers/usb/gadget/legacy/webcam.c:226:28: error: initializer element is not constant
      .b_descriptor_subtype  = uvc_frame_yuv_360p.bDescriptorSubType,
                               ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:226:28: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_descriptor_subtype')
   drivers/usb/gadget/legacy/webcam.c:227:22: error: initializer element is not constant
      .b_frame_index   = uvc_frame_yuv_360p.bFrameIndex,
                         ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:227:22: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_frame_index')
   drivers/usb/gadget/legacy/webcam.c:228:23: error: initializer element is not constant
      .bm_capabilities  = uvc_frame_yuv_360p.bmCapabilities,
                          ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:228:23: note: (near initialization for 'uvcg_frame_yuv_360p.frame.bm_capabilities')
   drivers/usb/gadget/legacy/webcam.c:229:16: error: initializer element is not constant
      .w_width   = uvc_frame_yuv_360p.wWidth,
                   ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:229:16: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_width')
   drivers/usb/gadget/legacy/webcam.c:230:17: error: initializer element is not constant
      .w_height   = uvc_frame_yuv_360p.wHeight,
                    ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:230:17: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_height')
   drivers/usb/gadget/legacy/webcam.c:231:23: error: initializer element is not constant
      .dw_min_bit_rate  = uvc_frame_yuv_360p.dwMinBitRate,
                          ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:231:23: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_min_bit_rate')
   drivers/usb/gadget/legacy/webcam.c:232:23: error: initializer element is not constant
      .dw_max_bit_rate  = uvc_frame_yuv_360p.dwMaxBitRate,
                          ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:232:23: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_bit_rate')
   drivers/usb/gadget/legacy/webcam.c:233:37: error: initializer element is not constant
      .dw_max_video_frame_buffer_size = uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize,
                                        ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:233:37: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_video_frame_buffer_size')
   drivers/usb/gadget/legacy/webcam.c:234:32: error: initializer element is not constant
      .dw_default_frame_interval = uvc_frame_yuv_360p.dwDefaultFrameInterval,
                                   ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:234:32: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_default_frame_interval')
   drivers/usb/gadget/legacy/webcam.c:235:29: error: initializer element is not constant
      .b_frame_interval_type  = uvc_frame_yuv_360p.bFrameIntervalType,
                                ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:235:29: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_frame_interval_type')
   drivers/usb/gadget/legacy/webcam.c:263:17: error: initializer element is not constant
      .b_length   = uvc_frame_yuv_720p.bLength,
                    ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:263:17: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_length')
   drivers/usb/gadget/legacy/webcam.c:264:25: error: initializer element is not constant
      .b_descriptor_type  = uvc_frame_yuv_720p.bDescriptorType,
                            ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:264:25: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_descriptor_type')
   drivers/usb/gadget/legacy/webcam.c:265:28: error: initializer element is not constant
      .b_descriptor_subtype  = uvc_frame_yuv_720p.bDescriptorSubType,
                               ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:265:28: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_descriptor_subtype')
   drivers/usb/gadget/legacy/webcam.c:266:22: error: initializer element is not constant
      .b_frame_index   = uvc_frame_yuv_720p.bFrameIndex,
                         ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:266:22: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_frame_index')
   drivers/usb/gadget/legacy/webcam.c:267:23: error: initializer element is not constant
      .bm_capabilities  = uvc_frame_yuv_720p.bmCapabilities,
                          ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:267:23: note: (near initialization for 'uvcg_frame_yuv_720p.frame.bm_capabilities')
   drivers/usb/gadget/legacy/webcam.c:268:16: error: initializer element is not constant
      .w_width   = uvc_frame_yuv_720p.wWidth,
                   ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:268:16: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_width')
   drivers/usb/gadget/legacy/webcam.c:269:17: error: initializer element is not constant
      .w_height   = uvc_frame_yuv_720p.wHeight,
                    ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:269:17: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_height')
   drivers/usb/gadget/legacy/webcam.c:270:23: error: initializer element is not constant
      .dw_min_bit_rate  = uvc_frame_yuv_720p.dwMinBitRate,
                          ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:270:23: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_min_bit_rate')
   drivers/usb/gadget/legacy/webcam.c:271:23: error: initializer element is not constant
      .dw_max_bit_rate  = uvc_frame_yuv_720p.dwMaxBitRate,
                          ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:271:23: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_bit_rate')
   drivers/usb/gadget/legacy/webcam.c:272:37: error: initializer element is not constant
      .dw_max_video_frame_buffer_size = uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize,
                                        ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:272:37: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_video_frame_buffer_size')
   drivers/usb/gadget/legacy/webcam.c:273:32: error: initializer element is not constant
      .dw_default_frame_interval = uvc_frame_yuv_720p.dwDefaultFrameInterval,
                                   ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:273:32: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_default_frame_interval')
   drivers/usb/gadget/legacy/webcam.c:274:29: error: initializer element is not constant
      .b_frame_interval_type  = uvc_frame_yuv_720p.bFrameIntervalType,
                                ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:274:29: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_frame_interval_type')
   drivers/usb/gadget/legacy/webcam.c:332:17: error: initializer element is not constant
      .b_length   = uvc_frame_mjpg_360p.bLength,
                    ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:332:17: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_length')
   drivers/usb/gadget/legacy/webcam.c:333:25: error: initializer element is not constant


vim +224 drivers/usb/gadget/legacy/webcam.c

   220	
   221	static const struct uvcg_frame uvcg_frame_yuv_360p = {
   222		.fmt_type		= UVCG_UNCOMPRESSED,
   223		.frame = {
 > 224			.b_length			= uvc_frame_yuv_360p.bLength,
   225			.b_descriptor_type		= uvc_frame_yuv_360p.bDescriptorType,
   226			.b_descriptor_subtype		= uvc_frame_yuv_360p.bDescriptorSubType,
   227			.b_frame_index			= uvc_frame_yuv_360p.bFrameIndex,
   228			.bm_capabilities		= uvc_frame_yuv_360p.bmCapabilities,
   229			.w_width			= uvc_frame_yuv_360p.wWidth,
   230			.w_height			= uvc_frame_yuv_360p.wHeight,
   231			.dw_min_bit_rate		= uvc_frame_yuv_360p.dwMinBitRate,
   232			.dw_max_bit_rate		= uvc_frame_yuv_360p.dwMaxBitRate,
   233			.dw_max_video_frame_buffer_size	= uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize,
   234			.dw_default_frame_interval	= uvc_frame_yuv_360p.dwDefaultFrameInterval,
   235			.b_frame_interval_type		= uvc_frame_yuv_360p.bFrameIntervalType,
   236		},
   237		.dw_frame_interval	= (u32 *)uvc_frame_yuv_360p.dwFrameInterval,
   238	};
   239	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-08 13:13 ` [PATCH v2] " Andrzej Pietrasiewicz
                     ` (2 preceding siblings ...)
  2023-12-09 10:41   ` kernel test robot
@ 2023-12-09 22:17   ` kernel test robot
  2023-12-11 12:38   ` [PATCH v3] " Andrzej Pietrasiewicz
  4 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2023-12-09 22:17 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz, linux-usb
  Cc: llvm, oe-kbuild-all, Laurent Pinchart, Daniel Scally,
	Greg Kroah-Hartman, Michael Grzeschik, Andrzej Pietrasiewicz,
	kernel

Hi Andrzej,

kernel test robot noticed the following build errors:

[auto build test ERROR on 33cc938e65a98f1d29d0a18403dbbee050dcad9a]

url:    https://github.com/intel-lab-lkp/linux/commits/Andrzej-Pietrasiewicz/usb-gadget-webcam-Make-g_webcam-loadable-again/20231208-211513
base:   33cc938e65a98f1d29d0a18403dbbee050dcad9a
patch link:    https://lore.kernel.org/r/20231208131342.65671-1-andrzej.p%40collabora.com
patch subject: [PATCH v2] usb: gadget: webcam: Make g_webcam loadable again
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20231210/202312100602.sdYTHOg1-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231210/202312100602.sdYTHOg1-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312100602.sdYTHOg1-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/usb/gadget/legacy/webcam.c:224:36: error: initializer element is not a compile-time constant
     224 |                 .b_length                       = uvc_frame_yuv_360p.bLength,
         |                                                   ~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/usb/gadget/legacy/webcam.c:263:36: error: initializer element is not a compile-time constant
     263 |                 .b_length                       = uvc_frame_yuv_720p.bLength,
         |                                                   ~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/usb/gadget/legacy/webcam.c:332:37: error: initializer element is not a compile-time constant
     332 |                 .b_length                       = uvc_frame_mjpg_360p.bLength,
         |                                                   ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/usb/gadget/legacy/webcam.c:371:37: error: initializer element is not a compile-time constant
     371 |                 .b_length                       = uvc_frame_mjpg_720p.bLength,
         |                                                   ~~~~~~~~~~~~~~~~~~~~^~~~~~~
   4 errors generated.


vim +224 drivers/usb/gadget/legacy/webcam.c

   220	
   221	static const struct uvcg_frame uvcg_frame_yuv_360p = {
   222		.fmt_type		= UVCG_UNCOMPRESSED,
   223		.frame = {
 > 224			.b_length			= uvc_frame_yuv_360p.bLength,
   225			.b_descriptor_type		= uvc_frame_yuv_360p.bDescriptorType,
   226			.b_descriptor_subtype		= uvc_frame_yuv_360p.bDescriptorSubType,
   227			.b_frame_index			= uvc_frame_yuv_360p.bFrameIndex,
   228			.bm_capabilities		= uvc_frame_yuv_360p.bmCapabilities,
   229			.w_width			= uvc_frame_yuv_360p.wWidth,
   230			.w_height			= uvc_frame_yuv_360p.wHeight,
   231			.dw_min_bit_rate		= uvc_frame_yuv_360p.dwMinBitRate,
   232			.dw_max_bit_rate		= uvc_frame_yuv_360p.dwMaxBitRate,
   233			.dw_max_video_frame_buffer_size	= uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize,
   234			.dw_default_frame_interval	= uvc_frame_yuv_360p.dwDefaultFrameInterval,
   235			.b_frame_interval_type		= uvc_frame_yuv_360p.bFrameIntervalType,
   236		},
   237		.dw_frame_interval	= (u32 *)uvc_frame_yuv_360p.dwFrameInterval,
   238	};
   239	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-08 13:13 ` [PATCH v2] " Andrzej Pietrasiewicz
                     ` (3 preceding siblings ...)
  2023-12-09 22:17   ` kernel test robot
@ 2023-12-11 12:38   ` Andrzej Pietrasiewicz
  2023-12-11 20:47     ` kernel test robot
                       ` (2 more replies)
  4 siblings, 3 replies; 17+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-12-11 12:38 UTC (permalink / raw)
  To: linux-usb
  Cc: Laurent Pinchart, Daniel Scally, Greg Kroah-Hartman,
	Michael Grzeschik, Andrzej Pietrasiewicz, kernel

commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")

has rendered the precomposed (aka legacy) webcam gadget unloadable.

uvc_alloc() since then has depended on certain config groups being
available in configfs tree related to the UVC function. However, legacy
gadgets do not create anything in configfs, so uvc_alloc() must fail
with -ENOENT no matter what.

This patch mimics the required configfs hierarchy to satisfy the code which
inspects formats and frames found in uvcg_streaming_header.

This has been tested with guvcview on the host side, using vivid as a
source of video stream on the device side and using the userspace program
found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
---
v2..v3:
- fixed another typo (actually use uvcg_frame_mjpeg_720p where it should
  be used instead of its 360p counterpart)
- eliminated sparse warnings by reverting the effect of cpu_to_le[16|32]
  while assigning to uvcg_frame members

v1..v2:
- fixed a typo (missing character) in one of uvcg_frame_mjpeg_720p's members

 drivers/usb/gadget/function/f_uvc.c |  45 ++---
 drivers/usb/gadget/function/u_uvc.h |   6 +
 drivers/usb/gadget/legacy/webcam.c  | 251 ++++++++++++++++++++++------
 3 files changed, 234 insertions(+), 68 deletions(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 786379f1b7b7..3b46de85ca01 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -960,7 +960,8 @@ static void uvc_free(struct usb_function *f)
 	struct uvc_device *uvc = to_uvc(f);
 	struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts,
 					       func_inst);
-	config_item_put(&uvc->header->item);
+	if (!opts->header)
+		config_item_put(&uvc->header->item);
 	--opts->refcnt;
 	kfree(uvc);
 }
@@ -1052,25 +1053,29 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
 	uvc->desc.hs_streaming = opts->hs_streaming;
 	uvc->desc.ss_streaming = opts->ss_streaming;
 
-	streaming = config_group_find_item(&opts->func_inst.group, "streaming");
-	if (!streaming)
-		goto err_config;
-
-	header = config_group_find_item(to_config_group(streaming), "header");
-	config_item_put(streaming);
-	if (!header)
-		goto err_config;
-
-	h = config_group_find_item(to_config_group(header), "h");
-	config_item_put(header);
-	if (!h)
-		goto err_config;
-
-	uvc->header = to_uvcg_streaming_header(h);
-	if (!uvc->header->linked) {
-		mutex_unlock(&opts->lock);
-		kfree(uvc);
-		return ERR_PTR(-EBUSY);
+	if (opts->header) {
+		uvc->header = opts->header;
+	} else {
+		streaming = config_group_find_item(&opts->func_inst.group, "streaming");
+		if (!streaming)
+			goto err_config;
+
+		header = config_group_find_item(to_config_group(streaming), "header");
+		config_item_put(streaming);
+		if (!header)
+			goto err_config;
+
+		h = config_group_find_item(to_config_group(header), "h");
+		config_item_put(header);
+		if (!h)
+			goto err_config;
+
+		uvc->header = to_uvcg_streaming_header(h);
+		if (!uvc->header->linked) {
+			mutex_unlock(&opts->lock);
+			kfree(uvc);
+			return ERR_PTR(-EBUSY);
+		}
 	}
 
 	uvc->desc.extension_units = &opts->extension_units;
diff --git a/drivers/usb/gadget/function/u_uvc.h b/drivers/usb/gadget/function/u_uvc.h
index 1ce58f61253c..3ac392cbb779 100644
--- a/drivers/usb/gadget/function/u_uvc.h
+++ b/drivers/usb/gadget/function/u_uvc.h
@@ -98,6 +98,12 @@ struct f_uvc_opts {
 	 */
 	struct mutex			lock;
 	int				refcnt;
+
+	/*
+	 * Only for legacy gadget. Shall be NULL for configfs-composed gadgets,
+	 * which is guaranteed by alloc_inst implementation of f_uvc doing kzalloc.
+	 */
+	struct uvcg_streaming_header	*header;
 };
 
 #endif /* U_UVC_H */
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
index c06dd1af7a0c..11cfc62e2056 100644
--- a/drivers/usb/gadget/legacy/webcam.c
+++ b/drivers/usb/gadget/legacy/webcam.c
@@ -12,6 +12,7 @@
 #include <linux/usb/video.h>
 
 #include "u_uvc.h"
+#include "uvc_configfs.h"
 
 USB_GADGET_COMPOSITE_OPTIONS();
 
@@ -84,8 +85,6 @@ static struct usb_device_descriptor webcam_device_descriptor = {
 	.bNumConfigurations	= 0, /* dynamic */
 };
 
-DECLARE_UVC_HEADER_DESCRIPTOR(1);
-
 static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
 	.bLength		= UVC_DT_HEADER_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -158,21 +157,44 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
 	.bmaControls[1][0]	= 4,
 };
 
-static const struct uvc_format_uncompressed uvc_format_yuv = {
-	.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
-	.bFormatIndex		= 1,
-	.bNumFrameDescriptors	= 2,
-	.guidFormat		=
-		{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
-		 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71},
-	.bBitsPerPixel		= 16,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static const struct uvcg_color_matching uvcg_color_matching = {
+	.desc = {
+		.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_COLORFORMAT,
+		.bColorPrimaries	= 1,
+		.bTransferCharacteristics	= 1,
+		.bMatrixCoefficients	= 4,
+	},
+};
+
+static struct uvcg_uncompressed uvcg_format_yuv = {
+	.fmt = {
+		.type			= UVCG_UNCOMPRESSED,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
+		.bFormatIndex		= 1,
+		.bNumFrameDescriptors	= 2,
+		.guidFormat		= {
+			'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
+			 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
+		},
+		.bBitsPerPixel		= 16,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_yuv = {
+	.fmt = &uvcg_format_yuv.fmt,
 };
 
 DECLARE_UVC_FRAME_UNCOMPRESSED(1);
@@ -196,6 +218,35 @@ static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
 	.dwFrameInterval[2]	= cpu_to_le32(5000000),
 };
 
+static u32 uvcg_frame_yuv_360p_dw_frame_interval[] = {
+	[0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
+	[1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
+	[2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
+};
+
+static const struct uvcg_frame uvcg_frame_yuv_360p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= uvc_frame_yuv_360p.bLength,
+		.b_descriptor_type		= uvc_frame_yuv_360p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_yuv_360p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_yuv_360p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_yuv_360p.bmCapabilities,
+		.w_width			= le16_to_cpu(uvc_frame_yuv_360p.wWidth),
+		.w_height			= le16_to_cpu(uvc_frame_yuv_360p.wHeight),
+		.dw_min_bit_rate		= le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
+		.dw_max_bit_rate		= le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
+		.dw_max_video_frame_buffer_size	= le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
+		.dw_default_frame_interval	= le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
+		.b_frame_interval_type		= uvc_frame_yuv_360p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= uvcg_frame_yuv_360p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_360p,
+};
+
 static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -212,18 +263,56 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.dwFrameInterval[0]	= cpu_to_le32(5000000),
 };
 
-static const struct uvc_format_mjpeg uvc_format_mjpg = {
-	.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
-	.bFormatIndex		= 2,
-	.bNumFrameDescriptors	= 2,
-	.bmFlags		= 0,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static u32 uvcg_frame_yuv_720p_dw_frame_interval[] = {
+	[0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
+};
+
+static const struct uvcg_frame uvcg_frame_yuv_720p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= uvc_frame_yuv_720p.bLength,
+		.b_descriptor_type		= uvc_frame_yuv_720p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_yuv_720p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_yuv_720p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_yuv_720p.bmCapabilities,
+		.w_width			= le16_to_cpu(uvc_frame_yuv_720p.wWidth),
+		.w_height			= le16_to_cpu(uvc_frame_yuv_720p.wHeight),
+		.dw_min_bit_rate		= le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
+		.dw_max_bit_rate		= le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
+		.dw_max_video_frame_buffer_size	= le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
+		.dw_default_frame_interval	= le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
+		.b_frame_interval_type		= uvc_frame_yuv_720p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= uvcg_frame_yuv_720p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_720p,
+};
+
+static struct uvcg_mjpeg uvcg_format_mjpeg = {
+	.fmt = {
+		.type			= UVCG_MJPEG,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
+		.bFormatIndex		= 2,
+		.bNumFrameDescriptors	= 2,
+		.bmFlags		= 0,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_mjpeg = {
+	.fmt = &uvcg_format_mjpeg.fmt,
 };
 
 DECLARE_UVC_FRAME_MJPEG(1);
@@ -247,6 +336,35 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
 	.dwFrameInterval[2]	= cpu_to_le32(5000000),
 };
 
+static u32 uvcg_frame_mjpeg_360p_dw_frame_interval[] = {
+	[0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
+	[1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
+	[2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
+};
+
+static const struct uvcg_frame uvcg_frame_mjpeg_360p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= uvc_frame_mjpg_360p.bLength,
+		.b_descriptor_type		= uvc_frame_mjpg_360p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_mjpg_360p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_mjpg_360p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_mjpg_360p.bmCapabilities,
+		.w_width			= le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
+		.w_height			= le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
+		.dw_min_bit_rate		= le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
+		.dw_max_bit_rate		= le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
+		.dw_max_video_frame_buffer_size	= le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
+		.dw_default_frame_interval	= le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
+		.b_frame_interval_type		= uvc_frame_mjpg_360p.bFrameIntervalType,
+	},
+	.dw_frame_interval	= uvcg_frame_mjpeg_360p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
+};
+
 static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.bLength		= UVC_DT_FRAME_MJPEG_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -263,13 +381,33 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.dwFrameInterval[0]	= cpu_to_le32(5000000),
 };
 
-static const struct uvc_color_matching_descriptor uvc_color_matching = {
-	.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_COLORFORMAT,
-	.bColorPrimaries	= 1,
-	.bTransferCharacteristics	= 1,
-	.bMatrixCoefficients	= 4,
+static u32 uvcg_frame_mjpeg_720p_dw_frame_interval[] = {
+	[0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
+};
+
+static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= uvc_frame_mjpg_720p.bLength,
+		.b_descriptor_type		= uvc_frame_mjpg_720p.bDescriptorType,
+		.b_descriptor_subtype		= uvc_frame_mjpg_720p.bDescriptorSubType,
+		.b_frame_index			= uvc_frame_mjpg_720p.bFrameIndex,
+		.bm_capabilities		= uvc_frame_mjpg_720p.bmCapabilities,
+		.w_width			= le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
+		.w_height			= le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
+		.dw_min_bit_rate		= le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
+		.dw_max_bit_rate		= le32_to_cpu(uvc_frame_mjpg_720p.dwMaxBitRate),
+		.dw_max_video_frame_buffer_size	= le32_to_cpu(uvc_frame_mjpg_720p.dwMaxVideoFrameBufferSize),
+		.dw_default_frame_interval	= le32_to_cpu(uvc_frame_mjpg_720p.dwDefaultFrameInterval),
+	},
+	.dw_frame_interval	= uvcg_frame_mjpeg_720p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_720p,
+};
+
+static struct uvcg_streaming_header uvcg_streaming_header = {
 };
 
 static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
@@ -290,40 +428,40 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
 
 static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
@@ -387,6 +525,23 @@ webcam_bind(struct usb_composite_dev *cdev)
 	uvc_opts->hs_streaming = uvc_hs_streaming_cls;
 	uvc_opts->ss_streaming = uvc_ss_streaming_cls;
 
+	INIT_LIST_HEAD(&uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_360p.entry, &uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_720p.entry, &uvcg_format_yuv.fmt.frames);
+	uvcg_format_yuv.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_360p.entry, &uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_720p.entry, &uvcg_format_mjpeg.fmt.frames);
+	uvcg_format_mjpeg.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_yuv.entry, &uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_mjpeg.entry, &uvcg_streaming_header.formats);
+	uvcg_streaming_header.num_fmt = 2;
+
+	uvc_opts->header = &uvcg_streaming_header;
+
 	/* Allocate string descriptor numbers ... note that string contents
 	 * can be overridden by the composite_dev glue.
 	 */

base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-11 12:38   ` [PATCH v3] " Andrzej Pietrasiewicz
@ 2023-12-11 20:47     ` kernel test robot
  2023-12-11 21:53     ` kernel test robot
  2023-12-12 19:05     ` [PATCH v4] " Andrzej Pietrasiewicz
  2 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2023-12-11 20:47 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz, linux-usb
  Cc: oe-kbuild-all, Laurent Pinchart, Daniel Scally,
	Greg Kroah-Hartman, Michael Grzeschik, Andrzej Pietrasiewicz,
	kernel

Hi Andrzej,

kernel test robot noticed the following build errors:

[auto build test ERROR on 33cc938e65a98f1d29d0a18403dbbee050dcad9a]

url:    https://github.com/intel-lab-lkp/linux/commits/Andrzej-Pietrasiewicz/usb-gadget-webcam-Make-g_webcam-loadable-again/20231211-204453
base:   33cc938e65a98f1d29d0a18403dbbee050dcad9a
patch link:    https://lore.kernel.org/r/20231211123819.76648-1-andrzej.p%40collabora.com
patch subject: [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
config: arc-allmodconfig (https://download.01.org/0day-ci/archive/20231212/202312120426.lOtrWHIw-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231212/202312120426.lOtrWHIw-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312120426.lOtrWHIw-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/swab.h:5,
                    from include/uapi/linux/byteorder/big_endian.h:14,
                    from include/linux/byteorder/big_endian.h:5,
                    from arch/arc/include/uapi/asm/byteorder.h:14,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/arc/include/asm/bitops.h:192,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:222:15: note: in expansion of macro 'le32_to_cpu'
     222 |         [0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[0]')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:222:15: note: in expansion of macro 'le32_to_cpu'
     222 |         [0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
         |               ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:223:15: note: in expansion of macro 'le32_to_cpu'
     223 |         [1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[1]')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:223:15: note: in expansion of macro 'le32_to_cpu'
     223 |         [1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
         |               ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:224:15: note: in expansion of macro 'le32_to_cpu'
     224 |         [2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[2]')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:224:15: note: in expansion of macro 'le32_to_cpu'
     224 |         [2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: error: initializer element is not constant
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:235:51: note: in expansion of macro 'le16_to_cpu'
     235 |                 .w_width                        = le16_to_cpu(uvc_frame_yuv_360p.wWidth),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_width')
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:235:51: note: in expansion of macro 'le16_to_cpu'
     235 |                 .w_width                        = le16_to_cpu(uvc_frame_yuv_360p.wWidth),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: error: initializer element is not constant
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:236:51: note: in expansion of macro 'le16_to_cpu'
     236 |                 .w_height                       = le16_to_cpu(uvc_frame_yuv_360p.wHeight),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_height')
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:236:51: note: in expansion of macro 'le16_to_cpu'
     236 |                 .w_height                       = le16_to_cpu(uvc_frame_yuv_360p.wHeight),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:237:51: note: in expansion of macro 'le32_to_cpu'
     237 |                 .dw_min_bit_rate                = le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_min_bit_rate')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:237:51: note: in expansion of macro 'le32_to_cpu'
     237 |                 .dw_min_bit_rate                = le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:238:51: note: in expansion of macro 'le32_to_cpu'
     238 |                 .dw_max_bit_rate                = le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_bit_rate')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:238:51: note: in expansion of macro 'le32_to_cpu'
     238 |                 .dw_max_bit_rate                = le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:239:51: note: in expansion of macro 'le32_to_cpu'
     239 |                 .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_video_frame_buffer_size')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:239:51: note: in expansion of macro 'le32_to_cpu'
     239 |                 .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:240:51: note: in expansion of macro 'le32_to_cpu'
     240 |                 .dw_default_frame_interval      = le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_default_frame_interval')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:240:51: note: in expansion of macro 'le32_to_cpu'
     240 |                 .dw_default_frame_interval      = le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:267:15: note: in expansion of macro 'le32_to_cpu'
     267 |         [0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_720p_dw_frame_interval[0]')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:267:15: note: in expansion of macro 'le32_to_cpu'
     267 |         [0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: error: initializer element is not constant
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:278:51: note: in expansion of macro 'le16_to_cpu'
     278 |                 .w_width                        = le16_to_cpu(uvc_frame_yuv_720p.wWidth),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_width')
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:278:51: note: in expansion of macro 'le16_to_cpu'
     278 |                 .w_width                        = le16_to_cpu(uvc_frame_yuv_720p.wWidth),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: error: initializer element is not constant
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:279:51: note: in expansion of macro 'le16_to_cpu'
     279 |                 .w_height                       = le16_to_cpu(uvc_frame_yuv_720p.wHeight),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_height')
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:279:51: note: in expansion of macro 'le16_to_cpu'
     279 |                 .w_height                       = le16_to_cpu(uvc_frame_yuv_720p.wHeight),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:280:51: note: in expansion of macro 'le32_to_cpu'
     280 |                 .dw_min_bit_rate                = le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_min_bit_rate')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:280:51: note: in expansion of macro 'le32_to_cpu'
     280 |                 .dw_min_bit_rate                = le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:281:51: note: in expansion of macro 'le32_to_cpu'
     281 |                 .dw_max_bit_rate                = le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_bit_rate')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:281:51: note: in expansion of macro 'le32_to_cpu'
     281 |                 .dw_max_bit_rate                = le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:282:51: note: in expansion of macro 'le32_to_cpu'
     282 |                 .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_video_frame_buffer_size')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:282:51: note: in expansion of macro 'le32_to_cpu'
     282 |                 .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:283:51: note: in expansion of macro 'le32_to_cpu'
     283 |                 .dw_default_frame_interval      = le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_default_frame_interval')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:283:51: note: in expansion of macro 'le32_to_cpu'
     283 |                 .dw_default_frame_interval      = le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:340:15: note: in expansion of macro 'le32_to_cpu'
     340 |         [0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[0]')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:340:15: note: in expansion of macro 'le32_to_cpu'
     340 |         [0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
         |               ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:341:15: note: in expansion of macro 'le32_to_cpu'
     341 |         [1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[1]')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:341:15: note: in expansion of macro 'le32_to_cpu'
     341 |         [1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
         |               ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:342:15: note: in expansion of macro 'le32_to_cpu'
     342 |         [2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[2]')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:342:15: note: in expansion of macro 'le32_to_cpu'
     342 |         [2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: error: initializer element is not constant
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:353:51: note: in expansion of macro 'le16_to_cpu'
     353 |                 .w_width                        = le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.w_width')
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:353:51: note: in expansion of macro 'le16_to_cpu'
     353 |                 .w_width                        = le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: error: initializer element is not constant
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:354:51: note: in expansion of macro 'le16_to_cpu'
     354 |                 .w_height                       = le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.w_height')
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:354:51: note: in expansion of macro 'le16_to_cpu'
     354 |                 .w_height                       = le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:355:51: note: in expansion of macro 'le32_to_cpu'
     355 |                 .dw_min_bit_rate                = le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_min_bit_rate')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:355:51: note: in expansion of macro 'le32_to_cpu'
     355 |                 .dw_min_bit_rate                = le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:356:51: note: in expansion of macro 'le32_to_cpu'
     356 |                 .dw_max_bit_rate                = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_max_bit_rate')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:356:51: note: in expansion of macro 'le32_to_cpu'
     356 |                 .dw_max_bit_rate                = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:357:51: note: in expansion of macro 'le32_to_cpu'
     357 |                 .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_max_video_frame_buffer_size')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:357:51: note: in expansion of macro 'le32_to_cpu'
     357 |                 .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:358:51: note: in expansion of macro 'le32_to_cpu'
     358 |                 .dw_default_frame_interval      = le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_default_frame_interval')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:358:51: note: in expansion of macro 'le32_to_cpu'
     358 |                 .dw_default_frame_interval      = le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
         |                                                   ^~~~~~~~~~~
>> include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:385:15: note: in expansion of macro 'le32_to_cpu'
     385 |         [0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_720p_dw_frame_interval[0]')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:385:15: note: in expansion of macro 'le32_to_cpu'
     385 |         [0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
         |               ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: error: initializer element is not constant
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:396:51: note: in expansion of macro 'le16_to_cpu'
     396 |                 .w_width                        = le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.w_width')
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:396:51: note: in expansion of macro 'le16_to_cpu'
     396 |                 .w_width                        = le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: error: initializer element is not constant
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:397:51: note: in expansion of macro 'le16_to_cpu'
     397 |                 .w_height                       = le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:105:9: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.w_height')
     105 |         (__u16)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:37:26: note: in expansion of macro '__swab16'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
      91 | #define le16_to_cpu __le16_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:397:51: note: in expansion of macro 'le16_to_cpu'
     397 |                 .w_height                       = le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:398:51: note: in expansion of macro 'le32_to_cpu'
     398 |                 .dw_min_bit_rate                = le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.dw_min_bit_rate')
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                          ^~~~~~~~
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
      89 | #define le32_to_cpu __le32_to_cpu
         |                     ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:398:51: note: in expansion of macro 'le32_to_cpu'
     398 |                 .dw_min_bit_rate                = le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
         |                                                   ^~~~~~~~~~~
   include/uapi/linux/swab.h:118:9: error: initializer element is not constant
     118 |         (__u32)(__builtin_constant_p(x) ?       \
         |         ^
   include/uapi/linux/byteorder/big_endian.h:35:26: note: in expansion of macro '__swab32'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))


vim +118 include/uapi/linux/swab.h

607ca46e97a1b6 David Howells 2012-10-13  109  
607ca46e97a1b6 David Howells 2012-10-13  110  /**
607ca46e97a1b6 David Howells 2012-10-13  111   * __swab32 - return a byteswapped 32-bit value
607ca46e97a1b6 David Howells 2012-10-13  112   * @x: value to byteswap
607ca46e97a1b6 David Howells 2012-10-13  113   */
7322dd755e7dd3 Arnd Bergmann 2016-05-05  114  #ifdef __HAVE_BUILTIN_BSWAP32__
7322dd755e7dd3 Arnd Bergmann 2016-05-05  115  #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
7322dd755e7dd3 Arnd Bergmann 2016-05-05  116  #else
607ca46e97a1b6 David Howells 2012-10-13  117  #define __swab32(x)				\
d30dfd490f7dc4 Justin Stitt  2022-06-08 @118  	(__u32)(__builtin_constant_p(x) ?	\
607ca46e97a1b6 David Howells 2012-10-13  119  	___constant_swab32(x) :			\
607ca46e97a1b6 David Howells 2012-10-13  120  	__fswab32(x))
7322dd755e7dd3 Arnd Bergmann 2016-05-05  121  #endif
607ca46e97a1b6 David Howells 2012-10-13  122  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-11 12:38   ` [PATCH v3] " Andrzej Pietrasiewicz
  2023-12-11 20:47     ` kernel test robot
@ 2023-12-11 21:53     ` kernel test robot
  2023-12-12 17:01       ` Andrzej Pietrasiewicz
  2023-12-12 19:05     ` [PATCH v4] " Andrzej Pietrasiewicz
  2 siblings, 1 reply; 17+ messages in thread
From: kernel test robot @ 2023-12-11 21:53 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz, linux-usb
  Cc: oe-kbuild-all, Laurent Pinchart, Daniel Scally,
	Greg Kroah-Hartman, Michael Grzeschik, Andrzej Pietrasiewicz,
	kernel

Hi Andrzej,

kernel test robot noticed the following build errors:

[auto build test ERROR on 33cc938e65a98f1d29d0a18403dbbee050dcad9a]

url:    https://github.com/intel-lab-lkp/linux/commits/Andrzej-Pietrasiewicz/usb-gadget-webcam-Make-g_webcam-loadable-again/20231211-204453
base:   33cc938e65a98f1d29d0a18403dbbee050dcad9a
patch link:    https://lore.kernel.org/r/20231211123819.76648-1-andrzej.p%40collabora.com
patch subject: [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
config: i386-randconfig-003-20231212 (https://download.01.org/0day-ci/archive/20231212/202312120517.4yhTyhYY-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231212/202312120517.4yhTyhYY-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312120517.4yhTyhYY-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/byteorder/little_endian.h:5:0,
                    from arch/x86/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/x86/include/asm/bitops.h:436,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:222:8: note: in expansion of macro 'le32_to_cpu'
     [0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
           ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[0]')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:222:8: note: in expansion of macro 'le32_to_cpu'
     [0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
           ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:223:8: note: in expansion of macro 'le32_to_cpu'
     [1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
           ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[1]')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:223:8: note: in expansion of macro 'le32_to_cpu'
     [1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
           ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:224:8: note: in expansion of macro 'le32_to_cpu'
     [2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
           ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[2]')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:224:8: note: in expansion of macro 'le32_to_cpu'
     [2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
           ^~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:230:17: error: initializer element is not constant
      .b_length   = uvc_frame_yuv_360p.bLength,
                    ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:230:17: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_length')
   drivers/usb/gadget/legacy/webcam.c:231:25: error: initializer element is not constant
      .b_descriptor_type  = uvc_frame_yuv_360p.bDescriptorType,
                            ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:231:25: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_descriptor_type')
   drivers/usb/gadget/legacy/webcam.c:232:28: error: initializer element is not constant
      .b_descriptor_subtype  = uvc_frame_yuv_360p.bDescriptorSubType,
                               ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:232:28: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_descriptor_subtype')
   drivers/usb/gadget/legacy/webcam.c:233:22: error: initializer element is not constant
      .b_frame_index   = uvc_frame_yuv_360p.bFrameIndex,
                         ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:233:22: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_frame_index')
   drivers/usb/gadget/legacy/webcam.c:234:23: error: initializer element is not constant
      .bm_capabilities  = uvc_frame_yuv_360p.bmCapabilities,
                          ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:234:23: note: (near initialization for 'uvcg_frame_yuv_360p.frame.bm_capabilities')
   In file included from include/linux/byteorder/little_endian.h:5:0,
                    from arch/x86/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/x86/include/asm/bitops.h:436,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
   include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:235:16: note: in expansion of macro 'le16_to_cpu'
      .w_width   = le16_to_cpu(uvc_frame_yuv_360p.wWidth),
                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_width')
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:235:16: note: in expansion of macro 'le16_to_cpu'
      .w_width   = le16_to_cpu(uvc_frame_yuv_360p.wWidth),
                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:236:17: note: in expansion of macro 'le16_to_cpu'
      .w_height   = le16_to_cpu(uvc_frame_yuv_360p.wHeight),
                    ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_height')
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:236:17: note: in expansion of macro 'le16_to_cpu'
      .w_height   = le16_to_cpu(uvc_frame_yuv_360p.wHeight),
                    ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:237:23: note: in expansion of macro 'le32_to_cpu'
      .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
                          ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_min_bit_rate')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:237:23: note: in expansion of macro 'le32_to_cpu'
      .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
                          ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:238:23: note: in expansion of macro 'le32_to_cpu'
      .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
                          ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_bit_rate')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:238:23: note: in expansion of macro 'le32_to_cpu'
      .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
                          ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:239:37: note: in expansion of macro 'le32_to_cpu'
      .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
                                        ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_video_frame_buffer_size')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:239:37: note: in expansion of macro 'le32_to_cpu'
      .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
                                        ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:240:32: note: in expansion of macro 'le32_to_cpu'
      .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
                                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_default_frame_interval')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:240:32: note: in expansion of macro 'le32_to_cpu'
      .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
                                   ^~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:241:29: error: initializer element is not constant
      .b_frame_interval_type  = uvc_frame_yuv_360p.bFrameIntervalType,
                                ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:241:29: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_frame_interval_type')
   In file included from include/linux/byteorder/little_endian.h:5:0,
                    from arch/x86/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/x86/include/asm/bitops.h:436,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:267:8: note: in expansion of macro 'le32_to_cpu'
     [0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
           ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p_dw_frame_interval[0]')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:267:8: note: in expansion of macro 'le32_to_cpu'
     [0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
           ^~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:273:17: error: initializer element is not constant
      .b_length   = uvc_frame_yuv_720p.bLength,
                    ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:273:17: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_length')
   drivers/usb/gadget/legacy/webcam.c:274:25: error: initializer element is not constant
      .b_descriptor_type  = uvc_frame_yuv_720p.bDescriptorType,
                            ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:274:25: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_descriptor_type')
   drivers/usb/gadget/legacy/webcam.c:275:28: error: initializer element is not constant
      .b_descriptor_subtype  = uvc_frame_yuv_720p.bDescriptorSubType,
                               ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:275:28: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_descriptor_subtype')
   drivers/usb/gadget/legacy/webcam.c:276:22: error: initializer element is not constant
      .b_frame_index   = uvc_frame_yuv_720p.bFrameIndex,
                         ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:276:22: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_frame_index')
   drivers/usb/gadget/legacy/webcam.c:277:23: error: initializer element is not constant
      .bm_capabilities  = uvc_frame_yuv_720p.bmCapabilities,
                          ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:277:23: note: (near initialization for 'uvcg_frame_yuv_720p.frame.bm_capabilities')
   In file included from include/linux/byteorder/little_endian.h:5:0,
                    from arch/x86/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/x86/include/asm/bitops.h:436,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
   include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:278:16: note: in expansion of macro 'le16_to_cpu'
      .w_width   = le16_to_cpu(uvc_frame_yuv_720p.wWidth),
                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_width')
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:278:16: note: in expansion of macro 'le16_to_cpu'
      .w_width   = le16_to_cpu(uvc_frame_yuv_720p.wWidth),
                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:279:17: note: in expansion of macro 'le16_to_cpu'
      .w_height   = le16_to_cpu(uvc_frame_yuv_720p.wHeight),
                    ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_height')
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:279:17: note: in expansion of macro 'le16_to_cpu'
      .w_height   = le16_to_cpu(uvc_frame_yuv_720p.wHeight),
                    ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:280:23: note: in expansion of macro 'le32_to_cpu'
      .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
                          ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_min_bit_rate')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:280:23: note: in expansion of macro 'le32_to_cpu'
      .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
                          ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:281:23: note: in expansion of macro 'le32_to_cpu'
      .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
                          ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_bit_rate')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:281:23: note: in expansion of macro 'le32_to_cpu'
      .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
                          ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:282:37: note: in expansion of macro 'le32_to_cpu'
      .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
                                        ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_video_frame_buffer_size')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:282:37: note: in expansion of macro 'le32_to_cpu'
      .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
                                        ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:283:32: note: in expansion of macro 'le32_to_cpu'
      .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
                                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_default_frame_interval')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:283:32: note: in expansion of macro 'le32_to_cpu'
      .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
                                   ^~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:284:29: error: initializer element is not constant
      .b_frame_interval_type  = uvc_frame_yuv_720p.bFrameIntervalType,
                                ^~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:284:29: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_frame_interval_type')
   In file included from include/linux/byteorder/little_endian.h:5:0,
                    from arch/x86/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/x86/include/asm/bitops.h:436,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:340:8: note: in expansion of macro 'le32_to_cpu'
     [0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
           ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[0]')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:340:8: note: in expansion of macro 'le32_to_cpu'
     [0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
           ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:341:8: note: in expansion of macro 'le32_to_cpu'
     [1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
           ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[1]')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:341:8: note: in expansion of macro 'le32_to_cpu'
     [1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
           ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:342:8: note: in expansion of macro 'le32_to_cpu'
     [2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
           ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[2]')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:342:8: note: in expansion of macro 'le32_to_cpu'
     [2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
           ^~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:348:17: error: initializer element is not constant
      .b_length   = uvc_frame_mjpg_360p.bLength,
                    ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:348:17: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_length')
   drivers/usb/gadget/legacy/webcam.c:349:25: error: initializer element is not constant
      .b_descriptor_type  = uvc_frame_mjpg_360p.bDescriptorType,
                            ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:349:25: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_descriptor_type')
   drivers/usb/gadget/legacy/webcam.c:350:28: error: initializer element is not constant
      .b_descriptor_subtype  = uvc_frame_mjpg_360p.bDescriptorSubType,
                               ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:350:28: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_descriptor_subtype')
   drivers/usb/gadget/legacy/webcam.c:351:22: error: initializer element is not constant
      .b_frame_index   = uvc_frame_mjpg_360p.bFrameIndex,
                         ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:351:22: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_frame_index')
   drivers/usb/gadget/legacy/webcam.c:352:23: error: initializer element is not constant
      .bm_capabilities  = uvc_frame_mjpg_360p.bmCapabilities,
                          ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:352:23: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.bm_capabilities')
   In file included from include/linux/byteorder/little_endian.h:5:0,
                    from arch/x86/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/x86/include/asm/bitops.h:436,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
   include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:353:16: note: in expansion of macro 'le16_to_cpu'
      .w_width   = le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.w_width')
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:353:16: note: in expansion of macro 'le16_to_cpu'
      .w_width   = le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:354:17: note: in expansion of macro 'le16_to_cpu'
      .w_height   = le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
                    ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.w_height')
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:354:17: note: in expansion of macro 'le16_to_cpu'
      .w_height   = le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
                    ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:355:23: note: in expansion of macro 'le32_to_cpu'
      .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
                          ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_min_bit_rate')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:355:23: note: in expansion of macro 'le32_to_cpu'
      .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
                          ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:356:23: note: in expansion of macro 'le32_to_cpu'
      .dw_max_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
                          ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_max_bit_rate')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:356:23: note: in expansion of macro 'le32_to_cpu'
      .dw_max_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
                          ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:357:37: note: in expansion of macro 'le32_to_cpu'
      .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
                                        ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_max_video_frame_buffer_size')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:357:37: note: in expansion of macro 'le32_to_cpu'
      .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
                                        ^~~~~~~~~~~
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:358:32: note: in expansion of macro 'le32_to_cpu'
      .dw_default_frame_interval = le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
                                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_default_frame_interval')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:358:32: note: in expansion of macro 'le32_to_cpu'
      .dw_default_frame_interval = le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
                                   ^~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:359:29: error: initializer element is not constant
      .b_frame_interval_type  = uvc_frame_mjpg_360p.bFrameIntervalType,
                                ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:359:29: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_frame_interval_type')
   In file included from include/linux/byteorder/little_endian.h:5:0,
                    from arch/x86/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/x86/include/asm/bitops.h:436,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:385:8: note: in expansion of macro 'le32_to_cpu'
     [0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
           ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_720p_dw_frame_interval[0]')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:385:8: note: in expansion of macro 'le32_to_cpu'
     [0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
           ^~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:391:17: error: initializer element is not constant
      .b_length   = uvc_frame_mjpg_720p.bLength,
                    ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:391:17: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_length')
   drivers/usb/gadget/legacy/webcam.c:392:25: error: initializer element is not constant
      .b_descriptor_type  = uvc_frame_mjpg_720p.bDescriptorType,
                            ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:392:25: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_descriptor_type')
   drivers/usb/gadget/legacy/webcam.c:393:28: error: initializer element is not constant
      .b_descriptor_subtype  = uvc_frame_mjpg_720p.bDescriptorSubType,
                               ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:393:28: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_descriptor_subtype')
   drivers/usb/gadget/legacy/webcam.c:394:22: error: initializer element is not constant
      .b_frame_index   = uvc_frame_mjpg_720p.bFrameIndex,
                         ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:394:22: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_frame_index')
   drivers/usb/gadget/legacy/webcam.c:395:23: error: initializer element is not constant
      .bm_capabilities  = uvc_frame_mjpg_720p.bmCapabilities,
                          ^~~~~~~~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:395:23: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.bm_capabilities')
   In file included from include/linux/byteorder/little_endian.h:5:0,
                    from arch/x86/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/x86/include/asm/bitops.h:436,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:23,
                    from drivers/usb/gadget/legacy/webcam.c:9:
   include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:396:16: note: in expansion of macro 'le16_to_cpu'
      .w_width   = le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.w_width')
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:396:16: note: in expansion of macro 'le16_to_cpu'
      .w_width   = le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
                   ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:397:17: note: in expansion of macro 'le16_to_cpu'
      .w_height   = le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
                    ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.w_height')
    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                             ^
   include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
    #define le16_to_cpu __le16_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:397:17: note: in expansion of macro 'le16_to_cpu'
      .w_height   = le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
                    ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:398:23: note: in expansion of macro 'le32_to_cpu'
      .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
                          ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.dw_min_bit_rate')
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                             ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   drivers/usb/gadget/legacy/webcam.c:398:23: note: in expansion of macro 'le32_to_cpu'
      .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
                          ^~~~~~~~~~~
   include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
    #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))


vim +35 include/uapi/linux/byteorder/little_endian.h

5921e6f8809b16 David Howells 2012-10-13  15  
5921e6f8809b16 David Howells 2012-10-13  16  #define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
5921e6f8809b16 David Howells 2012-10-13  17  #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
5921e6f8809b16 David Howells 2012-10-13  18  #define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
5921e6f8809b16 David Howells 2012-10-13  19  #define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
5921e6f8809b16 David Howells 2012-10-13  20  #define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
5921e6f8809b16 David Howells 2012-10-13  21  #define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
5921e6f8809b16 David Howells 2012-10-13  22  #define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
5921e6f8809b16 David Howells 2012-10-13  23  #define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
5921e6f8809b16 David Howells 2012-10-13  24  #define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
5921e6f8809b16 David Howells 2012-10-13  25  #define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
5921e6f8809b16 David Howells 2012-10-13  26  #define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
5921e6f8809b16 David Howells 2012-10-13  27  #define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
5921e6f8809b16 David Howells 2012-10-13  28  #define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
5921e6f8809b16 David Howells 2012-10-13  29  #define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
5921e6f8809b16 David Howells 2012-10-13  30  #define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
5921e6f8809b16 David Howells 2012-10-13  31  #define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
5921e6f8809b16 David Howells 2012-10-13  32  #define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
5921e6f8809b16 David Howells 2012-10-13  33  #define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
5921e6f8809b16 David Howells 2012-10-13  34  #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
5921e6f8809b16 David Howells 2012-10-13 @35  #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
5921e6f8809b16 David Howells 2012-10-13  36  #define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
5921e6f8809b16 David Howells 2012-10-13  37  #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
5921e6f8809b16 David Howells 2012-10-13  38  #define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
5921e6f8809b16 David Howells 2012-10-13  39  #define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
5921e6f8809b16 David Howells 2012-10-13  40  #define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
5921e6f8809b16 David Howells 2012-10-13  41  #define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
5921e6f8809b16 David Howells 2012-10-13  42  #define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
5921e6f8809b16 David Howells 2012-10-13  43  #define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
5921e6f8809b16 David Howells 2012-10-13  44  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-11 21:53     ` kernel test robot
@ 2023-12-12 17:01       ` Andrzej Pietrasiewicz
  2023-12-12 18:22         ` Laurent Pinchart
  0 siblings, 1 reply; 17+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-12-12 17:01 UTC (permalink / raw)
  To: kernel test robot, linux-usb
  Cc: oe-kbuild-all, Laurent Pinchart, Daniel Scally,
	Greg Kroah-Hartman, Michael Grzeschik, kernel

Hi robot,

W dniu 11.12.2023 o 22:53, kernel test robot pisze:
> Hi Andrzej,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on 33cc938e65a98f1d29d0a18403dbbee050dcad9a]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Andrzej-Pietrasiewicz/usb-gadget-webcam-Make-g_webcam-loadable-again/20231211-204453
> base:   33cc938e65a98f1d29d0a18403dbbee050dcad9a
> patch link:    https://lore.kernel.org/r/20231211123819.76648-1-andrzej.p%40collabora.com
> patch subject: [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
> config: i386-randconfig-003-20231212 (https://download.01.org/0day-ci/archive/20231212/202312120517.4yhTyhYY-lkp@intel.com/config)
> compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231212/202312120517.4yhTyhYY-lkp@intel.com/reproduce)

The reproduction steps under the above link are:

         make W=1 O=build_dir ARCH=i386 olddefconfig
         make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/usb/gadge/legacy/

but that builds clean on my machine. I had to:

make CC=gcc-7 W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/usb/gadget/legacy/

to actually see the below errors.

Using a modern compiler there are no errors, so I'm wondering if the errors
reported are maybe a problem of an old compiler rather then the submitted patch?

Regards,

Andrzej

> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202312120517.4yhTyhYY-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>     In file included from include/linux/byteorder/little_endian.h:5:0,
>                      from arch/x86/include/uapi/asm/byteorder.h:5,
>                      from include/asm-generic/bitops/le.h:6,
>                      from arch/x86/include/asm/bitops.h:436,
>                      from include/linux/bitops.h:68,
>                      from include/linux/kernel.h:23,
>                      from drivers/usb/gadget/legacy/webcam.c:9:
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:222:8: note: in expansion of macro 'le32_to_cpu'
>       [0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
>             ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[0]')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:222:8: note: in expansion of macro 'le32_to_cpu'
>       [0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
>             ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:223:8: note: in expansion of macro 'le32_to_cpu'
>       [1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
>             ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[1]')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:223:8: note: in expansion of macro 'le32_to_cpu'
>       [1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
>             ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:224:8: note: in expansion of macro 'le32_to_cpu'
>       [2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
>             ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[2]')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:224:8: note: in expansion of macro 'le32_to_cpu'
>       [2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
>             ^~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:230:17: error: initializer element is not constant
>        .b_length   = uvc_frame_yuv_360p.bLength,
>                      ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:230:17: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_length')
>     drivers/usb/gadget/legacy/webcam.c:231:25: error: initializer element is not constant
>        .b_descriptor_type  = uvc_frame_yuv_360p.bDescriptorType,
>                              ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:231:25: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_descriptor_type')
>     drivers/usb/gadget/legacy/webcam.c:232:28: error: initializer element is not constant
>        .b_descriptor_subtype  = uvc_frame_yuv_360p.bDescriptorSubType,
>                                 ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:232:28: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_descriptor_subtype')
>     drivers/usb/gadget/legacy/webcam.c:233:22: error: initializer element is not constant
>        .b_frame_index   = uvc_frame_yuv_360p.bFrameIndex,
>                           ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:233:22: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_frame_index')
>     drivers/usb/gadget/legacy/webcam.c:234:23: error: initializer element is not constant
>        .bm_capabilities  = uvc_frame_yuv_360p.bmCapabilities,
>                            ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:234:23: note: (near initialization for 'uvcg_frame_yuv_360p.frame.bm_capabilities')
>     In file included from include/linux/byteorder/little_endian.h:5:0,
>                      from arch/x86/include/uapi/asm/byteorder.h:5,
>                      from include/asm-generic/bitops/le.h:6,
>                      from arch/x86/include/asm/bitops.h:436,
>                      from include/linux/bitops.h:68,
>                      from include/linux/kernel.h:23,
>                      from drivers/usb/gadget/legacy/webcam.c:9:
>     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:235:16: note: in expansion of macro 'le16_to_cpu'
>        .w_width   = le16_to_cpu(uvc_frame_yuv_360p.wWidth),
>                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_width')
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:235:16: note: in expansion of macro 'le16_to_cpu'
>        .w_width   = le16_to_cpu(uvc_frame_yuv_360p.wWidth),
>                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:236:17: note: in expansion of macro 'le16_to_cpu'
>        .w_height   = le16_to_cpu(uvc_frame_yuv_360p.wHeight),
>                      ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_height')
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:236:17: note: in expansion of macro 'le16_to_cpu'
>        .w_height   = le16_to_cpu(uvc_frame_yuv_360p.wHeight),
>                      ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:237:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
>                            ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_min_bit_rate')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:237:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
>                            ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:238:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
>                            ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_bit_rate')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:238:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
>                            ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:239:37: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
>                                          ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_video_frame_buffer_size')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:239:37: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
>                                          ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:240:32: note: in expansion of macro 'le32_to_cpu'
>        .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
>                                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_default_frame_interval')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:240:32: note: in expansion of macro 'le32_to_cpu'
>        .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
>                                     ^~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:241:29: error: initializer element is not constant
>        .b_frame_interval_type  = uvc_frame_yuv_360p.bFrameIntervalType,
>                                  ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:241:29: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_frame_interval_type')
>     In file included from include/linux/byteorder/little_endian.h:5:0,
>                      from arch/x86/include/uapi/asm/byteorder.h:5,
>                      from include/asm-generic/bitops/le.h:6,
>                      from arch/x86/include/asm/bitops.h:436,
>                      from include/linux/bitops.h:68,
>                      from include/linux/kernel.h:23,
>                      from drivers/usb/gadget/legacy/webcam.c:9:
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:267:8: note: in expansion of macro 'le32_to_cpu'
>       [0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
>             ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p_dw_frame_interval[0]')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:267:8: note: in expansion of macro 'le32_to_cpu'
>       [0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
>             ^~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:273:17: error: initializer element is not constant
>        .b_length   = uvc_frame_yuv_720p.bLength,
>                      ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:273:17: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_length')
>     drivers/usb/gadget/legacy/webcam.c:274:25: error: initializer element is not constant
>        .b_descriptor_type  = uvc_frame_yuv_720p.bDescriptorType,
>                              ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:274:25: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_descriptor_type')
>     drivers/usb/gadget/legacy/webcam.c:275:28: error: initializer element is not constant
>        .b_descriptor_subtype  = uvc_frame_yuv_720p.bDescriptorSubType,
>                                 ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:275:28: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_descriptor_subtype')
>     drivers/usb/gadget/legacy/webcam.c:276:22: error: initializer element is not constant
>        .b_frame_index   = uvc_frame_yuv_720p.bFrameIndex,
>                           ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:276:22: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_frame_index')
>     drivers/usb/gadget/legacy/webcam.c:277:23: error: initializer element is not constant
>        .bm_capabilities  = uvc_frame_yuv_720p.bmCapabilities,
>                            ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:277:23: note: (near initialization for 'uvcg_frame_yuv_720p.frame.bm_capabilities')
>     In file included from include/linux/byteorder/little_endian.h:5:0,
>                      from arch/x86/include/uapi/asm/byteorder.h:5,
>                      from include/asm-generic/bitops/le.h:6,
>                      from arch/x86/include/asm/bitops.h:436,
>                      from include/linux/bitops.h:68,
>                      from include/linux/kernel.h:23,
>                      from drivers/usb/gadget/legacy/webcam.c:9:
>     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:278:16: note: in expansion of macro 'le16_to_cpu'
>        .w_width   = le16_to_cpu(uvc_frame_yuv_720p.wWidth),
>                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_width')
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:278:16: note: in expansion of macro 'le16_to_cpu'
>        .w_width   = le16_to_cpu(uvc_frame_yuv_720p.wWidth),
>                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:279:17: note: in expansion of macro 'le16_to_cpu'
>        .w_height   = le16_to_cpu(uvc_frame_yuv_720p.wHeight),
>                      ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_height')
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:279:17: note: in expansion of macro 'le16_to_cpu'
>        .w_height   = le16_to_cpu(uvc_frame_yuv_720p.wHeight),
>                      ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:280:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
>                            ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_min_bit_rate')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:280:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
>                            ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:281:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
>                            ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_bit_rate')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:281:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
>                            ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:282:37: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
>                                          ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_video_frame_buffer_size')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:282:37: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
>                                          ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:283:32: note: in expansion of macro 'le32_to_cpu'
>        .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
>                                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_default_frame_interval')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:283:32: note: in expansion of macro 'le32_to_cpu'
>        .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
>                                     ^~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:284:29: error: initializer element is not constant
>        .b_frame_interval_type  = uvc_frame_yuv_720p.bFrameIntervalType,
>                                  ^~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:284:29: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_frame_interval_type')
>     In file included from include/linux/byteorder/little_endian.h:5:0,
>                      from arch/x86/include/uapi/asm/byteorder.h:5,
>                      from include/asm-generic/bitops/le.h:6,
>                      from arch/x86/include/asm/bitops.h:436,
>                      from include/linux/bitops.h:68,
>                      from include/linux/kernel.h:23,
>                      from drivers/usb/gadget/legacy/webcam.c:9:
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:340:8: note: in expansion of macro 'le32_to_cpu'
>       [0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
>             ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[0]')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:340:8: note: in expansion of macro 'le32_to_cpu'
>       [0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
>             ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:341:8: note: in expansion of macro 'le32_to_cpu'
>       [1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
>             ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[1]')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:341:8: note: in expansion of macro 'le32_to_cpu'
>       [1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
>             ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:342:8: note: in expansion of macro 'le32_to_cpu'
>       [2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
>             ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[2]')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:342:8: note: in expansion of macro 'le32_to_cpu'
>       [2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
>             ^~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:348:17: error: initializer element is not constant
>        .b_length   = uvc_frame_mjpg_360p.bLength,
>                      ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:348:17: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_length')
>     drivers/usb/gadget/legacy/webcam.c:349:25: error: initializer element is not constant
>        .b_descriptor_type  = uvc_frame_mjpg_360p.bDescriptorType,
>                              ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:349:25: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_descriptor_type')
>     drivers/usb/gadget/legacy/webcam.c:350:28: error: initializer element is not constant
>        .b_descriptor_subtype  = uvc_frame_mjpg_360p.bDescriptorSubType,
>                                 ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:350:28: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_descriptor_subtype')
>     drivers/usb/gadget/legacy/webcam.c:351:22: error: initializer element is not constant
>        .b_frame_index   = uvc_frame_mjpg_360p.bFrameIndex,
>                           ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:351:22: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_frame_index')
>     drivers/usb/gadget/legacy/webcam.c:352:23: error: initializer element is not constant
>        .bm_capabilities  = uvc_frame_mjpg_360p.bmCapabilities,
>                            ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:352:23: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.bm_capabilities')
>     In file included from include/linux/byteorder/little_endian.h:5:0,
>                      from arch/x86/include/uapi/asm/byteorder.h:5,
>                      from include/asm-generic/bitops/le.h:6,
>                      from arch/x86/include/asm/bitops.h:436,
>                      from include/linux/bitops.h:68,
>                      from include/linux/kernel.h:23,
>                      from drivers/usb/gadget/legacy/webcam.c:9:
>     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:353:16: note: in expansion of macro 'le16_to_cpu'
>        .w_width   = le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
>                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.w_width')
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:353:16: note: in expansion of macro 'le16_to_cpu'
>        .w_width   = le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
>                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:354:17: note: in expansion of macro 'le16_to_cpu'
>        .w_height   = le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
>                      ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.w_height')
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:354:17: note: in expansion of macro 'le16_to_cpu'
>        .w_height   = le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
>                      ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:355:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
>                            ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_min_bit_rate')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:355:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
>                            ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:356:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
>                            ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_max_bit_rate')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:356:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
>                            ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:357:37: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
>                                          ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_max_video_frame_buffer_size')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:357:37: note: in expansion of macro 'le32_to_cpu'
>        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
>                                          ^~~~~~~~~~~
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:358:32: note: in expansion of macro 'le32_to_cpu'
>        .dw_default_frame_interval = le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
>                                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_default_frame_interval')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:358:32: note: in expansion of macro 'le32_to_cpu'
>        .dw_default_frame_interval = le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
>                                     ^~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:359:29: error: initializer element is not constant
>        .b_frame_interval_type  = uvc_frame_mjpg_360p.bFrameIntervalType,
>                                  ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:359:29: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_frame_interval_type')
>     In file included from include/linux/byteorder/little_endian.h:5:0,
>                      from arch/x86/include/uapi/asm/byteorder.h:5,
>                      from include/asm-generic/bitops/le.h:6,
>                      from arch/x86/include/asm/bitops.h:436,
>                      from include/linux/bitops.h:68,
>                      from include/linux/kernel.h:23,
>                      from drivers/usb/gadget/legacy/webcam.c:9:
>>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:385:8: note: in expansion of macro 'le32_to_cpu'
>       [0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
>             ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_720p_dw_frame_interval[0]')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:385:8: note: in expansion of macro 'le32_to_cpu'
>       [0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
>             ^~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:391:17: error: initializer element is not constant
>        .b_length   = uvc_frame_mjpg_720p.bLength,
>                      ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:391:17: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_length')
>     drivers/usb/gadget/legacy/webcam.c:392:25: error: initializer element is not constant
>        .b_descriptor_type  = uvc_frame_mjpg_720p.bDescriptorType,
>                              ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:392:25: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_descriptor_type')
>     drivers/usb/gadget/legacy/webcam.c:393:28: error: initializer element is not constant
>        .b_descriptor_subtype  = uvc_frame_mjpg_720p.bDescriptorSubType,
>                                 ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:393:28: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_descriptor_subtype')
>     drivers/usb/gadget/legacy/webcam.c:394:22: error: initializer element is not constant
>        .b_frame_index   = uvc_frame_mjpg_720p.bFrameIndex,
>                           ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:394:22: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_frame_index')
>     drivers/usb/gadget/legacy/webcam.c:395:23: error: initializer element is not constant
>        .bm_capabilities  = uvc_frame_mjpg_720p.bmCapabilities,
>                            ^~~~~~~~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:395:23: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.bm_capabilities')
>     In file included from include/linux/byteorder/little_endian.h:5:0,
>                      from arch/x86/include/uapi/asm/byteorder.h:5,
>                      from include/asm-generic/bitops/le.h:6,
>                      from arch/x86/include/asm/bitops.h:436,
>                      from include/linux/bitops.h:68,
>                      from include/linux/kernel.h:23,
>                      from drivers/usb/gadget/legacy/webcam.c:9:
>     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:396:16: note: in expansion of macro 'le16_to_cpu'
>        .w_width   = le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
>                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.w_width')
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:396:16: note: in expansion of macro 'le16_to_cpu'
>        .w_width   = le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
>                     ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:397:17: note: in expansion of macro 'le16_to_cpu'
>        .w_height   = le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
>                      ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.w_height')
>      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>                               ^
>     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
>      #define le16_to_cpu __le16_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:397:17: note: in expansion of macro 'le16_to_cpu'
>        .w_height   = le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
>                      ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:398:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
>                            ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.dw_min_bit_rate')
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>                               ^
>     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
>      #define le32_to_cpu __le32_to_cpu
>                          ^~~~~~~~~~~~~
>     drivers/usb/gadget/legacy/webcam.c:398:23: note: in expansion of macro 'le32_to_cpu'
>        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
>                            ^~~~~~~~~~~
>     include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
>      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> 
> 
> vim +35 include/uapi/linux/byteorder/little_endian.h
> 
> 5921e6f8809b16 David Howells 2012-10-13  15
> 5921e6f8809b16 David Howells 2012-10-13  16  #define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
> 5921e6f8809b16 David Howells 2012-10-13  17  #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
> 5921e6f8809b16 David Howells 2012-10-13  18  #define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
> 5921e6f8809b16 David Howells 2012-10-13  19  #define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
> 5921e6f8809b16 David Howells 2012-10-13  20  #define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
> 5921e6f8809b16 David Howells 2012-10-13  21  #define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
> 5921e6f8809b16 David Howells 2012-10-13  22  #define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
> 5921e6f8809b16 David Howells 2012-10-13  23  #define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
> 5921e6f8809b16 David Howells 2012-10-13  24  #define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
> 5921e6f8809b16 David Howells 2012-10-13  25  #define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
> 5921e6f8809b16 David Howells 2012-10-13  26  #define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
> 5921e6f8809b16 David Howells 2012-10-13  27  #define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
> 5921e6f8809b16 David Howells 2012-10-13  28  #define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
> 5921e6f8809b16 David Howells 2012-10-13  29  #define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
> 5921e6f8809b16 David Howells 2012-10-13  30  #define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
> 5921e6f8809b16 David Howells 2012-10-13  31  #define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
> 5921e6f8809b16 David Howells 2012-10-13  32  #define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
> 5921e6f8809b16 David Howells 2012-10-13  33  #define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
> 5921e6f8809b16 David Howells 2012-10-13  34  #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
> 5921e6f8809b16 David Howells 2012-10-13 @35  #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> 5921e6f8809b16 David Howells 2012-10-13  36  #define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
> 5921e6f8809b16 David Howells 2012-10-13  37  #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> 5921e6f8809b16 David Howells 2012-10-13  38  #define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
> 5921e6f8809b16 David Howells 2012-10-13  39  #define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
> 5921e6f8809b16 David Howells 2012-10-13  40  #define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
> 5921e6f8809b16 David Howells 2012-10-13  41  #define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
> 5921e6f8809b16 David Howells 2012-10-13  42  #define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
> 5921e6f8809b16 David Howells 2012-10-13  43  #define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
> 5921e6f8809b16 David Howells 2012-10-13  44
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-12 17:01       ` Andrzej Pietrasiewicz
@ 2023-12-12 18:22         ` Laurent Pinchart
  0 siblings, 0 replies; 17+ messages in thread
From: Laurent Pinchart @ 2023-12-12 18:22 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz
  Cc: kernel test robot, linux-usb, oe-kbuild-all, Daniel Scally,
	Greg Kroah-Hartman, Michael Grzeschik, kernel

Hi Andrzej,

On Tue, Dec 12, 2023 at 06:01:09PM +0100, Andrzej Pietrasiewicz wrote:
> W dniu 11.12.2023 o 22:53, kernel test robot pisze:
> > Hi Andrzej,
> > 
> > kernel test robot noticed the following build errors:
> > 
> > [auto build test ERROR on 33cc938e65a98f1d29d0a18403dbbee050dcad9a]
> > 
> > url:    https://github.com/intel-lab-lkp/linux/commits/Andrzej-Pietrasiewicz/usb-gadget-webcam-Make-g_webcam-loadable-again/20231211-204453
> > base:   33cc938e65a98f1d29d0a18403dbbee050dcad9a
> > patch link:    https://lore.kernel.org/r/20231211123819.76648-1-andrzej.p%40collabora.com
> > patch subject: [PATCH v3] usb: gadget: webcam: Make g_webcam loadable again
> > config: i386-randconfig-003-20231212 (https://download.01.org/0day-ci/archive/20231212/202312120517.4yhTyhYY-lkp@intel.com/config)
> > compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231212/202312120517.4yhTyhYY-lkp@intel.com/reproduce)
> 
> The reproduction steps under the above link are:
> 
>          make W=1 O=build_dir ARCH=i386 olddefconfig
>          make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/usb/gadge/legacy/
> 
> but that builds clean on my machine. I had to:
> 
> make CC=gcc-7 W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/usb/gadget/legacy/
> 
> to actually see the below errors.
> 
> Using a modern compiler there are no errors, so I'm wondering if the errors
> reported are maybe a problem of an old compiler rather then the submitted patch?

They may be, but gcc 7 is still officially supported by the kernel (see
Documentation/process/changes.rst, the minimum required gcc version is
v5.1), so the issue needs to be fixed.

> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202312120517.4yhTyhYY-lkp@intel.com/
> > 
> > All errors (new ones prefixed by >>):
> > 
> >     In file included from include/linux/byteorder/little_endian.h:5:0,
> >                      from arch/x86/include/uapi/asm/byteorder.h:5,
> >                      from include/asm-generic/bitops/le.h:6,
> >                      from arch/x86/include/asm/bitops.h:436,
> >                      from include/linux/bitops.h:68,
> >                      from include/linux/kernel.h:23,
> >                      from drivers/usb/gadget/legacy/webcam.c:9:
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:222:8: note: in expansion of macro 'le32_to_cpu'
> >       [0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
> >             ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[0]')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:222:8: note: in expansion of macro 'le32_to_cpu'
> >       [0] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[0]),
> >             ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:223:8: note: in expansion of macro 'le32_to_cpu'
> >       [1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
> >             ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[1]')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:223:8: note: in expansion of macro 'le32_to_cpu'
> >       [1] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[1]),
> >             ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:224:8: note: in expansion of macro 'le32_to_cpu'
> >       [2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
> >             ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p_dw_frame_interval[2]')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:224:8: note: in expansion of macro 'le32_to_cpu'
> >       [2] = le32_to_cpu(uvc_frame_yuv_360p.dwFrameInterval[2]),
> >             ^~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:230:17: error: initializer element is not constant
> >        .b_length   = uvc_frame_yuv_360p.bLength,
> >                      ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:230:17: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_length')
> >     drivers/usb/gadget/legacy/webcam.c:231:25: error: initializer element is not constant
> >        .b_descriptor_type  = uvc_frame_yuv_360p.bDescriptorType,
> >                              ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:231:25: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_descriptor_type')
> >     drivers/usb/gadget/legacy/webcam.c:232:28: error: initializer element is not constant
> >        .b_descriptor_subtype  = uvc_frame_yuv_360p.bDescriptorSubType,
> >                                 ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:232:28: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_descriptor_subtype')
> >     drivers/usb/gadget/legacy/webcam.c:233:22: error: initializer element is not constant
> >        .b_frame_index   = uvc_frame_yuv_360p.bFrameIndex,
> >                           ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:233:22: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_frame_index')
> >     drivers/usb/gadget/legacy/webcam.c:234:23: error: initializer element is not constant
> >        .bm_capabilities  = uvc_frame_yuv_360p.bmCapabilities,
> >                            ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:234:23: note: (near initialization for 'uvcg_frame_yuv_360p.frame.bm_capabilities')
> >     In file included from include/linux/byteorder/little_endian.h:5:0,
> >                      from arch/x86/include/uapi/asm/byteorder.h:5,
> >                      from include/asm-generic/bitops/le.h:6,
> >                      from arch/x86/include/asm/bitops.h:436,
> >                      from include/linux/bitops.h:68,
> >                      from include/linux/kernel.h:23,
> >                      from drivers/usb/gadget/legacy/webcam.c:9:
> >     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:235:16: note: in expansion of macro 'le16_to_cpu'
> >        .w_width   = le16_to_cpu(uvc_frame_yuv_360p.wWidth),
> >                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_width')
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:235:16: note: in expansion of macro 'le16_to_cpu'
> >        .w_width   = le16_to_cpu(uvc_frame_yuv_360p.wWidth),
> >                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:236:17: note: in expansion of macro 'le16_to_cpu'
> >        .w_height   = le16_to_cpu(uvc_frame_yuv_360p.wHeight),
> >                      ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.w_height')
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:236:17: note: in expansion of macro 'le16_to_cpu'
> >        .w_height   = le16_to_cpu(uvc_frame_yuv_360p.wHeight),
> >                      ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:237:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
> >                            ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_min_bit_rate')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:237:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMinBitRate),
> >                            ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:238:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
> >                            ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_bit_rate')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:238:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_360p.dwMaxBitRate),
> >                            ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:239:37: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
> >                                          ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_max_video_frame_buffer_size')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:239:37: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_360p.dwMaxVideoFrameBufferSize),
> >                                          ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:240:32: note: in expansion of macro 'le32_to_cpu'
> >        .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
> >                                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_360p.frame.dw_default_frame_interval')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:240:32: note: in expansion of macro 'le32_to_cpu'
> >        .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_360p.dwDefaultFrameInterval),
> >                                     ^~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:241:29: error: initializer element is not constant
> >        .b_frame_interval_type  = uvc_frame_yuv_360p.bFrameIntervalType,
> >                                  ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:241:29: note: (near initialization for 'uvcg_frame_yuv_360p.frame.b_frame_interval_type')
> >     In file included from include/linux/byteorder/little_endian.h:5:0,
> >                      from arch/x86/include/uapi/asm/byteorder.h:5,
> >                      from include/asm-generic/bitops/le.h:6,
> >                      from arch/x86/include/asm/bitops.h:436,
> >                      from include/linux/bitops.h:68,
> >                      from include/linux/kernel.h:23,
> >                      from drivers/usb/gadget/legacy/webcam.c:9:
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:267:8: note: in expansion of macro 'le32_to_cpu'
> >       [0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
> >             ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p_dw_frame_interval[0]')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:267:8: note: in expansion of macro 'le32_to_cpu'
> >       [0] = le32_to_cpu(uvc_frame_yuv_720p.dwFrameInterval[0]),
> >             ^~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:273:17: error: initializer element is not constant
> >        .b_length   = uvc_frame_yuv_720p.bLength,
> >                      ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:273:17: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_length')
> >     drivers/usb/gadget/legacy/webcam.c:274:25: error: initializer element is not constant
> >        .b_descriptor_type  = uvc_frame_yuv_720p.bDescriptorType,
> >                              ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:274:25: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_descriptor_type')
> >     drivers/usb/gadget/legacy/webcam.c:275:28: error: initializer element is not constant
> >        .b_descriptor_subtype  = uvc_frame_yuv_720p.bDescriptorSubType,
> >                                 ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:275:28: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_descriptor_subtype')
> >     drivers/usb/gadget/legacy/webcam.c:276:22: error: initializer element is not constant
> >        .b_frame_index   = uvc_frame_yuv_720p.bFrameIndex,
> >                           ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:276:22: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_frame_index')
> >     drivers/usb/gadget/legacy/webcam.c:277:23: error: initializer element is not constant
> >        .bm_capabilities  = uvc_frame_yuv_720p.bmCapabilities,
> >                            ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:277:23: note: (near initialization for 'uvcg_frame_yuv_720p.frame.bm_capabilities')
> >     In file included from include/linux/byteorder/little_endian.h:5:0,
> >                      from arch/x86/include/uapi/asm/byteorder.h:5,
> >                      from include/asm-generic/bitops/le.h:6,
> >                      from arch/x86/include/asm/bitops.h:436,
> >                      from include/linux/bitops.h:68,
> >                      from include/linux/kernel.h:23,
> >                      from drivers/usb/gadget/legacy/webcam.c:9:
> >     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:278:16: note: in expansion of macro 'le16_to_cpu'
> >        .w_width   = le16_to_cpu(uvc_frame_yuv_720p.wWidth),
> >                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_width')
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:278:16: note: in expansion of macro 'le16_to_cpu'
> >        .w_width   = le16_to_cpu(uvc_frame_yuv_720p.wWidth),
> >                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:279:17: note: in expansion of macro 'le16_to_cpu'
> >        .w_height   = le16_to_cpu(uvc_frame_yuv_720p.wHeight),
> >                      ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.w_height')
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:279:17: note: in expansion of macro 'le16_to_cpu'
> >        .w_height   = le16_to_cpu(uvc_frame_yuv_720p.wHeight),
> >                      ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:280:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
> >                            ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_min_bit_rate')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:280:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMinBitRate),
> >                            ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:281:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
> >                            ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_bit_rate')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:281:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_yuv_720p.dwMaxBitRate),
> >                            ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:282:37: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
> >                                          ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_max_video_frame_buffer_size')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:282:37: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_yuv_720p.dwMaxVideoFrameBufferSize),
> >                                          ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:283:32: note: in expansion of macro 'le32_to_cpu'
> >        .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
> >                                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_yuv_720p.frame.dw_default_frame_interval')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:283:32: note: in expansion of macro 'le32_to_cpu'
> >        .dw_default_frame_interval = le32_to_cpu(uvc_frame_yuv_720p.dwDefaultFrameInterval),
> >                                     ^~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:284:29: error: initializer element is not constant
> >        .b_frame_interval_type  = uvc_frame_yuv_720p.bFrameIntervalType,
> >                                  ^~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:284:29: note: (near initialization for 'uvcg_frame_yuv_720p.frame.b_frame_interval_type')
> >     In file included from include/linux/byteorder/little_endian.h:5:0,
> >                      from arch/x86/include/uapi/asm/byteorder.h:5,
> >                      from include/asm-generic/bitops/le.h:6,
> >                      from arch/x86/include/asm/bitops.h:436,
> >                      from include/linux/bitops.h:68,
> >                      from include/linux/kernel.h:23,
> >                      from drivers/usb/gadget/legacy/webcam.c:9:
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:340:8: note: in expansion of macro 'le32_to_cpu'
> >       [0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
> >             ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[0]')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:340:8: note: in expansion of macro 'le32_to_cpu'
> >       [0] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[0]),
> >             ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:341:8: note: in expansion of macro 'le32_to_cpu'
> >       [1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
> >             ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[1]')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:341:8: note: in expansion of macro 'le32_to_cpu'
> >       [1] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[1]),
> >             ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:342:8: note: in expansion of macro 'le32_to_cpu'
> >       [2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
> >             ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p_dw_frame_interval[2]')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:342:8: note: in expansion of macro 'le32_to_cpu'
> >       [2] = le32_to_cpu(uvc_frame_mjpg_360p.dwFrameInterval[2]),
> >             ^~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:348:17: error: initializer element is not constant
> >        .b_length   = uvc_frame_mjpg_360p.bLength,
> >                      ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:348:17: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_length')
> >     drivers/usb/gadget/legacy/webcam.c:349:25: error: initializer element is not constant
> >        .b_descriptor_type  = uvc_frame_mjpg_360p.bDescriptorType,
> >                              ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:349:25: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_descriptor_type')
> >     drivers/usb/gadget/legacy/webcam.c:350:28: error: initializer element is not constant
> >        .b_descriptor_subtype  = uvc_frame_mjpg_360p.bDescriptorSubType,
> >                                 ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:350:28: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_descriptor_subtype')
> >     drivers/usb/gadget/legacy/webcam.c:351:22: error: initializer element is not constant
> >        .b_frame_index   = uvc_frame_mjpg_360p.bFrameIndex,
> >                           ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:351:22: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_frame_index')
> >     drivers/usb/gadget/legacy/webcam.c:352:23: error: initializer element is not constant
> >        .bm_capabilities  = uvc_frame_mjpg_360p.bmCapabilities,
> >                            ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:352:23: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.bm_capabilities')
> >     In file included from include/linux/byteorder/little_endian.h:5:0,
> >                      from arch/x86/include/uapi/asm/byteorder.h:5,
> >                      from include/asm-generic/bitops/le.h:6,
> >                      from arch/x86/include/asm/bitops.h:436,
> >                      from include/linux/bitops.h:68,
> >                      from include/linux/kernel.h:23,
> >                      from drivers/usb/gadget/legacy/webcam.c:9:
> >     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:353:16: note: in expansion of macro 'le16_to_cpu'
> >        .w_width   = le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
> >                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.w_width')
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:353:16: note: in expansion of macro 'le16_to_cpu'
> >        .w_width   = le16_to_cpu(uvc_frame_mjpg_360p.wWidth),
> >                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:354:17: note: in expansion of macro 'le16_to_cpu'
> >        .w_height   = le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
> >                      ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.w_height')
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:354:17: note: in expansion of macro 'le16_to_cpu'
> >        .w_height   = le16_to_cpu(uvc_frame_mjpg_360p.wHeight),
> >                      ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:355:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
> >                            ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_min_bit_rate')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:355:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMinBitRate),
> >                            ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:356:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
> >                            ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_max_bit_rate')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:356:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_bit_rate  = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxBitRate),
> >                            ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:357:37: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
> >                                          ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_max_video_frame_buffer_size')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:357:37: note: in expansion of macro 'le32_to_cpu'
> >        .dw_max_video_frame_buffer_size = le32_to_cpu(uvc_frame_mjpg_360p.dwMaxVideoFrameBufferSize),
> >                                          ^~~~~~~~~~~
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:358:32: note: in expansion of macro 'le32_to_cpu'
> >        .dw_default_frame_interval = le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
> >                                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.dw_default_frame_interval')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:358:32: note: in expansion of macro 'le32_to_cpu'
> >        .dw_default_frame_interval = le32_to_cpu(uvc_frame_mjpg_360p.dwDefaultFrameInterval),
> >                                     ^~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:359:29: error: initializer element is not constant
> >        .b_frame_interval_type  = uvc_frame_mjpg_360p.bFrameIntervalType,
> >                                  ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:359:29: note: (near initialization for 'uvcg_frame_mjpeg_360p.frame.b_frame_interval_type')
> >     In file included from include/linux/byteorder/little_endian.h:5:0,
> >                      from arch/x86/include/uapi/asm/byteorder.h:5,
> >                      from include/asm-generic/bitops/le.h:6,
> >                      from arch/x86/include/asm/bitops.h:436,
> >                      from include/linux/bitops.h:68,
> >                      from include/linux/kernel.h:23,
> >                      from drivers/usb/gadget/legacy/webcam.c:9:
> >>> include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:385:8: note: in expansion of macro 'le32_to_cpu'
> >       [0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
> >             ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_720p_dw_frame_interval[0]')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:385:8: note: in expansion of macro 'le32_to_cpu'
> >       [0] = le32_to_cpu(uvc_frame_mjpg_720p.dwFrameInterval[0]),
> >             ^~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:391:17: error: initializer element is not constant
> >        .b_length   = uvc_frame_mjpg_720p.bLength,
> >                      ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:391:17: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_length')
> >     drivers/usb/gadget/legacy/webcam.c:392:25: error: initializer element is not constant
> >        .b_descriptor_type  = uvc_frame_mjpg_720p.bDescriptorType,
> >                              ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:392:25: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_descriptor_type')
> >     drivers/usb/gadget/legacy/webcam.c:393:28: error: initializer element is not constant
> >        .b_descriptor_subtype  = uvc_frame_mjpg_720p.bDescriptorSubType,
> >                                 ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:393:28: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_descriptor_subtype')
> >     drivers/usb/gadget/legacy/webcam.c:394:22: error: initializer element is not constant
> >        .b_frame_index   = uvc_frame_mjpg_720p.bFrameIndex,
> >                           ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:394:22: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.b_frame_index')
> >     drivers/usb/gadget/legacy/webcam.c:395:23: error: initializer element is not constant
> >        .bm_capabilities  = uvc_frame_mjpg_720p.bmCapabilities,
> >                            ^~~~~~~~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:395:23: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.bm_capabilities')
> >     In file included from include/linux/byteorder/little_endian.h:5:0,
> >                      from arch/x86/include/uapi/asm/byteorder.h:5,
> >                      from include/asm-generic/bitops/le.h:6,
> >                      from arch/x86/include/asm/bitops.h:436,
> >                      from include/linux/bitops.h:68,
> >                      from include/linux/kernel.h:23,
> >                      from drivers/usb/gadget/legacy/webcam.c:9:
> >     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:396:16: note: in expansion of macro 'le16_to_cpu'
> >        .w_width   = le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
> >                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.w_width')
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:396:16: note: in expansion of macro 'le16_to_cpu'
> >        .w_width   = le16_to_cpu(uvc_frame_mjpg_720p.wWidth),
> >                     ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: error: initializer element is not constant
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:397:17: note: in expansion of macro 'le16_to_cpu'
> >        .w_height   = le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
> >                      ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:37:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.w_height')
> >      #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:91:21: note: in expansion of macro '__le16_to_cpu'
> >      #define le16_to_cpu __le16_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:397:17: note: in expansion of macro 'le16_to_cpu'
> >        .w_height   = le16_to_cpu(uvc_frame_mjpg_720p.wHeight),
> >                      ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:398:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
> >                            ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: note: (near initialization for 'uvcg_frame_mjpeg_720p.frame.dw_min_bit_rate')
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> >                               ^
> >     include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
> >      #define le32_to_cpu __le32_to_cpu
> >                          ^~~~~~~~~~~~~
> >     drivers/usb/gadget/legacy/webcam.c:398:23: note: in expansion of macro 'le32_to_cpu'
> >        .dw_min_bit_rate  = le32_to_cpu(uvc_frame_mjpg_720p.dwMinBitRate),
> >                            ^~~~~~~~~~~
> >     include/uapi/linux/byteorder/little_endian.h:35:26: error: initializer element is not constant
> >      #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> > 
> > 
> > vim +35 include/uapi/linux/byteorder/little_endian.h
> > 
> > 5921e6f8809b16 David Howells 2012-10-13  15
> > 5921e6f8809b16 David Howells 2012-10-13  16  #define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
> > 5921e6f8809b16 David Howells 2012-10-13  17  #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  18  #define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
> > 5921e6f8809b16 David Howells 2012-10-13  19  #define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  20  #define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  21  #define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  22  #define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  23  #define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  24  #define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  25  #define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  26  #define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
> > 5921e6f8809b16 David Howells 2012-10-13  27  #define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  28  #define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
> > 5921e6f8809b16 David Howells 2012-10-13  29  #define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  30  #define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
> > 5921e6f8809b16 David Howells 2012-10-13  31  #define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  32  #define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  33  #define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  34  #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
> > 5921e6f8809b16 David Howells 2012-10-13 @35  #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  36  #define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  37  #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  38  #define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
> > 5921e6f8809b16 David Howells 2012-10-13  39  #define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  40  #define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
> > 5921e6f8809b16 David Howells 2012-10-13  41  #define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  42  #define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
> > 5921e6f8809b16 David Howells 2012-10-13  43  #define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
> > 5921e6f8809b16 David Howells 2012-10-13  44

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v4] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-11 12:38   ` [PATCH v3] " Andrzej Pietrasiewicz
  2023-12-11 20:47     ` kernel test robot
  2023-12-11 21:53     ` kernel test robot
@ 2023-12-12 19:05     ` Andrzej Pietrasiewicz
  2023-12-14  6:40       ` Andrzej Pietrasiewicz
                         ` (2 more replies)
  2 siblings, 3 replies; 17+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-12-12 19:05 UTC (permalink / raw)
  To: linux-usb
  Cc: Laurent Pinchart, Daniel Scally, Greg Kroah-Hartman,
	Michael Grzeschik, Andrzej Pietrasiewicz, kernel

commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")

has rendered the precomposed (aka legacy) webcam gadget unloadable.

uvc_alloc() since then has depended on certain config groups being
available in configfs tree related to the UVC function. However, legacy
gadgets do not create anything in configfs, so uvc_alloc() must fail
with -ENOENT no matter what.

This patch mimics the required configfs hierarchy to satisfy the code which
inspects formats and frames found in uvcg_streaming_header.

This has been tested with guvcview on the host side, using vivid as a
source of video stream on the device side and using the userspace program
found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
---
v3..v4:
- silenced "initializer element is not constant" warnings on old
  compiles (created and used a bunch of #defines instead of referring
  to a static constr struct /members/, which in the C language is not
  considered const)

v2..v3:
- fixed another typo (actually use uvcg_frame_mjpeg_720p where it should
  be used instead of its 360p counterpart)
- eliminated sparse warnings by reverting the effect of cpu_to_le[16|32]
  while assigning to uvcg_frame members

v1..v2:
- fixed a typo (missing character) in one of uvcg_frame_mjpeg_720p's members

 drivers/usb/gadget/function/f_uvc.c |  45 ++--
 drivers/usb/gadget/function/u_uvc.h |   6 +
 drivers/usb/gadget/legacy/webcam.c  | 333 +++++++++++++++++++++-------
 3 files changed, 284 insertions(+), 100 deletions(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 786379f1b7b7..3b46de85ca01 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -960,7 +960,8 @@ static void uvc_free(struct usb_function *f)
 	struct uvc_device *uvc = to_uvc(f);
 	struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts,
 					       func_inst);
-	config_item_put(&uvc->header->item);
+	if (!opts->header)
+		config_item_put(&uvc->header->item);
 	--opts->refcnt;
 	kfree(uvc);
 }
@@ -1052,25 +1053,29 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
 	uvc->desc.hs_streaming = opts->hs_streaming;
 	uvc->desc.ss_streaming = opts->ss_streaming;
 
-	streaming = config_group_find_item(&opts->func_inst.group, "streaming");
-	if (!streaming)
-		goto err_config;
-
-	header = config_group_find_item(to_config_group(streaming), "header");
-	config_item_put(streaming);
-	if (!header)
-		goto err_config;
-
-	h = config_group_find_item(to_config_group(header), "h");
-	config_item_put(header);
-	if (!h)
-		goto err_config;
-
-	uvc->header = to_uvcg_streaming_header(h);
-	if (!uvc->header->linked) {
-		mutex_unlock(&opts->lock);
-		kfree(uvc);
-		return ERR_PTR(-EBUSY);
+	if (opts->header) {
+		uvc->header = opts->header;
+	} else {
+		streaming = config_group_find_item(&opts->func_inst.group, "streaming");
+		if (!streaming)
+			goto err_config;
+
+		header = config_group_find_item(to_config_group(streaming), "header");
+		config_item_put(streaming);
+		if (!header)
+			goto err_config;
+
+		h = config_group_find_item(to_config_group(header), "h");
+		config_item_put(header);
+		if (!h)
+			goto err_config;
+
+		uvc->header = to_uvcg_streaming_header(h);
+		if (!uvc->header->linked) {
+			mutex_unlock(&opts->lock);
+			kfree(uvc);
+			return ERR_PTR(-EBUSY);
+		}
 	}
 
 	uvc->desc.extension_units = &opts->extension_units;
diff --git a/drivers/usb/gadget/function/u_uvc.h b/drivers/usb/gadget/function/u_uvc.h
index 1ce58f61253c..3ac392cbb779 100644
--- a/drivers/usb/gadget/function/u_uvc.h
+++ b/drivers/usb/gadget/function/u_uvc.h
@@ -98,6 +98,12 @@ struct f_uvc_opts {
 	 */
 	struct mutex			lock;
 	int				refcnt;
+
+	/*
+	 * Only for legacy gadget. Shall be NULL for configfs-composed gadgets,
+	 * which is guaranteed by alloc_inst implementation of f_uvc doing kzalloc.
+	 */
+	struct uvcg_streaming_header	*header;
 };
 
 #endif /* U_UVC_H */
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
index c06dd1af7a0c..c395438d3978 100644
--- a/drivers/usb/gadget/legacy/webcam.c
+++ b/drivers/usb/gadget/legacy/webcam.c
@@ -12,6 +12,7 @@
 #include <linux/usb/video.h>
 
 #include "u_uvc.h"
+#include "uvc_configfs.h"
 
 USB_GADGET_COMPOSITE_OPTIONS();
 
@@ -84,8 +85,6 @@ static struct usb_device_descriptor webcam_device_descriptor = {
 	.bNumConfigurations	= 0, /* dynamic */
 };
 
-DECLARE_UVC_HEADER_DESCRIPTOR(1);
-
 static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
 	.bLength		= UVC_DT_HEADER_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -158,43 +157,112 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
 	.bmaControls[1][0]	= 4,
 };
 
-static const struct uvc_format_uncompressed uvc_format_yuv = {
-	.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
-	.bFormatIndex		= 1,
-	.bNumFrameDescriptors	= 2,
-	.guidFormat		=
-		{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
-		 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71},
-	.bBitsPerPixel		= 16,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static const struct uvcg_color_matching uvcg_color_matching = {
+	.desc = {
+		.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_COLORFORMAT,
+		.bColorPrimaries	= 1,
+		.bTransferCharacteristics	= 1,
+		.bMatrixCoefficients	= 4,
+	},
+};
+
+static struct uvcg_uncompressed uvcg_format_yuv = {
+	.fmt = {
+		.type			= UVCG_UNCOMPRESSED,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
+		.bFormatIndex		= 1,
+		.bNumFrameDescriptors	= 2,
+		.guidFormat		= {
+			'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
+			 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
+		},
+		.bBitsPerPixel		= 16,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_yuv = {
+	.fmt = &uvcg_format_yuv.fmt,
 };
 
 DECLARE_UVC_FRAME_UNCOMPRESSED(1);
 DECLARE_UVC_FRAME_UNCOMPRESSED(3);
 
+#define UVCG_WIDTH_360P			640
+#define UVCG_HEIGHT_360P		360
+#define UVCG_MIN_BITRATE_360P		18432000
+#define UVCG_MAX_BITRATE_360P		55296000
+#define UVCG_MAX_VIDEO_FB_SZ_360P	460800
+#define UVCG_FRM_INTERV_0_360P		666666
+#define UVCG_FRM_INTERV_1_360P		1000000
+#define UVCG_FRM_INTERV_2_360P		5000000
+#define UVCG_DEFAULT_FRM_INTERV_360P	UVCG_FRM_INTERV_0_360P
+
 static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
 	.bDescriptorSubType	= UVC_VS_FRAME_UNCOMPRESSED,
 	.bFrameIndex		= 1,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(640),
-	.wHeight		= cpu_to_le16(360),
-	.dwMinBitRate		= cpu_to_le32(18432000),
-	.dwMaxBitRate		= cpu_to_le32(55296000),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(460800),
-	.dwDefaultFrameInterval	= cpu_to_le32(666666),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_360P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_360P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_360P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_360P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_360P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_360P),
 	.bFrameIntervalType	= 3,
-	.dwFrameInterval[0]	= cpu_to_le32(666666),
-	.dwFrameInterval[1]	= cpu_to_le32(1000000),
-	.dwFrameInterval[2]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_360P),
+	.dwFrameInterval[1]	= cpu_to_le32(UVCG_FRM_INTERV_1_360P),
+	.dwFrameInterval[2]	= cpu_to_le32(UVCG_FRM_INTERV_2_360P),
+};
+
+static u32 uvcg_frame_yuv_360p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_360P,
+	[1] = UVCG_FRM_INTERV_1_360P,
+	[2] = UVCG_FRM_INTERV_2_360P,
+};
+
+static const struct uvcg_frame uvcg_frame_yuv_360p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_UNCOMPRESSED,
+		.b_frame_index			= 1,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_360P,
+		.w_height			= UVCG_HEIGHT_360P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_360P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_360P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_360P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_360P,
+		.b_frame_interval_type		= 3,
+	},
+	.dw_frame_interval	= uvcg_frame_yuv_360p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_360p,
 };
+#define UVCG_WIDTH_720P			1280
+#define UVCG_HEIGHT_720P		720
+#define UVCG_MIN_BITRATE_720P		29491200
+#define UVCG_MAX_BITRATE_720P		29491200
+#define UVCG_MAX_VIDEO_FB_SZ_720P	1843200
+#define UVCG_FRM_INTERV_0_720P		5000000
+#define UVCG_DEFAULT_FRM_INTERV_720P	UVCG_FRM_INTERV_0_720P
 
 static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
@@ -202,28 +270,66 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_UNCOMPRESSED,
 	.bFrameIndex		= 2,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(1280),
-	.wHeight		= cpu_to_le16(720),
-	.dwMinBitRate		= cpu_to_le32(29491200),
-	.dwMaxBitRate		= cpu_to_le32(29491200),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(1843200),
-	.dwDefaultFrameInterval	= cpu_to_le32(5000000),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_720P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_720P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_720P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_720P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_720P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_720P),
 	.bFrameIntervalType	= 1,
-	.dwFrameInterval[0]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_720P),
 };
 
-static const struct uvc_format_mjpeg uvc_format_mjpg = {
-	.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
-	.bFormatIndex		= 2,
-	.bNumFrameDescriptors	= 2,
-	.bmFlags		= 0,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static u32 uvcg_frame_yuv_720p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_720P,
+};
+
+static const struct uvcg_frame uvcg_frame_yuv_720p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_UNCOMPRESSED,
+		.b_frame_index			= 2,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_720P,
+		.w_height			= UVCG_HEIGHT_720P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_720P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_720P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_720P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_720P,
+		.b_frame_interval_type		= 1,
+	},
+	.dw_frame_interval	= uvcg_frame_yuv_720p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_720p,
+};
+
+static struct uvcg_mjpeg uvcg_format_mjpeg = {
+	.fmt = {
+		.type			= UVCG_MJPEG,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
+		.bFormatIndex		= 2,
+		.bNumFrameDescriptors	= 2,
+		.bmFlags		= 0,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_mjpeg = {
+	.fmt = &uvcg_format_mjpeg.fmt,
 };
 
 DECLARE_UVC_FRAME_MJPEG(1);
@@ -235,16 +341,45 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_MJPEG,
 	.bFrameIndex		= 1,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(640),
-	.wHeight		= cpu_to_le16(360),
-	.dwMinBitRate		= cpu_to_le32(18432000),
-	.dwMaxBitRate		= cpu_to_le32(55296000),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(460800),
-	.dwDefaultFrameInterval	= cpu_to_le32(666666),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_360P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_360P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_360P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_360P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_360P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_360P),
 	.bFrameIntervalType	= 3,
-	.dwFrameInterval[0]	= cpu_to_le32(666666),
-	.dwFrameInterval[1]	= cpu_to_le32(1000000),
-	.dwFrameInterval[2]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_360P),
+	.dwFrameInterval[1]	= cpu_to_le32(UVCG_FRM_INTERV_1_360P),
+	.dwFrameInterval[2]	= cpu_to_le32(UVCG_FRM_INTERV_2_360P),
+};
+
+static u32 uvcg_frame_mjpeg_360p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_360P,
+	[1] = UVCG_FRM_INTERV_1_360P,
+	[2] = UVCG_FRM_INTERV_2_360P,
+};
+
+static const struct uvcg_frame uvcg_frame_mjpeg_360p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_MJPEG_SIZE(3),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_MJPEG,
+		.b_frame_index			= 1,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_360P,
+		.w_height			= UVCG_HEIGHT_360P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_360P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_360P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_360P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_360P,
+		.b_frame_interval_type		= 3,
+	},
+	.dw_frame_interval	= uvcg_frame_mjpeg_360p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
 };
 
 static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
@@ -253,23 +388,44 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_MJPEG,
 	.bFrameIndex		= 2,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(1280),
-	.wHeight		= cpu_to_le16(720),
-	.dwMinBitRate		= cpu_to_le32(29491200),
-	.dwMaxBitRate		= cpu_to_le32(29491200),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(1843200),
-	.dwDefaultFrameInterval	= cpu_to_le32(5000000),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_720P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_720P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_720P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_720P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_720P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_720P),
 	.bFrameIntervalType	= 1,
-	.dwFrameInterval[0]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_720P),
 };
 
-static const struct uvc_color_matching_descriptor uvc_color_matching = {
-	.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_COLORFORMAT,
-	.bColorPrimaries	= 1,
-	.bTransferCharacteristics	= 1,
-	.bMatrixCoefficients	= 4,
+static u32 uvcg_frame_mjpeg_720p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_720P,
+};
+
+static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_MJPEG_SIZE(1),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_MJPEG,
+		.b_frame_index			= 2,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_720P,
+		.w_height			= UVCG_HEIGHT_720P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_720P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_720P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_720P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_720P,
+		.b_frame_interval_type		= 1,
+	},
+	.dw_frame_interval	= uvcg_frame_mjpeg_720p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_720p,
+};
+
+static struct uvcg_streaming_header uvcg_streaming_header = {
 };
 
 static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
@@ -290,40 +446,40 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
 
 static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
@@ -387,6 +543,23 @@ webcam_bind(struct usb_composite_dev *cdev)
 	uvc_opts->hs_streaming = uvc_hs_streaming_cls;
 	uvc_opts->ss_streaming = uvc_ss_streaming_cls;
 
+	INIT_LIST_HEAD(&uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_360p.entry, &uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_720p.entry, &uvcg_format_yuv.fmt.frames);
+	uvcg_format_yuv.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_360p.entry, &uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_720p.entry, &uvcg_format_mjpeg.fmt.frames);
+	uvcg_format_mjpeg.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_yuv.entry, &uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_mjpeg.entry, &uvcg_streaming_header.formats);
+	uvcg_streaming_header.num_fmt = 2;
+
+	uvc_opts->header = &uvcg_streaming_header;
+
 	/* Allocate string descriptor numbers ... note that string contents
 	 * can be overridden by the composite_dev glue.
 	 */

base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a
prerequisite-patch-id: 5ebe1b40adede82d8413ff25a9e69f3e6b9fdfa6
prerequisite-patch-id: 0525706498a65e3ffe25cb6ee19462da9ae6f5b5
prerequisite-patch-id: 087583ddbd1db16eb07a5ae74683d781c4392470
prerequisite-patch-id: 8f587de5eda5b35253bd5a320344a0797fe5812f
prerequisite-patch-id: 3a134c208a4115c8bec97b531b6a37a1d2d000b4
prerequisite-patch-id: c5d30c7201e25a4b6871cb929a60f241cb05797f
prerequisite-patch-id: 3285282277d41ea3b0e1cca7ca837b14885097f3
prerequisite-patch-id: 22ca214aeaf6f04f0531e3455fef87184eccdde1
prerequisite-patch-id: f31cc83a77a0d486d55d3e607d8178e41cf1b4ad
prerequisite-patch-id: da38777c59634a9591d32ec5bee366aae97fe701
prerequisite-patch-id: d017ca64e136cad7f4bb546145c76b3e82fe8b33
prerequisite-patch-id: 1002dc7ce0ffcc8d26e04b5c6b05f8d42f26b18a
prerequisite-patch-id: 16194f0144231ee5271f304dee3a2e46d2f96e09
prerequisite-patch-id: 768e6a55c3fbdf56195651f44256f2ca767f05fc
prerequisite-patch-id: 1b0d80ad510477bfd7cae665d0b2fdee2d7adcd9
prerequisite-patch-id: 43ae7e718ce9ff48157ad345bf2458775ee02717
prerequisite-patch-id: e0ed8dd4046367ebc1a6b3f1e9b9b3ee3e492438
prerequisite-patch-id: dd0b10cc033047abc126a27c0243d9e26d3c90fc
prerequisite-patch-id: e6c77a99be80409208e918324bd8b9eb024034c8
prerequisite-patch-id: fc0130264f43d85a1fecb2b1305b0c8e5ebcd667
prerequisite-patch-id: 8341d7d87c9378253185bc434e25a5352160400f
prerequisite-patch-id: 218344fb2343d2e953c8a10078faba61f7392c53
prerequisite-patch-id: f6bc3c18ff84c999be7261a7ad953bf305e6077b
prerequisite-patch-id: a06c7bfa391bfe7edf0949a09aa59039830b01db
prerequisite-patch-id: 4fe63dcc7296048a67c7bace6e91a5bf65e258cc
prerequisite-patch-id: aa1b577aaff5746a909b0dcd2aaab32a2320ce28
prerequisite-patch-id: ba3bf3a391568fe24f46c8a56557f01fa1158fb8
prerequisite-patch-id: a65e382e873bda296e420417eeaea4514e6f6e30
prerequisite-patch-id: b549869029b0ecfeaa4ac9cf9dbb95169adf40d0
prerequisite-patch-id: 46f07ae39fa155cf7ee6ec2deacb8e9f27879c6d
prerequisite-patch-id: 3566df1640815b8c714963145f8f115a76316cee
prerequisite-patch-id: 59b788a64fdcfa17787bda128dab0be70cc8f679
prerequisite-patch-id: b05bdee532130860518aa7a6d1925e65ff9a88fc
prerequisite-patch-id: 656d949909e1c1551cc37786e317cc7488849ef4
prerequisite-patch-id: db84418e8f8d46959ca7f6a8e99b0857bca749b5
prerequisite-patch-id: 55f11b5d4652247d27c58c9c0ebc9156f0583e78
prerequisite-patch-id: afcebd8daeb0b39070825414c57560870b6f97a6
prerequisite-patch-id: 85c10ddc63c4529a4abc2b24c023ab1621f70fd1
prerequisite-patch-id: 1d95969cdc8ed6a8954b9535ba2bf0da4d5e3ef1
prerequisite-patch-id: 37db59c354a4a1afbf685c493683de8cd7748643
prerequisite-patch-id: d26d91821b15d36f0be4639b56b0d5771b7440a0
prerequisite-patch-id: 6a63c4c984aa8a80542b88c99042b18384003616
prerequisite-patch-id: d47b4bf169d4f601203c392222d8563804369571
prerequisite-patch-id: 0945d6082543ec592f7cf8d0dcc581632e926151
prerequisite-patch-id: 760bd00596ed56f492c3e6429ceae6098ad8aee2
prerequisite-patch-id: 16469ac127f0ecea0c9f2b9f1a605a389aeadb3e
prerequisite-patch-id: 7185e089f312a2f437c605082fffbe21dbbff71b
prerequisite-patch-id: 0ece40c6ba1f7c58f6d86ff3718af8464e48c427
prerequisite-patch-id: 4ee3c906e49cd213e6f562aa5f47bb66eb8bbc55
prerequisite-patch-id: da64a389dda13fcc5fd808eab8f7727c2106f300
prerequisite-patch-id: 11bed9a851381377e1cdca036d087188d8969a52
prerequisite-patch-id: e03ccbc770ece8b6ca19d326d8132c980ca7dc74
prerequisite-patch-id: 8cc39b7304152031add2b9183a81bae9d1f536bc
prerequisite-patch-id: a35812a89502d58aede4389d89fd8bdf31af300c
prerequisite-patch-id: a72aafd6c0e850fc36e164a5b4ff0c38523d3a79
prerequisite-patch-id: b29a32a0cf5806aeda206a8e70c4bd480ae9a181
prerequisite-patch-id: ea780e231dc00b180cfd6627ffeaada67877b60c
prerequisite-patch-id: c32ead665755fbb0acd8ee35427fb54987b493d6
prerequisite-patch-id: f6af0b3240064cbe99b8af9f7cc253fc9927b2c5
prerequisite-patch-id: 0244c21e77478d0feaa1dcfe19504e4601d04efd
prerequisite-patch-id: 1a929cc7c6c7a1c1fef902eaaa76d0d514192503
prerequisite-patch-id: 64a7754f8978f34d4b1ca56123b1cf558f4807ce
prerequisite-patch-id: 2a836f28c8ff5d76e694231391633e9da39e2a7b
prerequisite-patch-id: 0f0f9fb3c58152149358888610067a1cc314a18f
prerequisite-patch-id: ee1f374aea0b8f033bedfb3a1ca3fec1906b5c50
prerequisite-patch-id: 7643d3fbe3bb1a285a7a6b0489126ce078114e72
prerequisite-patch-id: 80c4751ffacd0f26a2a46242729918a2f84eb443
prerequisite-patch-id: 94cea2b73a3fc858bbdd8348054472b53117a934
prerequisite-patch-id: 7c1aeef6f5bcf5eb968bb50bf83c678ad644e4e8
prerequisite-patch-id: 2b47e9d65ad72abdcf75f7cdfadca029a2131001
prerequisite-patch-id: 0a4049cbaa75f16f392604af40d2033af52bccab
prerequisite-patch-id: 4ee78673a8c6385e330e14f5a4abe8b04e32762d
prerequisite-patch-id: d36ab3205e29262f859cbecc76f6f52aa35dd1b5
prerequisite-patch-id: c5618024ca01e256f37009a35886823f7afc24ff
prerequisite-patch-id: 0dd8645413e87a8671e865b12dbae342d134d393
prerequisite-patch-id: 579d3dff2a34df0ba8a5e5da9b3d631a74843825
prerequisite-patch-id: 499db6580d8bd4694c9b5fe50a6d18c77404467b
prerequisite-patch-id: 6d87d08265a9abd7badf29faa2b5dcf0105ce78c
prerequisite-patch-id: 4dc04d4f2fda0a3d264829dfdb1e73300523b184
prerequisite-patch-id: 1a061bf66aacf372a420f64b94be34a39432c4bd
prerequisite-patch-id: c45dc69fd5ed079c8c2b09a0c95e2b23983e1ec4
prerequisite-patch-id: eed6e08722f92d2ef99951b8388cf26cef7a4c58
prerequisite-patch-id: afa837d1b04839aab82b94baaf74c85902b68b7e
prerequisite-patch-id: a263fdc0b74632a6e730fd422aa23cfbac4cff63
prerequisite-patch-id: 063670d2fc7a5b0e793319a95844a96d0a4fd9b1
prerequisite-patch-id: 9a341eb3c71da54d7736fc9cc0387ca419a5c485
prerequisite-patch-id: bac4519fa9366a2fa90819079a2f3942e81de4cb
prerequisite-patch-id: 955e6817eea5e89e3b63eeac4f0517b6a2476822
prerequisite-patch-id: e4a24afdbad196771d562ff6e8a08a4fd19941f2
prerequisite-patch-id: 9e5a80cd530d2a5000ae6f3e7d0b288e2635c41e
prerequisite-patch-id: 481c3789b8e0ef779a323093bc3e0a3f520078f9
prerequisite-patch-id: fa0823ebb1e355ca27e554f9342e9297626b0cf0
prerequisite-patch-id: e2a7ddc8dfb254e3369188ca3e857e676a7ea1f6
prerequisite-patch-id: 5c225f4b9c5d286e4622f1f830cee67b9c24828a
prerequisite-patch-id: 25d457958fd5c9788dcfc71a4e82bfe5a611eae7
prerequisite-patch-id: e0b3cb8bf200146a1511b7ff52e8e870b36e9899
prerequisite-patch-id: e471651c6c2f3d32d68bdea27a0eb5c00421fed3
prerequisite-patch-id: 8528882a216fd26ee71dc1a90737324da20e190f
prerequisite-patch-id: 8265ca5fe33619ba6a593d3d73b700b7fa6a0787
prerequisite-patch-id: d128841f623519ebbf16d0b2013bd6d8d2a344a3
prerequisite-patch-id: 97061ba81de0e3c43a659066bed2ac0848bd9d3a
prerequisite-patch-id: 2a26242501bb0b738ddab5499fe644070e66b4af
prerequisite-patch-id: ced30181df116d98701bc04d2e6901ec91d97542
prerequisite-patch-id: 2935f5e473720f67030c37451ae80dac955c00d2
prerequisite-patch-id: 06eab08587d8961281f9aaf70562d34abd336ef0
prerequisite-patch-id: 13518fac8068becf7ab2c1bdcf49be63f100fa25
prerequisite-patch-id: e3712c2bbef46c85b97a6d512dbf13c3abe9834e
prerequisite-patch-id: d681ba94675eb50b050427b9a2bcb530ef990b45
prerequisite-patch-id: 5daaeb2d5fd5297b2ba691f571c9ef3125023aff
prerequisite-patch-id: f773f29e850899ee72bcb31f749ad72d452aaad2
prerequisite-patch-id: 8ecf5f707fdc23f1ddf62df264edfb624b48a430
prerequisite-patch-id: 4ca0ca3848305fbb518733e2dd8982d77671f535
prerequisite-patch-id: 8b6d8c64ef09e66902f4d3617102d5ada39b20bb
prerequisite-patch-id: fbbeca4b75cc092909112d237ea75c702978ece6
prerequisite-patch-id: 0e416f0307692954d9ce2b5b80e4a36a003b129c
prerequisite-patch-id: 8274429d05b09959b95ef3c19483c865da6e0cd5
prerequisite-patch-id: db81d80faee78da77611dae55843b2f79a941681
prerequisite-patch-id: 4febde7b63a8e03208bd1edfbf0100f4e9954939
prerequisite-patch-id: 5b972f691be5501f19c79f2dfffaa1b3cb057b72
prerequisite-patch-id: e8fdd8d87187e12e69681d6577906d622af00f5f
prerequisite-patch-id: e1dbb6ce4e71467cd7f255d01cb55c94d79a3fd0
prerequisite-patch-id: d018725a8d6689851337fbb8a2698cbfc2cfca69
prerequisite-patch-id: 16da4f631fceb24761c84ba101b3ee2ffbdf044f
prerequisite-patch-id: 3dca6c4f3bfaf63d7bc76bc11aa0e2b656994516
prerequisite-patch-id: 6f420ca44b0cc53583a3b097c04b485324b43075
prerequisite-patch-id: cd44e36e4ed2cacb4db55d4f11d6383051922ca9
prerequisite-patch-id: e07a600f5248208959254334778bf0853c0cd717
prerequisite-patch-id: 2527c4b1367b6227de5be06d78974379e1ab0fd0
prerequisite-patch-id: fe4f27ffc8a76b0db714a2037c022841c472abe3
prerequisite-patch-id: f7bf903eb8c51ece26153a43032dee1ef39b760a
prerequisite-patch-id: fc9347a84eea16e4a17a5ff128fae389cb288220
prerequisite-patch-id: c7f71ba4d07e8ceefbf7633ce08147015bf2a95d
prerequisite-patch-id: ebff53e7a3d9eed40910e6fb6641bb1e979ac81f
prerequisite-patch-id: 928523ca9924db1c551ab8cbd369750e98cafb4e
prerequisite-patch-id: e2ca411820f972282a41a889a070567e09c79e8f
prerequisite-patch-id: 3e541a9e06abd6eadd3ab8fe2245b877509a35a1
prerequisite-patch-id: 056f1e30f65fdd7062aedf3865bdfe5d70e302a7
prerequisite-patch-id: b4e458df5c7c09db5cef50f62bf9dfeb5301a171
prerequisite-patch-id: 28f03e0f66affc43baa15423c512b48aa91ce0ea
prerequisite-patch-id: 4d2727d976c6c17c57215f99627281b6e75bab43
prerequisite-patch-id: 4627109b1cd56b735f480650d3d8b96ff93bd0b4
prerequisite-patch-id: 53f8e5ee450b232a89b58044657d7c09999fb81e
prerequisite-patch-id: c08fa1d4db39d27260e433bc4e9d270c41d1d366
prerequisite-patch-id: 3e7ed439c7bc72fc87933c068a38058175fa634a
prerequisite-patch-id: 53dfe9a168a5e5c0bd74ec855c7a470980601d46
prerequisite-patch-id: 31003dd25042bf5b28ca98748aa24fd42100ef8a
prerequisite-patch-id: 456cc1d197ad65c19f35e1bf8444ee01fdaca43a
prerequisite-patch-id: 066bbb5e6ec708cdda966750427c76131dce86ed
prerequisite-patch-id: 17aa7ead1033fed64f30e54d8802a3ba9c1cd6ba
prerequisite-patch-id: 6dd97f9bc4bf0abac4ef243fe56279dc80410d54
prerequisite-patch-id: c0d8ae21e4d89725d961d9726503d268436be8f0
prerequisite-patch-id: 84d193c0fcc876039f0a42d7ba5d97a04fc349be
prerequisite-patch-id: ac67cf4c14ba9ba5e512543da14f45ea80fbe427
prerequisite-patch-id: 219d0a2f0d5c44fa7131dc4d2fff495bcd20991c
prerequisite-patch-id: 976f2d30772c05eb6046d23c4d8bcc001a872c97
prerequisite-patch-id: e3589d9c224a6b2d7cedc47325cfccffcb0a9fb0
prerequisite-patch-id: 52a547b930fe93f92896ca77caa08bbae549e350
prerequisite-patch-id: 7936b29c6c04fb333d8b8868a4f3169061e61fe8
prerequisite-patch-id: 8bd9598dfe7ef599ff49307d98377feb7b0c3444
prerequisite-patch-id: b6e21d774b4da07ab6c72b9d2ec51c89e9257073
prerequisite-patch-id: b7050a41f05a2fbdd18d24af4af040570a5f3439
prerequisite-patch-id: e7588860c5c1664b5d5e7bccb1edb35e7829009c
prerequisite-patch-id: ce57950db84414be028283147d4b73d343e9e6bf
prerequisite-patch-id: 518ca13f3560fc3f132b04c1bd44e2b48b694ee6
prerequisite-patch-id: ebd2edfe1db2515d08295399c92506a5f29275ed
prerequisite-patch-id: a7a701a4bf961a7bcaee4c22ba52d261afc3a260
prerequisite-patch-id: f18ea97771a9d1e8ec68ee58a3321b358214ca87
prerequisite-patch-id: cecccb908b9a2788474c0a862715eec3849fc4f2
prerequisite-patch-id: 20ed711568d47ae277312d8f6d71347fd94775d6
prerequisite-patch-id: ddf1ce229eeac844bd6cf2c06798b2ec2e4615cb
prerequisite-patch-id: dde6bdf7b554844827d5f0d7fe4929e5dc5b6fdb
prerequisite-patch-id: 0ef2b52dde653e733afa898001ccde4fd7c73a3d
prerequisite-patch-id: e2e9438e1f4d46f5bbce5fcf6c7fcb72e5cf8a62
prerequisite-patch-id: 16fdfa005ee0791d278ceff69926fa680af4fbb8
prerequisite-patch-id: f7a59bf1a33d733c643fcf1a87a17519fc08683a
prerequisite-patch-id: ccdd4a455a91375273c92c64af4d8f3c444aba63
prerequisite-patch-id: 69e3d3e494b5369399cd3da3502b0581fc6c8396
prerequisite-patch-id: 2b54ad55e5a19de610b95f9d2fd66731076e2b73
prerequisite-patch-id: 5556b03cb3b79d2056cca8f026db8b42be2155e5
prerequisite-patch-id: 5bb329960c9a2eff9ebedfdb35d9b28f9b82c82b
prerequisite-patch-id: 69adac8a810cf032f98c7078b7e0667474f3ea7a
prerequisite-patch-id: 8df09b22ce9839f5b457510f22449bec40265c72
prerequisite-patch-id: 04a0db4e442eafc0b7c01baa49ddde14552edb27
prerequisite-patch-id: 82563e0dcade24ba1b84943c111d1e64a5bab4e5
prerequisite-patch-id: 4164c4508821ecd370237261f871028e002adc23
prerequisite-patch-id: f1f48574cbb31242144da1754f59b681204e557b
prerequisite-patch-id: c6c01da1eeeae3783e95cb7abcc7bdb71f499bcf
prerequisite-patch-id: 8ccbb0d6c5b8f65e1838cd04eb9109f2c3d2402b
prerequisite-patch-id: 654aacd0032bf78838b6b6e4b85921999b874476
prerequisite-patch-id: 41680d6e65f8ff2a5852377b13f700f559dece42
prerequisite-patch-id: 3ea65a35f5537a5489914209e342de7a9c3c9f54
prerequisite-patch-id: e578f45e002097efc20a3b867e3a8b410ff4a75c
prerequisite-patch-id: bf80b29664448c4bcc0bee0e7e0d23388d899d04
prerequisite-patch-id: ac661509dd5ac20b68960900db611ec95785809e
prerequisite-patch-id: 472fe4a75666bfca8f0e24abff9d53afe4d66f10
prerequisite-patch-id: 776c09245281f5430c7d4c3aec62d19e944b7e4e
prerequisite-patch-id: c8985de925ad5cb1cfb8e4192dd52f8672d77f95
prerequisite-patch-id: 1da25d35bf6bffb6e95ee12e45dabf0a07a6c259
prerequisite-patch-id: d2ec9beea48cad9da3bd4ea751a63bf8fa37ad16
prerequisite-patch-id: ef3ba331c22d832c4c47addd6235bc68c1723449
prerequisite-patch-id: 8e6dc1da0091f6e421af39ca8ffd81073f798086
prerequisite-patch-id: cbde629cd2c2d3c0fb8856791240a7d306abb11b
prerequisite-patch-id: 692dc54bcab5233d12fd13ebd64d34690dd4ca4f
prerequisite-patch-id: 2e8f1efbd3dbec6ac469dbd8dd76fb514895e6df
prerequisite-patch-id: d6ddf93c450c80ff8c51a3dfa0dc2f9d4c004351
prerequisite-patch-id: f165cc2b43a90297b7e5f73c16db711d618c0a0d
prerequisite-patch-id: d806b51be2e50e5e53dc2bbae271e24feefb8bfd
prerequisite-patch-id: dbb5aad933a4914906878ce64e1f7f47b5e3e4e3
prerequisite-patch-id: c89ace683de46835ef7025d1e8d547338b6820b0
prerequisite-patch-id: 456af31afa1d65e82428e965c9c0fffac76351d8
prerequisite-patch-id: 536e39837c517f3f7e0281f4eb110f3a91876f42
prerequisite-patch-id: 7679385d798221056f90ced9b8d90474c765a709
prerequisite-patch-id: 3a07219239f637cb938692be5d4df8f3a5ed1a99
prerequisite-patch-id: 5dc2871c02a06f38f50813fee90340b3f64bd512
prerequisite-patch-id: b6f446e435a87994880b1edf3b877176121daec5
prerequisite-patch-id: a3176150ed5b11b1ebf65d6416c0936b6c9e1688
prerequisite-patch-id: 60ecfd7e8e5fdaccc28a49fb6369599063cf6041
prerequisite-patch-id: 92c3eebca6197f031b4309c2c5a79f59dcdc042d
prerequisite-patch-id: 3b6994514df38c0eadd1b9e5c9454ec435ba7ddc
prerequisite-patch-id: da50681df090055cc29111db1c4016f3425dce93
prerequisite-patch-id: 31344ae9500cbb8ef80a28cf2081459225217cde
prerequisite-patch-id: fac2736f530d5d3be9f44690d365537a875e45b2
prerequisite-patch-id: c95dfefcbceec494d10393bba437570de6970754
prerequisite-patch-id: fd42760815c26a4a518ece232716a90f7b03e6e3
prerequisite-patch-id: 15f6b599909b2090e78988b2ea17ccf55dc9a163
prerequisite-patch-id: 614e13cbccd0f62700eda43aef5b104e8e95ff03
prerequisite-patch-id: ba9e8827204840685f535fe23f7d0565227a8a9a
prerequisite-patch-id: 67e2b292d975b756242cb2ad727ea25d108e5f99
prerequisite-patch-id: 937a3fd66340456d52bdc04fc3ec2e48e8cc5336
prerequisite-patch-id: d56686ed7242695ceefb1492b2ff9081262827dd
prerequisite-patch-id: 840d28846318720ac79f0dc1deaad344471f6f7e
prerequisite-patch-id: 8c463c603e01f9efa770b8e360e88c34a0e194c0
prerequisite-patch-id: b36622cbb14c9185e89f370d40034cb17a3096ce
prerequisite-patch-id: 6bccb149dddd35a5eb4b2f93f6959f8ee84f379a
prerequisite-patch-id: 5b537196ffadb7e4213cb4668495925a0c8f9051
prerequisite-patch-id: 11207c92aab048b73d8df6ff17f05840fea5db94
prerequisite-patch-id: 2af8ffeb4b096510c66a4dd702b81c700ab0f2cf
prerequisite-patch-id: ba9bef9d973df799fd080b551681d834abe0704b
prerequisite-patch-id: 7b6d3c77ae4df9c7e640d8fad1dee449128a347d
prerequisite-patch-id: f89426f661bcfc829475df696def23bc97552b3e
prerequisite-patch-id: b983c90c26e055622f32f445003fa88add3c29cf
prerequisite-patch-id: c73da10a6bbe5d492ff62b3b47ae9a00a9812ab9
prerequisite-patch-id: 15832333123ee7fa38eea3541d85be7188d6088d
prerequisite-patch-id: f65926480dec14186812c7e45a0d44c3412a9426
prerequisite-patch-id: 06244b82611cb8b602c7c751a1cc2e0f3c6d6c39
prerequisite-patch-id: ee9eaa89b5957bd7b98a0af745192c8e27bc091f
prerequisite-patch-id: 611b9c5c5269ddd10684879ae8de43e6e1d766b0
prerequisite-patch-id: 1c795709fd57d227f56edc5316e403eb230babb5
prerequisite-patch-id: d8acf8ca6d4ccdcaf22180371bd2ea57d73718e1
prerequisite-patch-id: eab24819de1fc9dbb9c1a34d3807dc1839130232
prerequisite-patch-id: 6c86169373560d5ed493b355648786ca9357f526
prerequisite-patch-id: 84b4d6e5cfb121c5a8abc7d41d3ca6523ed5e339
prerequisite-patch-id: ede3bb9f72733a74a425376234c2cf7d38c7d8bf
prerequisite-patch-id: c7ff62d96db4d2cdffe6801b08762e415cd1ebdb
prerequisite-patch-id: 9b4f37b9f9bc0b58fb3700c695dd04f5f6544e2e
prerequisite-patch-id: 288cd71d639bfa4894287eb944f36ef6116ff742
prerequisite-patch-id: 488f0ff662cf64e5d7f44b6b5b74193599af9ab8
prerequisite-patch-id: 84f3b35f389e647977f306d682102839c35a8ab0
prerequisite-patch-id: fa2e8b3324dea766e5f542e5bc1e5a79cf6ba049
prerequisite-patch-id: 017dc872171d45afe1018fa793304dbc7782a820
prerequisite-patch-id: 44ddd56aec008da909b8603bcb9ae0cf10743976
prerequisite-patch-id: fdb5048667db3098ecc1626c974ae75cec629008
prerequisite-patch-id: 96ab3acfc435e9d7530e7a9f8926ca5d729fe21a
prerequisite-patch-id: 81664270365445ba652668f03d9e57479795c7df
prerequisite-patch-id: eccacedc3fbbf9e9cc51610a157f51780f7ee607
prerequisite-patch-id: e5ded3d1a9f370d65869ed0957e2fe3d3680ee4d
prerequisite-patch-id: e84b89ea28e81a19f43984f21c006ce9132edbb9
prerequisite-patch-id: 36735447019e5c9a8117fc3305558448b49493f5
prerequisite-patch-id: 41740b15a5d3566aa3cea7e32c043af99ae9d647
prerequisite-patch-id: c80422ce3398c007ace9e81dcad4e1230c146fa7
prerequisite-patch-id: 24ec02bd3ebc763a4c21ea6799bd7987fe89a303
prerequisite-patch-id: 8c662ecb03d7d33010bebcf231763e0b8dc12588
prerequisite-patch-id: ce08cad5454058d51ca5b51cdfe6f6911f857455
prerequisite-patch-id: 8eb9dceebf9da2f2ae441099ba4053545c8f6632
prerequisite-patch-id: d075d95d9f67dddc84ece6008bfefbe474f20d2a
prerequisite-patch-id: 4d806312ce0aed0f7aeafe04a9a04acad94a1cf8
prerequisite-patch-id: eeef8c7112776c13004ab4ff11ff4a3ac91c2f28
prerequisite-patch-id: ffcbdcb39f74b9f73fca84d2f69dea44ebc828a2
prerequisite-patch-id: c2b5f3a99ff1af80036b17ea734e02960d035e2b
prerequisite-patch-id: 20ab1ceb376577161a5927dbfba9f77d5456419d
prerequisite-patch-id: 577d3be3e2d60483020af3c49368e6ab0214542b
prerequisite-patch-id: 701e790694aa4193b9e79a721f1c9c850fd38404
prerequisite-patch-id: 1892575a4a8de103accd4631cdc06579f3756a3f
prerequisite-patch-id: f913fbe787ac152ffc85cab397ba1964bb453fbe
prerequisite-patch-id: a1197fb938aeef4267e3c1431833d0a0bf5d05c5
prerequisite-patch-id: ddbff3674c2d6d5bba6182e87e9f94bdb4aaa286
prerequisite-patch-id: 93261fa0817e8783a88518bfc22b6a0e17eb0fad
prerequisite-patch-id: d5643561620c8c22230dc98323af1f4981e57b2a
prerequisite-patch-id: 9991333653680250c88a751d6f40e3c7d860fe00
prerequisite-patch-id: 26771207dab3f5350b9ceafabeb6aab1c9067fb8
prerequisite-patch-id: d8b0e3e82bc23cbefca6424357ddeb4ff5c56f71
prerequisite-patch-id: 8598986ae890f6bb5ce40c6d0d6d492946c0556e
prerequisite-patch-id: 229e06c5d4549b802b052d0ed3ef38ba4f884bda
prerequisite-patch-id: e490406bffdda4a1ce087a35f297f9b09e1e09af
prerequisite-patch-id: 31c64a958d6a72ede489a295b82b973fb5ae89aa
prerequisite-patch-id: 1c14b1c1e0864ed209606f956bae444f323df23b
prerequisite-patch-id: b17834e99e522665a8fe22c7c81ab157798a6acc
prerequisite-patch-id: fed728a689b33dc67fcf66f0d68f7040075594b9
prerequisite-patch-id: f40a435bb3b586ecd71c134ecb87cb89fdf6c0fc
prerequisite-patch-id: 20c265682e66fb85d4dffd43213d7daec411003c
prerequisite-patch-id: a451d1115e6c4bd4a89d15c66226209abbb66b78
prerequisite-patch-id: d24dc6d9d82b1f4ceee3ee280ace4d4f70d1eea4
prerequisite-patch-id: 922d294b46da5780cf547182c44e3d79bbc2b425
prerequisite-patch-id: f56f6ac263fd2fc1d5544be3f8ea2d7b98b71fb5
prerequisite-patch-id: 30996e0bb7b52c481b533148ccdb6cb0b8155a80
prerequisite-patch-id: f02c49d98ff1c907ea0fe18810c31f170ede1bb5
prerequisite-patch-id: c35bc41858fbcafcd7e1ea7ad9e3244728d0d206
prerequisite-patch-id: 7ea803e30b70fdab3403f44042f28c4696a4eb31
prerequisite-patch-id: 37187c54568da5d00272531a30dbfd384498dd79
prerequisite-patch-id: fea02201f9f7da3f98fd1308770cf141736d7ed2
prerequisite-patch-id: 2785d578dd02e6ea7a96c1bb1677bbabf723e5c3
prerequisite-patch-id: 576f23a2ac4932a25e6a5cea5c20a119fa1d0e6a
prerequisite-patch-id: e0b43a6b47f2f1ffa3b15a472212a4506914e6f9
prerequisite-patch-id: 258df503125b04dd9993bf43cfc0677de5e89be3
prerequisite-patch-id: 8b470ebf6fd3f246a1e49e50bae7a4afa59c913b
prerequisite-patch-id: 0461b3073467a18df15a5ff640f44a989e9c2c0b
prerequisite-patch-id: 21c6dcd72ee2a005352c498ed279bfe8e2930510
prerequisite-patch-id: 2b9dcbaec981f509a7e96a739e3e32845d1fa24b
prerequisite-patch-id: 7e3208a7f1759fd09dc33e8c9aaaf700a05efbf8
prerequisite-patch-id: 81b8ac6bd8134c7afe5c9c5222f855827b3d7787
prerequisite-patch-id: bea85ef0db7ff762e3b3a854a626525b64f0daa5
prerequisite-patch-id: 4f8798e504933e039a09cdac778b4dc6b3661b27
prerequisite-patch-id: c5279ce9c9dc0fe3cc21426c4cefa20fe788c42a
prerequisite-patch-id: 575f47264cc4247d494d15dd00c06c3ded1766ea
prerequisite-patch-id: bc6aebd34031d71c7be6f8355e4cb42c8f7b786e
prerequisite-patch-id: cdc7bc4c06a416f4910f3c1675ee436ddfdbeb83
prerequisite-patch-id: 7e7e1261a49533efbe5e852c6af5a02c5ca36bc9
prerequisite-patch-id: b3b8b537a4bb868efbc5b947d7e01f9cada2b7ac
prerequisite-patch-id: 32c7d7471e50b2bf8fdc3f9b1aa9e14db2bcbf37
prerequisite-patch-id: c5bb81eaf7c7b17b63be7b744022daa1b92cd3b7
prerequisite-patch-id: c56dd39e1788b99d3543c822918051a0bf887ba2
prerequisite-patch-id: b42b73bcde32aafb7d9a6ef5ba7f26f17bd8db59
prerequisite-patch-id: 42efac5083e94a1d42635e011d917c5d18e9be27
prerequisite-patch-id: 683965db767419abfebebf55e9afe543a793e6d8
prerequisite-patch-id: f1c4002fa9c3516a9c5b46b89e481f5d552636ea
prerequisite-patch-id: a1961e7ed732ac5a2daa3224280ff23bbd8168fe
prerequisite-patch-id: d657fc24bfcbf9a43866aee1f4cd729982382ec3
prerequisite-patch-id: cc0515a3ab19699883fee4c83b13112660cbf239
prerequisite-patch-id: 0ae4961bf8a9733e50b507e8aea57f6b5bf2344c
prerequisite-patch-id: f837adcf95110f21134de04863fcc29bb4382b17
prerequisite-patch-id: 4338b960395ae158ac74401be877ee69af53d076
prerequisite-patch-id: e00a92f7ba700bb3124b2d307330c3a0db018328
prerequisite-patch-id: 9985702bd7ababc66ec9df777efb151ad51a9ad3
prerequisite-patch-id: cd2be8a751fe6b5d14448405efd7dc37b42cfadd
prerequisite-patch-id: ce5b6e5f14f076a995c16471a07db8e5e0c00f97
prerequisite-patch-id: d6a1672686ece56d69739def59602b8a0b98c942
prerequisite-patch-id: da601b7472a1b1fa2bb8e7b4e637852cd73b2997
prerequisite-patch-id: 51e520d6f14c3ac9995cf7a306df01b04a9ff70f
prerequisite-patch-id: fa4321957bfd59bc4ad0b49daf795201d9092b6c
prerequisite-patch-id: d8227b1eb3ecbcb6e9141ece6a0bc849bd0f3643
prerequisite-patch-id: cb03a406fff6d8c41860cee892a2affa1efdb7e4
prerequisite-patch-id: a3c8abcf1f03017ed5a35945f9a876929ab0893f
prerequisite-patch-id: 449f73baf6f6222d3b4498ebc46f9284922594f6
prerequisite-patch-id: 1159473e2aec02edddd624dfbd6b74ce58eac9fb
prerequisite-patch-id: 124e5f0304a8d702eee4558f2d45caa08d3d9948
prerequisite-patch-id: 84faa8bf25a31c1120b3982e9c8fa90552c9e7bc
prerequisite-patch-id: 2b7cc6947b034902e3834b70202d75a1a7394e10
prerequisite-patch-id: f2328625ae2193c3c8e336b154b62030940cece8
prerequisite-patch-id: 5a00737b1f20b86865e5e99c3cbea27de9ae8438
prerequisite-patch-id: c1723ec04df1fcfcdab13447ab574aa6423c567f
prerequisite-patch-id: 857a8e829413a285adde8881468fd52f1e2019c1
prerequisite-patch-id: a0e43d95e98b20be3cc6e260ef436da026c9b42f
prerequisite-patch-id: 4c9d15f7b9d2732fec205ab0c3e18aa0904d9d63
prerequisite-patch-id: 4cf8e4cb3d11fa7269b4781e9839500a22094c86
prerequisite-patch-id: 143b73d94d7ba5130e229c269ea41ce192bb0bf0
prerequisite-patch-id: bd3e6b52b02d5937eb9084da3bfd5014c801ab93
prerequisite-patch-id: a63f7ac4e4e6eacfa5810bfb03b7369f7d010a23
prerequisite-patch-id: a70eb8f4c1a57b1dd8928c70d694bcd7d51483c0
prerequisite-patch-id: 555dd4f8f7da8ba8b7e7c10e96116c445e497c33
prerequisite-patch-id: cf950631402b9f5d61f32f2a37b1b073719847d4
prerequisite-patch-id: cd2377dfb0b4d63839101e674ebe3604ddb8a518
prerequisite-patch-id: 84318df68e1bc99a62363f70f6f0e059855b9be7
prerequisite-patch-id: 5c07ef2a50cecc614b6a61a0d8f6a4f951509428
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v4] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-12 19:05     ` [PATCH v4] " Andrzej Pietrasiewicz
@ 2023-12-14  6:40       ` Andrzej Pietrasiewicz
  2023-12-15 12:47       ` Greg Kroah-Hartman
  2023-12-15 13:16       ` [PATCH v5] " Andrzej Pietrasiewicz
  2 siblings, 0 replies; 17+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-12-14  6:40 UTC (permalink / raw)
  To: linux-usb
  Cc: Laurent Pinchart, Daniel Scally, Greg Kroah-Hartman,
	Michael Grzeschik, kernel

Hi All,

W dniu 12.12.2023 o 20:05, Andrzej Pietrasiewicz pisze:
> commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
> 
> has rendered the precomposed (aka legacy) webcam gadget unloadable.
> 
> uvc_alloc() since then has depended on certain config groups being
> available in configfs tree related to the UVC function. However, legacy
> gadgets do not create anything in configfs, so uvc_alloc() must fail
> with -ENOENT no matter what.
> 
> This patch mimics the required configfs hierarchy to satisfy the code which
> inspects formats and frames found in uvcg_streaming_header.
> 
> This has been tested with guvcview on the host side, using vivid as a
> source of video stream on the device side and using the userspace program
> found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.
> 
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
> ---
> v3..v4:
> - silenced "initializer element is not constant" warnings on old
>    compiles (created and used a bunch of #defines instead of referring
>    to a static constr struct /members/, which in the C language is not
>    considered const)
> 
> v2..v3:
> - fixed another typo (actually use uvcg_frame_mjpeg_720p where it should
>    be used instead of its 360p counterpart)
> - eliminated sparse warnings by reverting the effect of cpu_to_le[16|32]
>    while assigning to uvcg_frame members
> 
> v1..v2:
> - fixed a typo (missing character) in one of uvcg_frame_mjpeg_720p's members
> 
>   drivers/usb/gadget/function/f_uvc.c |  45 ++--
>   drivers/usb/gadget/function/u_uvc.h |   6 +
>   drivers/usb/gadget/legacy/webcam.c  | 333 +++++++++++++++++++++-------
>   3 files changed, 284 insertions(+), 100 deletions(-)
> 
> diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
> index 786379f1b7b7..3b46de85ca01 100644
> --- a/drivers/usb/gadget/function/f_uvc.c
> +++ b/drivers/usb/gadget/function/f_uvc.c
> @@ -960,7 +960,8 @@ static void uvc_free(struct usb_function *f)
>   	struct uvc_device *uvc = to_uvc(f);
>   	struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts,
>   					       func_inst);
> -	config_item_put(&uvc->header->item);
> +	if (!opts->header)
> +		config_item_put(&uvc->header->item);
>   	--opts->refcnt;
>   	kfree(uvc);
>   }
> @@ -1052,25 +1053,29 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
>   	uvc->desc.hs_streaming = opts->hs_streaming;
>   	uvc->desc.ss_streaming = opts->ss_streaming;
>   
> -	streaming = config_group_find_item(&opts->func_inst.group, "streaming");
> -	if (!streaming)
> -		goto err_config;
> -
> -	header = config_group_find_item(to_config_group(streaming), "header");
> -	config_item_put(streaming);
> -	if (!header)
> -		goto err_config;
> -
> -	h = config_group_find_item(to_config_group(header), "h");
> -	config_item_put(header);
> -	if (!h)
> -		goto err_config;
> -
> -	uvc->header = to_uvcg_streaming_header(h);
> -	if (!uvc->header->linked) {
> -		mutex_unlock(&opts->lock);
> -		kfree(uvc);
> -		return ERR_PTR(-EBUSY);
> +	if (opts->header) {
> +		uvc->header = opts->header;
> +	} else {
> +		streaming = config_group_find_item(&opts->func_inst.group, "streaming");
> +		if (!streaming)
> +			goto err_config;
> +
> +		header = config_group_find_item(to_config_group(streaming), "header");
> +		config_item_put(streaming);
> +		if (!header)
> +			goto err_config;
> +
> +		h = config_group_find_item(to_config_group(header), "h");
> +		config_item_put(header);
> +		if (!h)
> +			goto err_config;
> +
> +		uvc->header = to_uvcg_streaming_header(h);
> +		if (!uvc->header->linked) {
> +			mutex_unlock(&opts->lock);
> +			kfree(uvc);
> +			return ERR_PTR(-EBUSY);
> +		}
>   	}
>   
>   	uvc->desc.extension_units = &opts->extension_units;
> diff --git a/drivers/usb/gadget/function/u_uvc.h b/drivers/usb/gadget/function/u_uvc.h
> index 1ce58f61253c..3ac392cbb779 100644
> --- a/drivers/usb/gadget/function/u_uvc.h
> +++ b/drivers/usb/gadget/function/u_uvc.h
> @@ -98,6 +98,12 @@ struct f_uvc_opts {
>   	 */
>   	struct mutex			lock;
>   	int				refcnt;
> +
> +	/*
> +	 * Only for legacy gadget. Shall be NULL for configfs-composed gadgets,
> +	 * which is guaranteed by alloc_inst implementation of f_uvc doing kzalloc.
> +	 */
> +	struct uvcg_streaming_header	*header;
>   };
>   
>   #endif /* U_UVC_H */
> diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
> index c06dd1af7a0c..c395438d3978 100644
> --- a/drivers/usb/gadget/legacy/webcam.c
> +++ b/drivers/usb/gadget/legacy/webcam.c
> @@ -12,6 +12,7 @@
>   #include <linux/usb/video.h>
>   
>   #include "u_uvc.h"
> +#include "uvc_configfs.h"
>   
>   USB_GADGET_COMPOSITE_OPTIONS();
>   
> @@ -84,8 +85,6 @@ static struct usb_device_descriptor webcam_device_descriptor = {
>   	.bNumConfigurations	= 0, /* dynamic */
>   };
>   
> -DECLARE_UVC_HEADER_DESCRIPTOR(1);
> -
>   static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
>   	.bLength		= UVC_DT_HEADER_SIZE(1),
>   	.bDescriptorType	= USB_DT_CS_INTERFACE,
> @@ -158,43 +157,112 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
>   	.bmaControls[1][0]	= 4,
>   };
>   
> -static const struct uvc_format_uncompressed uvc_format_yuv = {
> -	.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
> -	.bDescriptorType	= USB_DT_CS_INTERFACE,
> -	.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
> -	.bFormatIndex		= 1,
> -	.bNumFrameDescriptors	= 2,
> -	.guidFormat		=
> -		{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
> -		 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71},
> -	.bBitsPerPixel		= 16,
> -	.bDefaultFrameIndex	= 1,
> -	.bAspectRatioX		= 0,
> -	.bAspectRatioY		= 0,
> -	.bmInterlaceFlags	= 0,
> -	.bCopyProtect		= 0,
> +static const struct uvcg_color_matching uvcg_color_matching = {
> +	.desc = {
> +		.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
> +		.bDescriptorType	= USB_DT_CS_INTERFACE,
> +		.bDescriptorSubType	= UVC_VS_COLORFORMAT,
> +		.bColorPrimaries	= 1,
> +		.bTransferCharacteristics	= 1,
> +		.bMatrixCoefficients	= 4,
> +	},
> +};
> +
> +static struct uvcg_uncompressed uvcg_format_yuv = {
> +	.fmt = {
> +		.type			= UVCG_UNCOMPRESSED,
> +		/* add to .frames and fill .num_frames at runtime */
> +		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
> +	},
> +	.desc = {
> +		.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
> +		.bDescriptorType	= USB_DT_CS_INTERFACE,
> +		.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
> +		.bFormatIndex		= 1,
> +		.bNumFrameDescriptors	= 2,
> +		.guidFormat		= {
> +			'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
> +			 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
> +		},
> +		.bBitsPerPixel		= 16,
> +		.bDefaultFrameIndex	= 1,
> +		.bAspectRatioX		= 0,
> +		.bAspectRatioY		= 0,
> +		.bmInterlaceFlags	= 0,
> +		.bCopyProtect		= 0,
> +	},
> +};
> +
> +static struct uvcg_format_ptr uvcg_format_ptr_yuv = {
> +	.fmt = &uvcg_format_yuv.fmt,
>   };
>   
>   DECLARE_UVC_FRAME_UNCOMPRESSED(1);
>   DECLARE_UVC_FRAME_UNCOMPRESSED(3);
>   
> +#define UVCG_WIDTH_360P			640
> +#define UVCG_HEIGHT_360P		360
> +#define UVCG_MIN_BITRATE_360P		18432000
> +#define UVCG_MAX_BITRATE_360P		55296000
> +#define UVCG_MAX_VIDEO_FB_SZ_360P	460800
> +#define UVCG_FRM_INTERV_0_360P		666666
> +#define UVCG_FRM_INTERV_1_360P		1000000
> +#define UVCG_FRM_INTERV_2_360P		5000000
> +#define UVCG_DEFAULT_FRM_INTERV_360P	UVCG_FRM_INTERV_0_360P
> +
>   static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
>   	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
>   	.bDescriptorType	= USB_DT_CS_INTERFACE,
>   	.bDescriptorSubType	= UVC_VS_FRAME_UNCOMPRESSED,
>   	.bFrameIndex		= 1,
>   	.bmCapabilities		= 0,
> -	.wWidth			= cpu_to_le16(640),
> -	.wHeight		= cpu_to_le16(360),
> -	.dwMinBitRate		= cpu_to_le32(18432000),
> -	.dwMaxBitRate		= cpu_to_le32(55296000),
> -	.dwMaxVideoFrameBufferSize	= cpu_to_le32(460800),
> -	.dwDefaultFrameInterval	= cpu_to_le32(666666),
> +	.wWidth			= cpu_to_le16(UVCG_WIDTH_360P),
> +	.wHeight		= cpu_to_le16(UVCG_HEIGHT_360P),
> +	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_360P),
> +	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_360P),
> +	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_360P),
> +	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_360P),
>   	.bFrameIntervalType	= 3,
> -	.dwFrameInterval[0]	= cpu_to_le32(666666),
> -	.dwFrameInterval[1]	= cpu_to_le32(1000000),
> -	.dwFrameInterval[2]	= cpu_to_le32(5000000),
> +	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_360P),
> +	.dwFrameInterval[1]	= cpu_to_le32(UVCG_FRM_INTERV_1_360P),
> +	.dwFrameInterval[2]	= cpu_to_le32(UVCG_FRM_INTERV_2_360P),
> +};
> +
> +static u32 uvcg_frame_yuv_360p_dw_frame_interval[] = {
> +	[0] = UVCG_FRM_INTERV_0_360P,
> +	[1] = UVCG_FRM_INTERV_1_360P,
> +	[2] = UVCG_FRM_INTERV_2_360P,
> +};
> +
> +static const struct uvcg_frame uvcg_frame_yuv_360p = {
> +	.fmt_type		= UVCG_UNCOMPRESSED,
> +	.frame = {
> +		.b_length			= UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
> +		.b_descriptor_type		= USB_DT_CS_INTERFACE,
> +		.b_descriptor_subtype		= UVC_VS_FRAME_UNCOMPRESSED,
> +		.b_frame_index			= 1,
> +		.bm_capabilities		= 0,
> +		.w_width			= UVCG_WIDTH_360P,
> +		.w_height			= UVCG_HEIGHT_360P,
> +		.dw_min_bit_rate		= UVCG_MIN_BITRATE_360P,
> +		.dw_max_bit_rate		= UVCG_MAX_BITRATE_360P,
> +		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_360P,
> +		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_360P,
> +		.b_frame_interval_type		= 3,
> +	},
> +	.dw_frame_interval	= uvcg_frame_yuv_360p_dw_frame_interval,
> +};
> +
> +static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_360p = {
> +	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_360p,
>   };
> +#define UVCG_WIDTH_720P			1280
> +#define UVCG_HEIGHT_720P		720
> +#define UVCG_MIN_BITRATE_720P		29491200
> +#define UVCG_MAX_BITRATE_720P		29491200
> +#define UVCG_MAX_VIDEO_FB_SZ_720P	1843200
> +#define UVCG_FRM_INTERV_0_720P		5000000
> +#define UVCG_DEFAULT_FRM_INTERV_720P	UVCG_FRM_INTERV_0_720P
>   
>   static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
>   	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
> @@ -202,28 +270,66 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
>   	.bDescriptorSubType	= UVC_VS_FRAME_UNCOMPRESSED,
>   	.bFrameIndex		= 2,
>   	.bmCapabilities		= 0,
> -	.wWidth			= cpu_to_le16(1280),
> -	.wHeight		= cpu_to_le16(720),
> -	.dwMinBitRate		= cpu_to_le32(29491200),
> -	.dwMaxBitRate		= cpu_to_le32(29491200),
> -	.dwMaxVideoFrameBufferSize	= cpu_to_le32(1843200),
> -	.dwDefaultFrameInterval	= cpu_to_le32(5000000),
> +	.wWidth			= cpu_to_le16(UVCG_WIDTH_720P),
> +	.wHeight		= cpu_to_le16(UVCG_HEIGHT_720P),
> +	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_720P),
> +	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_720P),
> +	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_720P),
> +	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_720P),
>   	.bFrameIntervalType	= 1,
> -	.dwFrameInterval[0]	= cpu_to_le32(5000000),
> +	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_720P),
>   };
>   
> -static const struct uvc_format_mjpeg uvc_format_mjpg = {
> -	.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
> -	.bDescriptorType	= USB_DT_CS_INTERFACE,
> -	.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
> -	.bFormatIndex		= 2,
> -	.bNumFrameDescriptors	= 2,
> -	.bmFlags		= 0,
> -	.bDefaultFrameIndex	= 1,
> -	.bAspectRatioX		= 0,
> -	.bAspectRatioY		= 0,
> -	.bmInterlaceFlags	= 0,
> -	.bCopyProtect		= 0,
> +static u32 uvcg_frame_yuv_720p_dw_frame_interval[] = {
> +	[0] = UVCG_FRM_INTERV_0_720P,
> +};
> +
> +static const struct uvcg_frame uvcg_frame_yuv_720p = {
> +	.fmt_type		= UVCG_UNCOMPRESSED,
> +	.frame = {
> +		.b_length			= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
> +		.b_descriptor_type		= USB_DT_CS_INTERFACE,
> +		.b_descriptor_subtype		= UVC_VS_FRAME_UNCOMPRESSED,
> +		.b_frame_index			= 2,
> +		.bm_capabilities		= 0,
> +		.w_width			= UVCG_WIDTH_720P,
> +		.w_height			= UVCG_HEIGHT_720P,
> +		.dw_min_bit_rate		= UVCG_MIN_BITRATE_720P,
> +		.dw_max_bit_rate		= UVCG_MAX_BITRATE_720P,
> +		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_720P,
> +		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_720P,
> +		.b_frame_interval_type		= 1,
> +	},
> +	.dw_frame_interval	= uvcg_frame_yuv_720p_dw_frame_interval,
> +};
> +
> +static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_720p = {
> +	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_720p,
> +};
> +
> +static struct uvcg_mjpeg uvcg_format_mjpeg = {
> +	.fmt = {
> +		.type			= UVCG_MJPEG,
> +		/* add to .frames and fill .num_frames at runtime */
> +		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
> +	},
> +	.desc = {
> +		.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
> +		.bDescriptorType	= USB_DT_CS_INTERFACE,
> +		.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
> +		.bFormatIndex		= 2,
> +		.bNumFrameDescriptors	= 2,
> +		.bmFlags		= 0,
> +		.bDefaultFrameIndex	= 1,
> +		.bAspectRatioX		= 0,
> +		.bAspectRatioY		= 0,
> +		.bmInterlaceFlags	= 0,
> +		.bCopyProtect		= 0,
> +	},
> +};
> +
> +static struct uvcg_format_ptr uvcg_format_ptr_mjpeg = {
> +	.fmt = &uvcg_format_mjpeg.fmt,
>   };
>   
>   DECLARE_UVC_FRAME_MJPEG(1);
> @@ -235,16 +341,45 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
>   	.bDescriptorSubType	= UVC_VS_FRAME_MJPEG,
>   	.bFrameIndex		= 1,
>   	.bmCapabilities		= 0,
> -	.wWidth			= cpu_to_le16(640),
> -	.wHeight		= cpu_to_le16(360),
> -	.dwMinBitRate		= cpu_to_le32(18432000),
> -	.dwMaxBitRate		= cpu_to_le32(55296000),
> -	.dwMaxVideoFrameBufferSize	= cpu_to_le32(460800),
> -	.dwDefaultFrameInterval	= cpu_to_le32(666666),
> +	.wWidth			= cpu_to_le16(UVCG_WIDTH_360P),
> +	.wHeight		= cpu_to_le16(UVCG_HEIGHT_360P),
> +	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_360P),
> +	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_360P),
> +	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_360P),
> +	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_360P),
>   	.bFrameIntervalType	= 3,
> -	.dwFrameInterval[0]	= cpu_to_le32(666666),
> -	.dwFrameInterval[1]	= cpu_to_le32(1000000),
> -	.dwFrameInterval[2]	= cpu_to_le32(5000000),
> +	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_360P),
> +	.dwFrameInterval[1]	= cpu_to_le32(UVCG_FRM_INTERV_1_360P),
> +	.dwFrameInterval[2]	= cpu_to_le32(UVCG_FRM_INTERV_2_360P),
> +};
> +
> +static u32 uvcg_frame_mjpeg_360p_dw_frame_interval[] = {
> +	[0] = UVCG_FRM_INTERV_0_360P,
> +	[1] = UVCG_FRM_INTERV_1_360P,
> +	[2] = UVCG_FRM_INTERV_2_360P,
> +};
> +
> +static const struct uvcg_frame uvcg_frame_mjpeg_360p = {
> +	.fmt_type		= UVCG_MJPEG,
> +	.frame = {
> +		.b_length			= UVC_DT_FRAME_MJPEG_SIZE(3),
> +		.b_descriptor_type		= USB_DT_CS_INTERFACE,
> +		.b_descriptor_subtype		= UVC_VS_FRAME_MJPEG,
> +		.b_frame_index			= 1,
> +		.bm_capabilities		= 0,
> +		.w_width			= UVCG_WIDTH_360P,
> +		.w_height			= UVCG_HEIGHT_360P,
> +		.dw_min_bit_rate		= UVCG_MIN_BITRATE_360P,
> +		.dw_max_bit_rate		= UVCG_MAX_BITRATE_360P,
> +		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_360P,
> +		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_360P,
> +		.b_frame_interval_type		= 3,
> +	},
> +	.dw_frame_interval	= uvcg_frame_mjpeg_360p_dw_frame_interval,
> +};
> +
> +static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_360p = {
> +	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
>   };
>   
>   static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
> @@ -253,23 +388,44 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
>   	.bDescriptorSubType	= UVC_VS_FRAME_MJPEG,
>   	.bFrameIndex		= 2,
>   	.bmCapabilities		= 0,
> -	.wWidth			= cpu_to_le16(1280),
> -	.wHeight		= cpu_to_le16(720),
> -	.dwMinBitRate		= cpu_to_le32(29491200),
> -	.dwMaxBitRate		= cpu_to_le32(29491200),
> -	.dwMaxVideoFrameBufferSize	= cpu_to_le32(1843200),
> -	.dwDefaultFrameInterval	= cpu_to_le32(5000000),
> +	.wWidth			= cpu_to_le16(UVCG_WIDTH_720P),
> +	.wHeight		= cpu_to_le16(UVCG_HEIGHT_720P),
> +	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_720P),
> +	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_720P),
> +	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_720P),
> +	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_720P),
>   	.bFrameIntervalType	= 1,
> -	.dwFrameInterval[0]	= cpu_to_le32(5000000),
> +	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_720P),
>   };
>   
> -static const struct uvc_color_matching_descriptor uvc_color_matching = {
> -	.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
> -	.bDescriptorType	= USB_DT_CS_INTERFACE,
> -	.bDescriptorSubType	= UVC_VS_COLORFORMAT,
> -	.bColorPrimaries	= 1,
> -	.bTransferCharacteristics	= 1,
> -	.bMatrixCoefficients	= 4,
> +static u32 uvcg_frame_mjpeg_720p_dw_frame_interval[] = {
> +	[0] = UVCG_FRM_INTERV_0_720P,
> +};
> +
> +static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
> +	.fmt_type		= UVCG_MJPEG,
> +	.frame = {
> +		.b_length			= UVC_DT_FRAME_MJPEG_SIZE(1),
> +		.b_descriptor_type		= USB_DT_CS_INTERFACE,
> +		.b_descriptor_subtype		= UVC_VS_FRAME_MJPEG,
> +		.b_frame_index			= 2,
> +		.bm_capabilities		= 0,
> +		.w_width			= UVCG_WIDTH_720P,
> +		.w_height			= UVCG_HEIGHT_720P,
> +		.dw_min_bit_rate		= UVCG_MIN_BITRATE_720P,
> +		.dw_max_bit_rate		= UVCG_MAX_BITRATE_720P,
> +		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_720P,
> +		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_720P,
> +		.b_frame_interval_type		= 1,
> +	},
> +	.dw_frame_interval	= uvcg_frame_mjpeg_720p_dw_frame_interval,
> +};
> +
> +static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_720p = {
> +	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_720p,
> +};
> +
> +static struct uvcg_streaming_header uvcg_streaming_header = {
>   };
>   
>   static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
> @@ -290,40 +446,40 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
>   
>   static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = {
>   	(const struct uvc_descriptor_header *) &uvc_input_header,
> -	(const struct uvc_descriptor_header *) &uvc_format_yuv,
> +	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
>   	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
>   	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> -	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
> +	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
>   	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
>   	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
>   	NULL,
>   };
>   
>   static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
>   	(const struct uvc_descriptor_header *) &uvc_input_header,
> -	(const struct uvc_descriptor_header *) &uvc_format_yuv,
> +	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
>   	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
>   	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> -	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
> +	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
>   	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
>   	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
>   	NULL,
>   };
>   
>   static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
>   	(const struct uvc_descriptor_header *) &uvc_input_header,
> -	(const struct uvc_descriptor_header *) &uvc_format_yuv,
> +	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
>   	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
>   	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> -	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
> +	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
>   	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
>   	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
> -	(const struct uvc_descriptor_header *) &uvc_color_matching,
> +	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
>   	NULL,
>   };
>   
> @@ -387,6 +543,23 @@ webcam_bind(struct usb_composite_dev *cdev)
>   	uvc_opts->hs_streaming = uvc_hs_streaming_cls;
>   	uvc_opts->ss_streaming = uvc_ss_streaming_cls;
>   
> +	INIT_LIST_HEAD(&uvcg_format_yuv.fmt.frames);
> +	list_add_tail(&uvcg_frame_ptr_yuv_360p.entry, &uvcg_format_yuv.fmt.frames);
> +	list_add_tail(&uvcg_frame_ptr_yuv_720p.entry, &uvcg_format_yuv.fmt.frames);
> +	uvcg_format_yuv.fmt.num_frames = 2;
> +
> +	INIT_LIST_HEAD(&uvcg_format_mjpeg.fmt.frames);
> +	list_add_tail(&uvcg_frame_ptr_mjpeg_360p.entry, &uvcg_format_mjpeg.fmt.frames);
> +	list_add_tail(&uvcg_frame_ptr_mjpeg_720p.entry, &uvcg_format_mjpeg.fmt.frames);
> +	uvcg_format_mjpeg.fmt.num_frames = 2;
> +
> +	INIT_LIST_HEAD(&uvcg_streaming_header.formats);
> +	list_add_tail(&uvcg_format_ptr_yuv.entry, &uvcg_streaming_header.formats);
> +	list_add_tail(&uvcg_format_ptr_mjpeg.entry, &uvcg_streaming_header.formats);
> +	uvcg_streaming_header.num_fmt = 2;
> +
> +	uvc_opts->header = &uvcg_streaming_header;
> +
>   	/* Allocate string descriptor numbers ... note that string contents
>   	 * can be overridden by the composite_dev glue.
>   	 */
> 
> base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a
> prerequisite-patch-id: 5ebe1b40adede82d8413ff25a9e69f3e6b9fdfa6
> prerequisite-patch-id: 0525706498a65e3ffe25cb6ee19462da9ae6f5b5
> prerequisite-patch-id: 087583ddbd1db16eb07a5ae74683d781c4392470
> prerequisite-patch-id: 8f587de5eda5b35253bd5a320344a0797fe5812f
> prerequisite-patch-id: 3a134c208a4115c8bec97b531b6a37a1d2d000b4
> prerequisite-patch-id: c5d30c7201e25a4b6871cb929a60f241cb05797f
> prerequisite-patch-id: 3285282277d41ea3b0e1cca7ca837b14885097f3
> prerequisite-patch-id: 22ca214aeaf6f04f0531e3455fef87184eccdde1
> prerequisite-patch-id: f31cc83a77a0d486d55d3e607d8178e41cf1b4ad
> prerequisite-patch-id: da38777c59634a9591d32ec5bee366aae97fe701
> prerequisite-patch-id: d017ca64e136cad7f4bb546145c76b3e82fe8b33
> prerequisite-patch-id: 1002dc7ce0ffcc8d26e04b5c6b05f8d42f26b18a
> prerequisite-patch-id: 16194f0144231ee5271f304dee3a2e46d2f96e09
> prerequisite-patch-id: 768e6a55c3fbdf56195651f44256f2ca767f05fc
> prerequisite-patch-id: 1b0d80ad510477bfd7cae665d0b2fdee2d7adcd9
> prerequisite-patch-id: 43ae7e718ce9ff48157ad345bf2458775ee02717
> prerequisite-patch-id: e0ed8dd4046367ebc1a6b3f1e9b9b3ee3e492438
> prerequisite-patch-id: dd0b10cc033047abc126a27c0243d9e26d3c90fc
> prerequisite-patch-id: e6c77a99be80409208e918324bd8b9eb024034c8
> prerequisite-patch-id: fc0130264f43d85a1fecb2b1305b0c8e5ebcd667
> prerequisite-patch-id: 8341d7d87c9378253185bc434e25a5352160400f
> prerequisite-patch-id: 218344fb2343d2e953c8a10078faba61f7392c53
> prerequisite-patch-id: f6bc3c18ff84c999be7261a7ad953bf305e6077b
> prerequisite-patch-id: a06c7bfa391bfe7edf0949a09aa59039830b01db
> prerequisite-patch-id: 4fe63dcc7296048a67c7bace6e91a5bf65e258cc
> prerequisite-patch-id: aa1b577aaff5746a909b0dcd2aaab32a2320ce28
> prerequisite-patch-id: ba3bf3a391568fe24f46c8a56557f01fa1158fb8
> prerequisite-patch-id: a65e382e873bda296e420417eeaea4514e6f6e30
> prerequisite-patch-id: b549869029b0ecfeaa4ac9cf9dbb95169adf40d0
> prerequisite-patch-id: 46f07ae39fa155cf7ee6ec2deacb8e9f27879c6d
> prerequisite-patch-id: 3566df1640815b8c714963145f8f115a76316cee
> prerequisite-patch-id: 59b788a64fdcfa17787bda128dab0be70cc8f679
> prerequisite-patch-id: b05bdee532130860518aa7a6d1925e65ff9a88fc
> prerequisite-patch-id: 656d949909e1c1551cc37786e317cc7488849ef4
> prerequisite-patch-id: db84418e8f8d46959ca7f6a8e99b0857bca749b5
> prerequisite-patch-id: 55f11b5d4652247d27c58c9c0ebc9156f0583e78
> prerequisite-patch-id: afcebd8daeb0b39070825414c57560870b6f97a6
> prerequisite-patch-id: 85c10ddc63c4529a4abc2b24c023ab1621f70fd1
> prerequisite-patch-id: 1d95969cdc8ed6a8954b9535ba2bf0da4d5e3ef1
> prerequisite-patch-id: 37db59c354a4a1afbf685c493683de8cd7748643
> prerequisite-patch-id: d26d91821b15d36f0be4639b56b0d5771b7440a0
> prerequisite-patch-id: 6a63c4c984aa8a80542b88c99042b18384003616
> prerequisite-patch-id: d47b4bf169d4f601203c392222d8563804369571
> prerequisite-patch-id: 0945d6082543ec592f7cf8d0dcc581632e926151
> prerequisite-patch-id: 760bd00596ed56f492c3e6429ceae6098ad8aee2
> prerequisite-patch-id: 16469ac127f0ecea0c9f2b9f1a605a389aeadb3e
> prerequisite-patch-id: 7185e089f312a2f437c605082fffbe21dbbff71b
> prerequisite-patch-id: 0ece40c6ba1f7c58f6d86ff3718af8464e48c427
> prerequisite-patch-id: 4ee3c906e49cd213e6f562aa5f47bb66eb8bbc55
> prerequisite-patch-id: da64a389dda13fcc5fd808eab8f7727c2106f300
> prerequisite-patch-id: 11bed9a851381377e1cdca036d087188d8969a52
> prerequisite-patch-id: e03ccbc770ece8b6ca19d326d8132c980ca7dc74
> prerequisite-patch-id: 8cc39b7304152031add2b9183a81bae9d1f536bc
> prerequisite-patch-id: a35812a89502d58aede4389d89fd8bdf31af300c
> prerequisite-patch-id: a72aafd6c0e850fc36e164a5b4ff0c38523d3a79
> prerequisite-patch-id: b29a32a0cf5806aeda206a8e70c4bd480ae9a181
> prerequisite-patch-id: ea780e231dc00b180cfd6627ffeaada67877b60c
> prerequisite-patch-id: c32ead665755fbb0acd8ee35427fb54987b493d6
> prerequisite-patch-id: f6af0b3240064cbe99b8af9f7cc253fc9927b2c5
> prerequisite-patch-id: 0244c21e77478d0feaa1dcfe19504e4601d04efd
> prerequisite-patch-id: 1a929cc7c6c7a1c1fef902eaaa76d0d514192503
> prerequisite-patch-id: 64a7754f8978f34d4b1ca56123b1cf558f4807ce
> prerequisite-patch-id: 2a836f28c8ff5d76e694231391633e9da39e2a7b
> prerequisite-patch-id: 0f0f9fb3c58152149358888610067a1cc314a18f
> prerequisite-patch-id: ee1f374aea0b8f033bedfb3a1ca3fec1906b5c50
> prerequisite-patch-id: 7643d3fbe3bb1a285a7a6b0489126ce078114e72
> prerequisite-patch-id: 80c4751ffacd0f26a2a46242729918a2f84eb443
> prerequisite-patch-id: 94cea2b73a3fc858bbdd8348054472b53117a934
> prerequisite-patch-id: 7c1aeef6f5bcf5eb968bb50bf83c678ad644e4e8
> prerequisite-patch-id: 2b47e9d65ad72abdcf75f7cdfadca029a2131001
> prerequisite-patch-id: 0a4049cbaa75f16f392604af40d2033af52bccab
> prerequisite-patch-id: 4ee78673a8c6385e330e14f5a4abe8b04e32762d
> prerequisite-patch-id: d36ab3205e29262f859cbecc76f6f52aa35dd1b5
> prerequisite-patch-id: c5618024ca01e256f37009a35886823f7afc24ff
> prerequisite-patch-id: 0dd8645413e87a8671e865b12dbae342d134d393
> prerequisite-patch-id: 579d3dff2a34df0ba8a5e5da9b3d631a74843825
> prerequisite-patch-id: 499db6580d8bd4694c9b5fe50a6d18c77404467b
> prerequisite-patch-id: 6d87d08265a9abd7badf29faa2b5dcf0105ce78c
> prerequisite-patch-id: 4dc04d4f2fda0a3d264829dfdb1e73300523b184
> prerequisite-patch-id: 1a061bf66aacf372a420f64b94be34a39432c4bd
> prerequisite-patch-id: c45dc69fd5ed079c8c2b09a0c95e2b23983e1ec4
> prerequisite-patch-id: eed6e08722f92d2ef99951b8388cf26cef7a4c58
> prerequisite-patch-id: afa837d1b04839aab82b94baaf74c85902b68b7e
> prerequisite-patch-id: a263fdc0b74632a6e730fd422aa23cfbac4cff63
> prerequisite-patch-id: 063670d2fc7a5b0e793319a95844a96d0a4fd9b1
> prerequisite-patch-id: 9a341eb3c71da54d7736fc9cc0387ca419a5c485
> prerequisite-patch-id: bac4519fa9366a2fa90819079a2f3942e81de4cb
> prerequisite-patch-id: 955e6817eea5e89e3b63eeac4f0517b6a2476822
> prerequisite-patch-id: e4a24afdbad196771d562ff6e8a08a4fd19941f2
> prerequisite-patch-id: 9e5a80cd530d2a5000ae6f3e7d0b288e2635c41e
> prerequisite-patch-id: 481c3789b8e0ef779a323093bc3e0a3f520078f9
> prerequisite-patch-id: fa0823ebb1e355ca27e554f9342e9297626b0cf0
> prerequisite-patch-id: e2a7ddc8dfb254e3369188ca3e857e676a7ea1f6
> prerequisite-patch-id: 5c225f4b9c5d286e4622f1f830cee67b9c24828a
> prerequisite-patch-id: 25d457958fd5c9788dcfc71a4e82bfe5a611eae7
> prerequisite-patch-id: e0b3cb8bf200146a1511b7ff52e8e870b36e9899
> prerequisite-patch-id: e471651c6c2f3d32d68bdea27a0eb5c00421fed3
> prerequisite-patch-id: 8528882a216fd26ee71dc1a90737324da20e190f
> prerequisite-patch-id: 8265ca5fe33619ba6a593d3d73b700b7fa6a0787
> prerequisite-patch-id: d128841f623519ebbf16d0b2013bd6d8d2a344a3
> prerequisite-patch-id: 97061ba81de0e3c43a659066bed2ac0848bd9d3a
> prerequisite-patch-id: 2a26242501bb0b738ddab5499fe644070e66b4af
> prerequisite-patch-id: ced30181df116d98701bc04d2e6901ec91d97542
> prerequisite-patch-id: 2935f5e473720f67030c37451ae80dac955c00d2
> prerequisite-patch-id: 06eab08587d8961281f9aaf70562d34abd336ef0
> prerequisite-patch-id: 13518fac8068becf7ab2c1bdcf49be63f100fa25
> prerequisite-patch-id: e3712c2bbef46c85b97a6d512dbf13c3abe9834e
> prerequisite-patch-id: d681ba94675eb50b050427b9a2bcb530ef990b45
> prerequisite-patch-id: 5daaeb2d5fd5297b2ba691f571c9ef3125023aff
> prerequisite-patch-id: f773f29e850899ee72bcb31f749ad72d452aaad2
> prerequisite-patch-id: 8ecf5f707fdc23f1ddf62df264edfb624b48a430
> prerequisite-patch-id: 4ca0ca3848305fbb518733e2dd8982d77671f535
> prerequisite-patch-id: 8b6d8c64ef09e66902f4d3617102d5ada39b20bb
> prerequisite-patch-id: fbbeca4b75cc092909112d237ea75c702978ece6
> prerequisite-patch-id: 0e416f0307692954d9ce2b5b80e4a36a003b129c
> prerequisite-patch-id: 8274429d05b09959b95ef3c19483c865da6e0cd5
> prerequisite-patch-id: db81d80faee78da77611dae55843b2f79a941681
> prerequisite-patch-id: 4febde7b63a8e03208bd1edfbf0100f4e9954939
> prerequisite-patch-id: 5b972f691be5501f19c79f2dfffaa1b3cb057b72
> prerequisite-patch-id: e8fdd8d87187e12e69681d6577906d622af00f5f
> prerequisite-patch-id: e1dbb6ce4e71467cd7f255d01cb55c94d79a3fd0
> prerequisite-patch-id: d018725a8d6689851337fbb8a2698cbfc2cfca69
> prerequisite-patch-id: 16da4f631fceb24761c84ba101b3ee2ffbdf044f
> prerequisite-patch-id: 3dca6c4f3bfaf63d7bc76bc11aa0e2b656994516
> prerequisite-patch-id: 6f420ca44b0cc53583a3b097c04b485324b43075
> prerequisite-patch-id: cd44e36e4ed2cacb4db55d4f11d6383051922ca9
> prerequisite-patch-id: e07a600f5248208959254334778bf0853c0cd717
> prerequisite-patch-id: 2527c4b1367b6227de5be06d78974379e1ab0fd0
> prerequisite-patch-id: fe4f27ffc8a76b0db714a2037c022841c472abe3
> prerequisite-patch-id: f7bf903eb8c51ece26153a43032dee1ef39b760a
> prerequisite-patch-id: fc9347a84eea16e4a17a5ff128fae389cb288220
> prerequisite-patch-id: c7f71ba4d07e8ceefbf7633ce08147015bf2a95d
> prerequisite-patch-id: ebff53e7a3d9eed40910e6fb6641bb1e979ac81f
> prerequisite-patch-id: 928523ca9924db1c551ab8cbd369750e98cafb4e
> prerequisite-patch-id: e2ca411820f972282a41a889a070567e09c79e8f
> prerequisite-patch-id: 3e541a9e06abd6eadd3ab8fe2245b877509a35a1
> prerequisite-patch-id: 056f1e30f65fdd7062aedf3865bdfe5d70e302a7
> prerequisite-patch-id: b4e458df5c7c09db5cef50f62bf9dfeb5301a171
> prerequisite-patch-id: 28f03e0f66affc43baa15423c512b48aa91ce0ea
> prerequisite-patch-id: 4d2727d976c6c17c57215f99627281b6e75bab43
> prerequisite-patch-id: 4627109b1cd56b735f480650d3d8b96ff93bd0b4
> prerequisite-patch-id: 53f8e5ee450b232a89b58044657d7c09999fb81e
> prerequisite-patch-id: c08fa1d4db39d27260e433bc4e9d270c41d1d366
> prerequisite-patch-id: 3e7ed439c7bc72fc87933c068a38058175fa634a
> prerequisite-patch-id: 53dfe9a168a5e5c0bd74ec855c7a470980601d46
> prerequisite-patch-id: 31003dd25042bf5b28ca98748aa24fd42100ef8a
> prerequisite-patch-id: 456cc1d197ad65c19f35e1bf8444ee01fdaca43a
> prerequisite-patch-id: 066bbb5e6ec708cdda966750427c76131dce86ed
> prerequisite-patch-id: 17aa7ead1033fed64f30e54d8802a3ba9c1cd6ba
> prerequisite-patch-id: 6dd97f9bc4bf0abac4ef243fe56279dc80410d54
> prerequisite-patch-id: c0d8ae21e4d89725d961d9726503d268436be8f0
> prerequisite-patch-id: 84d193c0fcc876039f0a42d7ba5d97a04fc349be
> prerequisite-patch-id: ac67cf4c14ba9ba5e512543da14f45ea80fbe427
> prerequisite-patch-id: 219d0a2f0d5c44fa7131dc4d2fff495bcd20991c
> prerequisite-patch-id: 976f2d30772c05eb6046d23c4d8bcc001a872c97
> prerequisite-patch-id: e3589d9c224a6b2d7cedc47325cfccffcb0a9fb0
> prerequisite-patch-id: 52a547b930fe93f92896ca77caa08bbae549e350
> prerequisite-patch-id: 7936b29c6c04fb333d8b8868a4f3169061e61fe8
> prerequisite-patch-id: 8bd9598dfe7ef599ff49307d98377feb7b0c3444
> prerequisite-patch-id: b6e21d774b4da07ab6c72b9d2ec51c89e9257073
> prerequisite-patch-id: b7050a41f05a2fbdd18d24af4af040570a5f3439
> prerequisite-patch-id: e7588860c5c1664b5d5e7bccb1edb35e7829009c
> prerequisite-patch-id: ce57950db84414be028283147d4b73d343e9e6bf
> prerequisite-patch-id: 518ca13f3560fc3f132b04c1bd44e2b48b694ee6
> prerequisite-patch-id: ebd2edfe1db2515d08295399c92506a5f29275ed
> prerequisite-patch-id: a7a701a4bf961a7bcaee4c22ba52d261afc3a260
> prerequisite-patch-id: f18ea97771a9d1e8ec68ee58a3321b358214ca87
> prerequisite-patch-id: cecccb908b9a2788474c0a862715eec3849fc4f2
> prerequisite-patch-id: 20ed711568d47ae277312d8f6d71347fd94775d6
> prerequisite-patch-id: ddf1ce229eeac844bd6cf2c06798b2ec2e4615cb
> prerequisite-patch-id: dde6bdf7b554844827d5f0d7fe4929e5dc5b6fdb
> prerequisite-patch-id: 0ef2b52dde653e733afa898001ccde4fd7c73a3d
> prerequisite-patch-id: e2e9438e1f4d46f5bbce5fcf6c7fcb72e5cf8a62
> prerequisite-patch-id: 16fdfa005ee0791d278ceff69926fa680af4fbb8
> prerequisite-patch-id: f7a59bf1a33d733c643fcf1a87a17519fc08683a
> prerequisite-patch-id: ccdd4a455a91375273c92c64af4d8f3c444aba63
> prerequisite-patch-id: 69e3d3e494b5369399cd3da3502b0581fc6c8396
> prerequisite-patch-id: 2b54ad55e5a19de610b95f9d2fd66731076e2b73
> prerequisite-patch-id: 5556b03cb3b79d2056cca8f026db8b42be2155e5
> prerequisite-patch-id: 5bb329960c9a2eff9ebedfdb35d9b28f9b82c82b
> prerequisite-patch-id: 69adac8a810cf032f98c7078b7e0667474f3ea7a
> prerequisite-patch-id: 8df09b22ce9839f5b457510f22449bec40265c72
> prerequisite-patch-id: 04a0db4e442eafc0b7c01baa49ddde14552edb27
> prerequisite-patch-id: 82563e0dcade24ba1b84943c111d1e64a5bab4e5
> prerequisite-patch-id: 4164c4508821ecd370237261f871028e002adc23
> prerequisite-patch-id: f1f48574cbb31242144da1754f59b681204e557b
> prerequisite-patch-id: c6c01da1eeeae3783e95cb7abcc7bdb71f499bcf
> prerequisite-patch-id: 8ccbb0d6c5b8f65e1838cd04eb9109f2c3d2402b
> prerequisite-patch-id: 654aacd0032bf78838b6b6e4b85921999b874476
> prerequisite-patch-id: 41680d6e65f8ff2a5852377b13f700f559dece42
> prerequisite-patch-id: 3ea65a35f5537a5489914209e342de7a9c3c9f54
> prerequisite-patch-id: e578f45e002097efc20a3b867e3a8b410ff4a75c
> prerequisite-patch-id: bf80b29664448c4bcc0bee0e7e0d23388d899d04
> prerequisite-patch-id: ac661509dd5ac20b68960900db611ec95785809e
> prerequisite-patch-id: 472fe4a75666bfca8f0e24abff9d53afe4d66f10
> prerequisite-patch-id: 776c09245281f5430c7d4c3aec62d19e944b7e4e
> prerequisite-patch-id: c8985de925ad5cb1cfb8e4192dd52f8672d77f95
> prerequisite-patch-id: 1da25d35bf6bffb6e95ee12e45dabf0a07a6c259
> prerequisite-patch-id: d2ec9beea48cad9da3bd4ea751a63bf8fa37ad16
> prerequisite-patch-id: ef3ba331c22d832c4c47addd6235bc68c1723449
> prerequisite-patch-id: 8e6dc1da0091f6e421af39ca8ffd81073f798086
> prerequisite-patch-id: cbde629cd2c2d3c0fb8856791240a7d306abb11b
> prerequisite-patch-id: 692dc54bcab5233d12fd13ebd64d34690dd4ca4f
> prerequisite-patch-id: 2e8f1efbd3dbec6ac469dbd8dd76fb514895e6df
> prerequisite-patch-id: d6ddf93c450c80ff8c51a3dfa0dc2f9d4c004351
> prerequisite-patch-id: f165cc2b43a90297b7e5f73c16db711d618c0a0d
> prerequisite-patch-id: d806b51be2e50e5e53dc2bbae271e24feefb8bfd
> prerequisite-patch-id: dbb5aad933a4914906878ce64e1f7f47b5e3e4e3
> prerequisite-patch-id: c89ace683de46835ef7025d1e8d547338b6820b0
> prerequisite-patch-id: 456af31afa1d65e82428e965c9c0fffac76351d8
> prerequisite-patch-id: 536e39837c517f3f7e0281f4eb110f3a91876f42
> prerequisite-patch-id: 7679385d798221056f90ced9b8d90474c765a709
> prerequisite-patch-id: 3a07219239f637cb938692be5d4df8f3a5ed1a99
> prerequisite-patch-id: 5dc2871c02a06f38f50813fee90340b3f64bd512
> prerequisite-patch-id: b6f446e435a87994880b1edf3b877176121daec5
> prerequisite-patch-id: a3176150ed5b11b1ebf65d6416c0936b6c9e1688
> prerequisite-patch-id: 60ecfd7e8e5fdaccc28a49fb6369599063cf6041
> prerequisite-patch-id: 92c3eebca6197f031b4309c2c5a79f59dcdc042d
> prerequisite-patch-id: 3b6994514df38c0eadd1b9e5c9454ec435ba7ddc
> prerequisite-patch-id: da50681df090055cc29111db1c4016f3425dce93
> prerequisite-patch-id: 31344ae9500cbb8ef80a28cf2081459225217cde
> prerequisite-patch-id: fac2736f530d5d3be9f44690d365537a875e45b2
> prerequisite-patch-id: c95dfefcbceec494d10393bba437570de6970754
> prerequisite-patch-id: fd42760815c26a4a518ece232716a90f7b03e6e3
> prerequisite-patch-id: 15f6b599909b2090e78988b2ea17ccf55dc9a163
> prerequisite-patch-id: 614e13cbccd0f62700eda43aef5b104e8e95ff03
> prerequisite-patch-id: ba9e8827204840685f535fe23f7d0565227a8a9a
> prerequisite-patch-id: 67e2b292d975b756242cb2ad727ea25d108e5f99
> prerequisite-patch-id: 937a3fd66340456d52bdc04fc3ec2e48e8cc5336
> prerequisite-patch-id: d56686ed7242695ceefb1492b2ff9081262827dd
> prerequisite-patch-id: 840d28846318720ac79f0dc1deaad344471f6f7e
> prerequisite-patch-id: 8c463c603e01f9efa770b8e360e88c34a0e194c0
> prerequisite-patch-id: b36622cbb14c9185e89f370d40034cb17a3096ce
> prerequisite-patch-id: 6bccb149dddd35a5eb4b2f93f6959f8ee84f379a
> prerequisite-patch-id: 5b537196ffadb7e4213cb4668495925a0c8f9051
> prerequisite-patch-id: 11207c92aab048b73d8df6ff17f05840fea5db94
> prerequisite-patch-id: 2af8ffeb4b096510c66a4dd702b81c700ab0f2cf
> prerequisite-patch-id: ba9bef9d973df799fd080b551681d834abe0704b
> prerequisite-patch-id: 7b6d3c77ae4df9c7e640d8fad1dee449128a347d
> prerequisite-patch-id: f89426f661bcfc829475df696def23bc97552b3e
> prerequisite-patch-id: b983c90c26e055622f32f445003fa88add3c29cf
> prerequisite-patch-id: c73da10a6bbe5d492ff62b3b47ae9a00a9812ab9
> prerequisite-patch-id: 15832333123ee7fa38eea3541d85be7188d6088d
> prerequisite-patch-id: f65926480dec14186812c7e45a0d44c3412a9426
> prerequisite-patch-id: 06244b82611cb8b602c7c751a1cc2e0f3c6d6c39
> prerequisite-patch-id: ee9eaa89b5957bd7b98a0af745192c8e27bc091f
> prerequisite-patch-id: 611b9c5c5269ddd10684879ae8de43e6e1d766b0
> prerequisite-patch-id: 1c795709fd57d227f56edc5316e403eb230babb5
> prerequisite-patch-id: d8acf8ca6d4ccdcaf22180371bd2ea57d73718e1
> prerequisite-patch-id: eab24819de1fc9dbb9c1a34d3807dc1839130232
> prerequisite-patch-id: 6c86169373560d5ed493b355648786ca9357f526
> prerequisite-patch-id: 84b4d6e5cfb121c5a8abc7d41d3ca6523ed5e339
> prerequisite-patch-id: ede3bb9f72733a74a425376234c2cf7d38c7d8bf
> prerequisite-patch-id: c7ff62d96db4d2cdffe6801b08762e415cd1ebdb
> prerequisite-patch-id: 9b4f37b9f9bc0b58fb3700c695dd04f5f6544e2e
> prerequisite-patch-id: 288cd71d639bfa4894287eb944f36ef6116ff742
> prerequisite-patch-id: 488f0ff662cf64e5d7f44b6b5b74193599af9ab8
> prerequisite-patch-id: 84f3b35f389e647977f306d682102839c35a8ab0
> prerequisite-patch-id: fa2e8b3324dea766e5f542e5bc1e5a79cf6ba049
> prerequisite-patch-id: 017dc872171d45afe1018fa793304dbc7782a820
> prerequisite-patch-id: 44ddd56aec008da909b8603bcb9ae0cf10743976
> prerequisite-patch-id: fdb5048667db3098ecc1626c974ae75cec629008
> prerequisite-patch-id: 96ab3acfc435e9d7530e7a9f8926ca5d729fe21a
> prerequisite-patch-id: 81664270365445ba652668f03d9e57479795c7df
> prerequisite-patch-id: eccacedc3fbbf9e9cc51610a157f51780f7ee607
> prerequisite-patch-id: e5ded3d1a9f370d65869ed0957e2fe3d3680ee4d
> prerequisite-patch-id: e84b89ea28e81a19f43984f21c006ce9132edbb9
> prerequisite-patch-id: 36735447019e5c9a8117fc3305558448b49493f5
> prerequisite-patch-id: 41740b15a5d3566aa3cea7e32c043af99ae9d647
> prerequisite-patch-id: c80422ce3398c007ace9e81dcad4e1230c146fa7
> prerequisite-patch-id: 24ec02bd3ebc763a4c21ea6799bd7987fe89a303
> prerequisite-patch-id: 8c662ecb03d7d33010bebcf231763e0b8dc12588
> prerequisite-patch-id: ce08cad5454058d51ca5b51cdfe6f6911f857455
> prerequisite-patch-id: 8eb9dceebf9da2f2ae441099ba4053545c8f6632
> prerequisite-patch-id: d075d95d9f67dddc84ece6008bfefbe474f20d2a
> prerequisite-patch-id: 4d806312ce0aed0f7aeafe04a9a04acad94a1cf8
> prerequisite-patch-id: eeef8c7112776c13004ab4ff11ff4a3ac91c2f28
> prerequisite-patch-id: ffcbdcb39f74b9f73fca84d2f69dea44ebc828a2
> prerequisite-patch-id: c2b5f3a99ff1af80036b17ea734e02960d035e2b
> prerequisite-patch-id: 20ab1ceb376577161a5927dbfba9f77d5456419d
> prerequisite-patch-id: 577d3be3e2d60483020af3c49368e6ab0214542b
> prerequisite-patch-id: 701e790694aa4193b9e79a721f1c9c850fd38404
> prerequisite-patch-id: 1892575a4a8de103accd4631cdc06579f3756a3f
> prerequisite-patch-id: f913fbe787ac152ffc85cab397ba1964bb453fbe
> prerequisite-patch-id: a1197fb938aeef4267e3c1431833d0a0bf5d05c5
> prerequisite-patch-id: ddbff3674c2d6d5bba6182e87e9f94bdb4aaa286
> prerequisite-patch-id: 93261fa0817e8783a88518bfc22b6a0e17eb0fad
> prerequisite-patch-id: d5643561620c8c22230dc98323af1f4981e57b2a
> prerequisite-patch-id: 9991333653680250c88a751d6f40e3c7d860fe00
> prerequisite-patch-id: 26771207dab3f5350b9ceafabeb6aab1c9067fb8
> prerequisite-patch-id: d8b0e3e82bc23cbefca6424357ddeb4ff5c56f71
> prerequisite-patch-id: 8598986ae890f6bb5ce40c6d0d6d492946c0556e
> prerequisite-patch-id: 229e06c5d4549b802b052d0ed3ef38ba4f884bda
> prerequisite-patch-id: e490406bffdda4a1ce087a35f297f9b09e1e09af
> prerequisite-patch-id: 31c64a958d6a72ede489a295b82b973fb5ae89aa
> prerequisite-patch-id: 1c14b1c1e0864ed209606f956bae444f323df23b
> prerequisite-patch-id: b17834e99e522665a8fe22c7c81ab157798a6acc
> prerequisite-patch-id: fed728a689b33dc67fcf66f0d68f7040075594b9
> prerequisite-patch-id: f40a435bb3b586ecd71c134ecb87cb89fdf6c0fc
> prerequisite-patch-id: 20c265682e66fb85d4dffd43213d7daec411003c
> prerequisite-patch-id: a451d1115e6c4bd4a89d15c66226209abbb66b78
> prerequisite-patch-id: d24dc6d9d82b1f4ceee3ee280ace4d4f70d1eea4
> prerequisite-patch-id: 922d294b46da5780cf547182c44e3d79bbc2b425
> prerequisite-patch-id: f56f6ac263fd2fc1d5544be3f8ea2d7b98b71fb5
> prerequisite-patch-id: 30996e0bb7b52c481b533148ccdb6cb0b8155a80
> prerequisite-patch-id: f02c49d98ff1c907ea0fe18810c31f170ede1bb5
> prerequisite-patch-id: c35bc41858fbcafcd7e1ea7ad9e3244728d0d206
> prerequisite-patch-id: 7ea803e30b70fdab3403f44042f28c4696a4eb31
> prerequisite-patch-id: 37187c54568da5d00272531a30dbfd384498dd79
> prerequisite-patch-id: fea02201f9f7da3f98fd1308770cf141736d7ed2
> prerequisite-patch-id: 2785d578dd02e6ea7a96c1bb1677bbabf723e5c3
> prerequisite-patch-id: 576f23a2ac4932a25e6a5cea5c20a119fa1d0e6a
> prerequisite-patch-id: e0b43a6b47f2f1ffa3b15a472212a4506914e6f9
> prerequisite-patch-id: 258df503125b04dd9993bf43cfc0677de5e89be3
> prerequisite-patch-id: 8b470ebf6fd3f246a1e49e50bae7a4afa59c913b
> prerequisite-patch-id: 0461b3073467a18df15a5ff640f44a989e9c2c0b
> prerequisite-patch-id: 21c6dcd72ee2a005352c498ed279bfe8e2930510
> prerequisite-patch-id: 2b9dcbaec981f509a7e96a739e3e32845d1fa24b
> prerequisite-patch-id: 7e3208a7f1759fd09dc33e8c9aaaf700a05efbf8
> prerequisite-patch-id: 81b8ac6bd8134c7afe5c9c5222f855827b3d7787
> prerequisite-patch-id: bea85ef0db7ff762e3b3a854a626525b64f0daa5
> prerequisite-patch-id: 4f8798e504933e039a09cdac778b4dc6b3661b27
> prerequisite-patch-id: c5279ce9c9dc0fe3cc21426c4cefa20fe788c42a
> prerequisite-patch-id: 575f47264cc4247d494d15dd00c06c3ded1766ea
> prerequisite-patch-id: bc6aebd34031d71c7be6f8355e4cb42c8f7b786e
> prerequisite-patch-id: cdc7bc4c06a416f4910f3c1675ee436ddfdbeb83
> prerequisite-patch-id: 7e7e1261a49533efbe5e852c6af5a02c5ca36bc9
> prerequisite-patch-id: b3b8b537a4bb868efbc5b947d7e01f9cada2b7ac
> prerequisite-patch-id: 32c7d7471e50b2bf8fdc3f9b1aa9e14db2bcbf37
> prerequisite-patch-id: c5bb81eaf7c7b17b63be7b744022daa1b92cd3b7
> prerequisite-patch-id: c56dd39e1788b99d3543c822918051a0bf887ba2
> prerequisite-patch-id: b42b73bcde32aafb7d9a6ef5ba7f26f17bd8db59
> prerequisite-patch-id: 42efac5083e94a1d42635e011d917c5d18e9be27
> prerequisite-patch-id: 683965db767419abfebebf55e9afe543a793e6d8
> prerequisite-patch-id: f1c4002fa9c3516a9c5b46b89e481f5d552636ea
> prerequisite-patch-id: a1961e7ed732ac5a2daa3224280ff23bbd8168fe
> prerequisite-patch-id: d657fc24bfcbf9a43866aee1f4cd729982382ec3
> prerequisite-patch-id: cc0515a3ab19699883fee4c83b13112660cbf239
> prerequisite-patch-id: 0ae4961bf8a9733e50b507e8aea57f6b5bf2344c
> prerequisite-patch-id: f837adcf95110f21134de04863fcc29bb4382b17
> prerequisite-patch-id: 4338b960395ae158ac74401be877ee69af53d076
> prerequisite-patch-id: e00a92f7ba700bb3124b2d307330c3a0db018328
> prerequisite-patch-id: 9985702bd7ababc66ec9df777efb151ad51a9ad3
> prerequisite-patch-id: cd2be8a751fe6b5d14448405efd7dc37b42cfadd
> prerequisite-patch-id: ce5b6e5f14f076a995c16471a07db8e5e0c00f97
> prerequisite-patch-id: d6a1672686ece56d69739def59602b8a0b98c942
> prerequisite-patch-id: da601b7472a1b1fa2bb8e7b4e637852cd73b2997
> prerequisite-patch-id: 51e520d6f14c3ac9995cf7a306df01b04a9ff70f
> prerequisite-patch-id: fa4321957bfd59bc4ad0b49daf795201d9092b6c
> prerequisite-patch-id: d8227b1eb3ecbcb6e9141ece6a0bc849bd0f3643
> prerequisite-patch-id: cb03a406fff6d8c41860cee892a2affa1efdb7e4
> prerequisite-patch-id: a3c8abcf1f03017ed5a35945f9a876929ab0893f
> prerequisite-patch-id: 449f73baf6f6222d3b4498ebc46f9284922594f6
> prerequisite-patch-id: 1159473e2aec02edddd624dfbd6b74ce58eac9fb
> prerequisite-patch-id: 124e5f0304a8d702eee4558f2d45caa08d3d9948
> prerequisite-patch-id: 84faa8bf25a31c1120b3982e9c8fa90552c9e7bc
> prerequisite-patch-id: 2b7cc6947b034902e3834b70202d75a1a7394e10
> prerequisite-patch-id: f2328625ae2193c3c8e336b154b62030940cece8
> prerequisite-patch-id: 5a00737b1f20b86865e5e99c3cbea27de9ae8438
> prerequisite-patch-id: c1723ec04df1fcfcdab13447ab574aa6423c567f
> prerequisite-patch-id: 857a8e829413a285adde8881468fd52f1e2019c1
> prerequisite-patch-id: a0e43d95e98b20be3cc6e260ef436da026c9b42f
> prerequisite-patch-id: 4c9d15f7b9d2732fec205ab0c3e18aa0904d9d63
> prerequisite-patch-id: 4cf8e4cb3d11fa7269b4781e9839500a22094c86
> prerequisite-patch-id: 143b73d94d7ba5130e229c269ea41ce192bb0bf0
> prerequisite-patch-id: bd3e6b52b02d5937eb9084da3bfd5014c801ab93
> prerequisite-patch-id: a63f7ac4e4e6eacfa5810bfb03b7369f7d010a23
> prerequisite-patch-id: a70eb8f4c1a57b1dd8928c70d694bcd7d51483c0
> prerequisite-patch-id: 555dd4f8f7da8ba8b7e7c10e96116c445e497c33
> prerequisite-patch-id: cf950631402b9f5d61f32f2a37b1b073719847d4
> prerequisite-patch-id: cd2377dfb0b4d63839101e674ebe3604ddb8a518
> prerequisite-patch-id: 84318df68e1bc99a62363f70f6f0e059855b9be7
> prerequisite-patch-id: 5c07ef2a50cecc614b6a61a0d8f6a4f951509428

I just noticed that I bumped the kernel to v6.7-rc5, but while formatting the
patch I re-used the old command with the old --base. So git dutifully
generated all the prerequisite-patch-id. So be informed that this is rebased on
top of v6.7-rc5.

Regards,

Andrzej

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-12 19:05     ` [PATCH v4] " Andrzej Pietrasiewicz
  2023-12-14  6:40       ` Andrzej Pietrasiewicz
@ 2023-12-15 12:47       ` Greg Kroah-Hartman
  2023-12-15 13:09         ` Andrzej Pietrasiewicz
  2023-12-15 13:16       ` [PATCH v5] " Andrzej Pietrasiewicz
  2 siblings, 1 reply; 17+ messages in thread
From: Greg Kroah-Hartman @ 2023-12-15 12:47 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz
  Cc: linux-usb, Laurent Pinchart, Daniel Scally, Michael Grzeschik,
	kernel

On Tue, Dec 12, 2023 at 08:05:17PM +0100, Andrzej Pietrasiewicz wrote:
> commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
> 
> has rendered the precomposed (aka legacy) webcam gadget unloadable.

Why the extra blank line here?

> base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a
> prerequisite-patch-id: 5ebe1b40adede82d8413ff25a9e69f3e6b9fdfa6
> prerequisite-patch-id: 0525706498a65e3ffe25cb6ee19462da9ae6f5b5

<long lines sniped>

That's crazy, are they all really needed?

confused,

greg k-h

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v4] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-15 12:47       ` Greg Kroah-Hartman
@ 2023-12-15 13:09         ` Andrzej Pietrasiewicz
  0 siblings, 0 replies; 17+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-12-15 13:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-usb, Laurent Pinchart, Daniel Scally, Michael Grzeschik,
	kernel

Hi Greg,

W dniu 15.12.2023 o 13:47, Greg Kroah-Hartman pisze:
> On Tue, Dec 12, 2023 at 08:05:17PM +0100, Andrzej Pietrasiewicz wrote:
>> commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
>>
>> has rendered the precomposed (aka legacy) webcam gadget unloadable.
> 
> Why the extra blank line here?

Readability? No problem deleting it, though.

> 
>> base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a
>> prerequisite-patch-id: 5ebe1b40adede82d8413ff25a9e69f3e6b9fdfa6
>> prerequisite-patch-id: 0525706498a65e3ffe25cb6ee19462da9ae6f5b5
> 
> <long lines sniped>
> 
> That's crazy, are they all really needed?
> 

I already explained that the patch was rebased on top of v6.7-rc5 and,
consequently, these were not needed.

Sending a v5.

Regards,

Andrzej

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v5] usb: gadget: webcam: Make g_webcam loadable again
  2023-12-12 19:05     ` [PATCH v4] " Andrzej Pietrasiewicz
  2023-12-14  6:40       ` Andrzej Pietrasiewicz
  2023-12-15 12:47       ` Greg Kroah-Hartman
@ 2023-12-15 13:16       ` Andrzej Pietrasiewicz
  2 siblings, 0 replies; 17+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-12-15 13:16 UTC (permalink / raw)
  To: linux-usb
  Cc: Laurent Pinchart, Daniel Scally, Greg Kroah-Hartman,
	Michael Grzeschik, Andrzej Pietrasiewicz, kernel

commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
has rendered the precomposed (aka legacy) webcam gadget unloadable.

uvc_alloc() since then has depended on certain config groups being
available in configfs tree related to the UVC function. However, legacy
gadgets do not create anything in configfs, so uvc_alloc() must fail
with -ENOENT no matter what.

This patch mimics the required configfs hierarchy to satisfy the code which
inspects formats and frames found in uvcg_streaming_header.

This has been tested with guvcview on the host side, using vivid as a
source of video stream on the device side and using the userspace program
found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
---
v4..v5:
- removed an unnecessary blank line in the commit message body
- used a correct --base while generating the patch

v3..v4:
- silenced "initializer element is not constant" warnings on old
  compiles (created and used a bunch of #defines instead of referring
  to a static constr struct /members/, which in the C language is not
  considered const)

v2..v3:
- fixed another typo (actually use uvcg_frame_mjpeg_720p where it should
  be used instead of its 360p counterpart)
- eliminated sparse warnings by reverting the effect of cpu_to_le[16|32]
  while assigning to uvcg_frame members

v1..v2:
- fixed a typo (missing character) in one of uvcg_frame_mjpeg_720p's members

 drivers/usb/gadget/function/f_uvc.c |  45 ++--
 drivers/usb/gadget/function/u_uvc.h |   6 +
 drivers/usb/gadget/legacy/webcam.c  | 333 +++++++++++++++++++++-------
 3 files changed, 284 insertions(+), 100 deletions(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 786379f1b7b7..3b46de85ca01 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -960,7 +960,8 @@ static void uvc_free(struct usb_function *f)
 	struct uvc_device *uvc = to_uvc(f);
 	struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts,
 					       func_inst);
-	config_item_put(&uvc->header->item);
+	if (!opts->header)
+		config_item_put(&uvc->header->item);
 	--opts->refcnt;
 	kfree(uvc);
 }
@@ -1052,25 +1053,29 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
 	uvc->desc.hs_streaming = opts->hs_streaming;
 	uvc->desc.ss_streaming = opts->ss_streaming;
 
-	streaming = config_group_find_item(&opts->func_inst.group, "streaming");
-	if (!streaming)
-		goto err_config;
-
-	header = config_group_find_item(to_config_group(streaming), "header");
-	config_item_put(streaming);
-	if (!header)
-		goto err_config;
-
-	h = config_group_find_item(to_config_group(header), "h");
-	config_item_put(header);
-	if (!h)
-		goto err_config;
-
-	uvc->header = to_uvcg_streaming_header(h);
-	if (!uvc->header->linked) {
-		mutex_unlock(&opts->lock);
-		kfree(uvc);
-		return ERR_PTR(-EBUSY);
+	if (opts->header) {
+		uvc->header = opts->header;
+	} else {
+		streaming = config_group_find_item(&opts->func_inst.group, "streaming");
+		if (!streaming)
+			goto err_config;
+
+		header = config_group_find_item(to_config_group(streaming), "header");
+		config_item_put(streaming);
+		if (!header)
+			goto err_config;
+
+		h = config_group_find_item(to_config_group(header), "h");
+		config_item_put(header);
+		if (!h)
+			goto err_config;
+
+		uvc->header = to_uvcg_streaming_header(h);
+		if (!uvc->header->linked) {
+			mutex_unlock(&opts->lock);
+			kfree(uvc);
+			return ERR_PTR(-EBUSY);
+		}
 	}
 
 	uvc->desc.extension_units = &opts->extension_units;
diff --git a/drivers/usb/gadget/function/u_uvc.h b/drivers/usb/gadget/function/u_uvc.h
index 1ce58f61253c..3ac392cbb779 100644
--- a/drivers/usb/gadget/function/u_uvc.h
+++ b/drivers/usb/gadget/function/u_uvc.h
@@ -98,6 +98,12 @@ struct f_uvc_opts {
 	 */
 	struct mutex			lock;
 	int				refcnt;
+
+	/*
+	 * Only for legacy gadget. Shall be NULL for configfs-composed gadgets,
+	 * which is guaranteed by alloc_inst implementation of f_uvc doing kzalloc.
+	 */
+	struct uvcg_streaming_header	*header;
 };
 
 #endif /* U_UVC_H */
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
index c06dd1af7a0c..c395438d3978 100644
--- a/drivers/usb/gadget/legacy/webcam.c
+++ b/drivers/usb/gadget/legacy/webcam.c
@@ -12,6 +12,7 @@
 #include <linux/usb/video.h>
 
 #include "u_uvc.h"
+#include "uvc_configfs.h"
 
 USB_GADGET_COMPOSITE_OPTIONS();
 
@@ -84,8 +85,6 @@ static struct usb_device_descriptor webcam_device_descriptor = {
 	.bNumConfigurations	= 0, /* dynamic */
 };
 
-DECLARE_UVC_HEADER_DESCRIPTOR(1);
-
 static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
 	.bLength		= UVC_DT_HEADER_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -158,43 +157,112 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
 	.bmaControls[1][0]	= 4,
 };
 
-static const struct uvc_format_uncompressed uvc_format_yuv = {
-	.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
-	.bFormatIndex		= 1,
-	.bNumFrameDescriptors	= 2,
-	.guidFormat		=
-		{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
-		 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71},
-	.bBitsPerPixel		= 16,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static const struct uvcg_color_matching uvcg_color_matching = {
+	.desc = {
+		.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_COLORFORMAT,
+		.bColorPrimaries	= 1,
+		.bTransferCharacteristics	= 1,
+		.bMatrixCoefficients	= 4,
+	},
+};
+
+static struct uvcg_uncompressed uvcg_format_yuv = {
+	.fmt = {
+		.type			= UVCG_UNCOMPRESSED,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
+		.bFormatIndex		= 1,
+		.bNumFrameDescriptors	= 2,
+		.guidFormat		= {
+			'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
+			 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
+		},
+		.bBitsPerPixel		= 16,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_yuv = {
+	.fmt = &uvcg_format_yuv.fmt,
 };
 
 DECLARE_UVC_FRAME_UNCOMPRESSED(1);
 DECLARE_UVC_FRAME_UNCOMPRESSED(3);
 
+#define UVCG_WIDTH_360P			640
+#define UVCG_HEIGHT_360P		360
+#define UVCG_MIN_BITRATE_360P		18432000
+#define UVCG_MAX_BITRATE_360P		55296000
+#define UVCG_MAX_VIDEO_FB_SZ_360P	460800
+#define UVCG_FRM_INTERV_0_360P		666666
+#define UVCG_FRM_INTERV_1_360P		1000000
+#define UVCG_FRM_INTERV_2_360P		5000000
+#define UVCG_DEFAULT_FRM_INTERV_360P	UVCG_FRM_INTERV_0_360P
+
 static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
 	.bDescriptorSubType	= UVC_VS_FRAME_UNCOMPRESSED,
 	.bFrameIndex		= 1,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(640),
-	.wHeight		= cpu_to_le16(360),
-	.dwMinBitRate		= cpu_to_le32(18432000),
-	.dwMaxBitRate		= cpu_to_le32(55296000),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(460800),
-	.dwDefaultFrameInterval	= cpu_to_le32(666666),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_360P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_360P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_360P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_360P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_360P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_360P),
 	.bFrameIntervalType	= 3,
-	.dwFrameInterval[0]	= cpu_to_le32(666666),
-	.dwFrameInterval[1]	= cpu_to_le32(1000000),
-	.dwFrameInterval[2]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_360P),
+	.dwFrameInterval[1]	= cpu_to_le32(UVCG_FRM_INTERV_1_360P),
+	.dwFrameInterval[2]	= cpu_to_le32(UVCG_FRM_INTERV_2_360P),
+};
+
+static u32 uvcg_frame_yuv_360p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_360P,
+	[1] = UVCG_FRM_INTERV_1_360P,
+	[2] = UVCG_FRM_INTERV_2_360P,
+};
+
+static const struct uvcg_frame uvcg_frame_yuv_360p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_UNCOMPRESSED,
+		.b_frame_index			= 1,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_360P,
+		.w_height			= UVCG_HEIGHT_360P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_360P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_360P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_360P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_360P,
+		.b_frame_interval_type		= 3,
+	},
+	.dw_frame_interval	= uvcg_frame_yuv_360p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_360p,
 };
+#define UVCG_WIDTH_720P			1280
+#define UVCG_HEIGHT_720P		720
+#define UVCG_MIN_BITRATE_720P		29491200
+#define UVCG_MAX_BITRATE_720P		29491200
+#define UVCG_MAX_VIDEO_FB_SZ_720P	1843200
+#define UVCG_FRM_INTERV_0_720P		5000000
+#define UVCG_DEFAULT_FRM_INTERV_720P	UVCG_FRM_INTERV_0_720P
 
 static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
@@ -202,28 +270,66 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_UNCOMPRESSED,
 	.bFrameIndex		= 2,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(1280),
-	.wHeight		= cpu_to_le16(720),
-	.dwMinBitRate		= cpu_to_le32(29491200),
-	.dwMaxBitRate		= cpu_to_le32(29491200),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(1843200),
-	.dwDefaultFrameInterval	= cpu_to_le32(5000000),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_720P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_720P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_720P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_720P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_720P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_720P),
 	.bFrameIntervalType	= 1,
-	.dwFrameInterval[0]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_720P),
 };
 
-static const struct uvc_format_mjpeg uvc_format_mjpg = {
-	.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
-	.bFormatIndex		= 2,
-	.bNumFrameDescriptors	= 2,
-	.bmFlags		= 0,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static u32 uvcg_frame_yuv_720p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_720P,
+};
+
+static const struct uvcg_frame uvcg_frame_yuv_720p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_UNCOMPRESSED,
+		.b_frame_index			= 2,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_720P,
+		.w_height			= UVCG_HEIGHT_720P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_720P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_720P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_720P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_720P,
+		.b_frame_interval_type		= 1,
+	},
+	.dw_frame_interval	= uvcg_frame_yuv_720p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_720p,
+};
+
+static struct uvcg_mjpeg uvcg_format_mjpeg = {
+	.fmt = {
+		.type			= UVCG_MJPEG,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
+		.bFormatIndex		= 2,
+		.bNumFrameDescriptors	= 2,
+		.bmFlags		= 0,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_mjpeg = {
+	.fmt = &uvcg_format_mjpeg.fmt,
 };
 
 DECLARE_UVC_FRAME_MJPEG(1);
@@ -235,16 +341,45 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_MJPEG,
 	.bFrameIndex		= 1,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(640),
-	.wHeight		= cpu_to_le16(360),
-	.dwMinBitRate		= cpu_to_le32(18432000),
-	.dwMaxBitRate		= cpu_to_le32(55296000),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(460800),
-	.dwDefaultFrameInterval	= cpu_to_le32(666666),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_360P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_360P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_360P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_360P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_360P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_360P),
 	.bFrameIntervalType	= 3,
-	.dwFrameInterval[0]	= cpu_to_le32(666666),
-	.dwFrameInterval[1]	= cpu_to_le32(1000000),
-	.dwFrameInterval[2]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_360P),
+	.dwFrameInterval[1]	= cpu_to_le32(UVCG_FRM_INTERV_1_360P),
+	.dwFrameInterval[2]	= cpu_to_le32(UVCG_FRM_INTERV_2_360P),
+};
+
+static u32 uvcg_frame_mjpeg_360p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_360P,
+	[1] = UVCG_FRM_INTERV_1_360P,
+	[2] = UVCG_FRM_INTERV_2_360P,
+};
+
+static const struct uvcg_frame uvcg_frame_mjpeg_360p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_MJPEG_SIZE(3),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_MJPEG,
+		.b_frame_index			= 1,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_360P,
+		.w_height			= UVCG_HEIGHT_360P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_360P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_360P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_360P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_360P,
+		.b_frame_interval_type		= 3,
+	},
+	.dw_frame_interval	= uvcg_frame_mjpeg_360p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
 };
 
 static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
@@ -253,23 +388,44 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_MJPEG,
 	.bFrameIndex		= 2,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(1280),
-	.wHeight		= cpu_to_le16(720),
-	.dwMinBitRate		= cpu_to_le32(29491200),
-	.dwMaxBitRate		= cpu_to_le32(29491200),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(1843200),
-	.dwDefaultFrameInterval	= cpu_to_le32(5000000),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_720P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_720P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_720P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_720P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_720P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_720P),
 	.bFrameIntervalType	= 1,
-	.dwFrameInterval[0]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_720P),
 };
 
-static const struct uvc_color_matching_descriptor uvc_color_matching = {
-	.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_COLORFORMAT,
-	.bColorPrimaries	= 1,
-	.bTransferCharacteristics	= 1,
-	.bMatrixCoefficients	= 4,
+static u32 uvcg_frame_mjpeg_720p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_720P,
+};
+
+static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_MJPEG_SIZE(1),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_MJPEG,
+		.b_frame_index			= 2,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_720P,
+		.w_height			= UVCG_HEIGHT_720P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_720P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_720P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_720P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_720P,
+		.b_frame_interval_type		= 1,
+	},
+	.dw_frame_interval	= uvcg_frame_mjpeg_720p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_720p,
+};
+
+static struct uvcg_streaming_header uvcg_streaming_header = {
 };
 
 static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
@@ -290,40 +446,40 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
 
 static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
@@ -387,6 +543,23 @@ webcam_bind(struct usb_composite_dev *cdev)
 	uvc_opts->hs_streaming = uvc_hs_streaming_cls;
 	uvc_opts->ss_streaming = uvc_ss_streaming_cls;
 
+	INIT_LIST_HEAD(&uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_360p.entry, &uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_720p.entry, &uvcg_format_yuv.fmt.frames);
+	uvcg_format_yuv.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_360p.entry, &uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_720p.entry, &uvcg_format_mjpeg.fmt.frames);
+	uvcg_format_mjpeg.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_yuv.entry, &uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_mjpeg.entry, &uvcg_streaming_header.formats);
+	uvcg_streaming_header.num_fmt = 2;
+
+	uvc_opts->header = &uvcg_streaming_header;
+
 	/* Allocate string descriptor numbers ... note that string contents
 	 * can be overridden by the composite_dev glue.
 	 */

base-commit: a39b6ac3781d46ba18193c9dbb2110f31e9bffe9
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-12-15 13:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 12:52 [PATCH] usb: gadget: webcam: Make g_webcam loadable again Andrzej Pietrasiewicz
2023-12-08 13:13 ` [PATCH v2] " Andrzej Pietrasiewicz
2023-12-08 23:56   ` kernel test robot
2023-12-09 10:20   ` kernel test robot
2023-12-09 10:41   ` kernel test robot
2023-12-09 22:17   ` kernel test robot
2023-12-11 12:38   ` [PATCH v3] " Andrzej Pietrasiewicz
2023-12-11 20:47     ` kernel test robot
2023-12-11 21:53     ` kernel test robot
2023-12-12 17:01       ` Andrzej Pietrasiewicz
2023-12-12 18:22         ` Laurent Pinchart
2023-12-12 19:05     ` [PATCH v4] " Andrzej Pietrasiewicz
2023-12-14  6:40       ` Andrzej Pietrasiewicz
2023-12-15 12:47       ` Greg Kroah-Hartman
2023-12-15 13:09         ` Andrzej Pietrasiewicz
2023-12-15 13:16       ` [PATCH v5] " Andrzej Pietrasiewicz
2023-12-08 13:22 ` [PATCH] " Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox