diff mbox series

[v2,1/2] uvcvideo: rename UVC_QUIRK_INFO to UVC_INFO_QUIRK

Message ID alpine.DEB.2.20.1808031334440.13762@axis700.grange (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] uvcvideo: rename UVC_QUIRK_INFO to UVC_INFO_QUIRK | expand

Commit Message

Guennadi Liakhovetski Aug. 3, 2018, 11:36 a.m. UTC
This macro defines "information about quirks," not "quirks for
information."

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
---
 drivers/media/usb/uvc/uvc_driver.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Nicolas Dufresne Aug. 4, 2018, 3:58 p.m. UTC | #1
Le vendredi 03 août 2018 à 13:36 +0200, Guennadi Liakhovetski a écrit :
> This macro defines "information about quirks," not "quirks for
> information."

Does not sound better to me. It's "Quirk's information", vs
"information about quirks". I prefer the first one. In term of C
namespace the orignal is also better. So the name space is UVC_QUIRK,
and the detail is INFO.

If we where to apply your logic, you'd rename driver_info, into
info_driver, because it's information about the driver.

> 
> Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com
> >
> ---
>  drivers/media/usb/uvc/uvc_driver.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c
> b/drivers/media/usb/uvc/uvc_driver.c
> index d46dc43..699984b 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -2344,7 +2344,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	.quirks = UVC_QUIRK_FORCE_Y8,
>  };
>  
> -#define UVC_QUIRK_INFO(q) (kernel_ulong_t)&(struct
> uvc_device_info){.quirks = q}
> +#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct
> uvc_device_info){.quirks = q}
>  
>  /*
>   * The Logitech cameras listed below have their interface class set
> to
> @@ -2453,7 +2453,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		=
> UVC_QUIRK_INFO(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
> +	  .driver_info		=
> UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
>  	/* Chicony CNF7129 (Asus EEE 100HE) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> @@ -2462,7 +2462,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		=
> UVC_QUIRK_INFO(UVC_QUIRK_RESTRICT_FRAME_RATE) },
> +	  .driver_info		=
> UVC_INFO_QUIRK(UVC_QUIRK_RESTRICT_FRAME_RATE) },
>  	/* Alcor Micro AU3820 (Future Boy PC USB Webcam) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> @@ -2525,7 +2525,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		=
> UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		=
> UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
>  					| UVC_QUIRK_BUILTIN_ISIGHT) },
>  	/* Apple Built-In iSight via iBridge */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2607,7 +2607,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		=
> UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		=
> UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
>  					| UVC_QUIRK_PROBE_DEF) },
>  	/* IMC Networks (Medion Akoya) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2707,7 +2707,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		=
> UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		=
> UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
>  					| UVC_QUIRK_PROBE_EXTRAFIELDS)
> },
>  	/* Aveo Technology USB 2.0 Camera (Tasco USB Microscope) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2725,7 +2725,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		=
> UVC_QUIRK_INFO(UVC_QUIRK_PROBE_EXTRAFIELDS) },
> +	  .driver_info		=
> UVC_INFO_QUIRK(UVC_QUIRK_PROBE_EXTRAFIELDS) },
>  	/* Manta MM-353 Plako */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> @@ -2771,7 +2771,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		=
> UVC_QUIRK_INFO(UVC_QUIRK_STATUS_INTERVAL) },
> +	  .driver_info		=
> UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
>  	/* MSI StarCam 370i */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> @@ -2798,7 +2798,7 @@ static int uvc_clock_param_set(const char *val,
> const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		=
> UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		=
> UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
>  					|
> UVC_QUIRK_IGNORE_SELECTOR_UNIT) },
>  	/* Oculus VR Positional Tracker DK2 */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
Guennadi Liakhovetski Aug. 20, 2018, 6:45 a.m. UTC | #2
Hi Laurent,

As far as I understand we've missed the 4.19 cycle. Can we move on with 
this please?

Thanks
Guennadi

On Fri, 3 Aug 2018, Guennadi Liakhovetski wrote:

> This macro defines "information about quirks," not "quirks for
> information."
> 
> Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
> ---
>  drivers/media/usb/uvc/uvc_driver.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index d46dc43..699984b 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -2344,7 +2344,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	.quirks = UVC_QUIRK_FORCE_Y8,
>  };
>  
> -#define UVC_QUIRK_INFO(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
> +#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
>  
>  /*
>   * The Logitech cameras listed below have their interface class set to
> @@ -2453,7 +2453,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
>  	/* Chicony CNF7129 (Asus EEE 100HE) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> @@ -2462,7 +2462,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_RESTRICT_FRAME_RATE) },
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTRICT_FRAME_RATE) },
>  	/* Alcor Micro AU3820 (Future Boy PC USB Webcam) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> @@ -2525,7 +2525,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
>  					| UVC_QUIRK_BUILTIN_ISIGHT) },
>  	/* Apple Built-In iSight via iBridge */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2607,7 +2607,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
>  					| UVC_QUIRK_PROBE_DEF) },
>  	/* IMC Networks (Medion Akoya) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2707,7 +2707,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
>  					| UVC_QUIRK_PROBE_EXTRAFIELDS) },
>  	/* Aveo Technology USB 2.0 Camera (Tasco USB Microscope) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2725,7 +2725,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_EXTRAFIELDS) },
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_EXTRAFIELDS) },
>  	/* Manta MM-353 Plako */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> @@ -2771,7 +2771,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_STATUS_INTERVAL) },
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
>  	/* MSI StarCam 370i */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> @@ -2798,7 +2798,7 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  	  .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
>  					| UVC_QUIRK_IGNORE_SELECTOR_UNIT) },
>  	/* Oculus VR Positional Tracker DK2 */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> -- 
> 1.9.3
> 
>
Laurent Pinchart Aug. 20, 2018, 11:38 a.m. UTC | #3
Hi Nicolas,

On Saturday, 4 August 2018 18:58:18 EEST Nicolas Dufresne wrote:
> Le vendredi 03 août 2018 à 13:36 +0200, Guennadi Liakhovetski a écrit :
> > This macro defines "information about quirks," not "quirks for
> > information."
> 
> Does not sound better to me. It's "Quirk's information", vs
> "information about quirks". I prefer the first one. In term of C
> namespace the orignal is also better. So the name space is UVC_QUIRK,
> and the detail is INFO.
> 
> If we where to apply your logic, you'd rename driver_info, into
> info_driver, because it's information about the driver.

The macro initializes an info structure with the .quirks field. We'll need a 
similar macro that will set the .meta_format field, and I proposed naming it 
UVC_INFO_META, hence the rename of this macro.

The alternative would be to call the two macros UVC_QUIRK_INFO and 
UVC_META_INFO, but I don't think that would be a good idea. All the macros 
that initialize an info structure should start with the same UVC_INFO_ prefix.

> > Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com
> > 
> > ---
> > 
> >  drivers/media/usb/uvc/uvc_driver.c | 18 +++++++++---------
> >  1 file changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c
> > b/drivers/media/usb/uvc/uvc_driver.c
> > index d46dc43..699984b 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -2344,7 +2344,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	.quirks = UVC_QUIRK_FORCE_Y8,
> >  
> >  };
> > 
> > -#define UVC_QUIRK_INFO(q) (kernel_ulong_t)&(struct
> > uvc_device_info){.quirks = q}
> > +#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct
> > uvc_device_info){.quirks = q}
> > 
> >  /*
> >  
> >   * The Logitech cameras listed below have their interface class set
> > 
> > to
> > @@ -2453,7 +2453,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	  .bInterfaceClass	= USB_CLASS_VIDEO,
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		=
> > UVC_QUIRK_INFO(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
> > +	  .driver_info		=
> > UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
> > 
> >  	/* Chicony CNF7129 (Asus EEE 100HE) */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> >  	
> >  				| USB_DEVICE_ID_MATCH_INT_INFO,
> > 
> > @@ -2462,7 +2462,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	  .bInterfaceClass	= USB_CLASS_VIDEO,
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		=
> > UVC_QUIRK_INFO(UVC_QUIRK_RESTRICT_FRAME_RATE) },
> > +	  .driver_info		=
> > UVC_INFO_QUIRK(UVC_QUIRK_RESTRICT_FRAME_RATE) },
> > 
> >  	/* Alcor Micro AU3820 (Future Boy PC USB Webcam) */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> >  	
> >  				| USB_DEVICE_ID_MATCH_INT_INFO,
> > 
> > @@ -2525,7 +2525,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	  .bInterfaceClass	= USB_CLASS_VIDEO,
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		=
> > UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> > +	  .driver_info		=
> > UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> > 
> >  					| UVC_QUIRK_BUILTIN_ISIGHT) },
> >  	
> >  	/* Apple Built-In iSight via iBridge */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> > 
> > @@ -2607,7 +2607,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	  .bInterfaceClass	= USB_CLASS_VIDEO,
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		=
> > UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> > +	  .driver_info		=
> > UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> > 
> >  					| UVC_QUIRK_PROBE_DEF) },
> >  	
> >  	/* IMC Networks (Medion Akoya) */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> > 
> > @@ -2707,7 +2707,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	  .bInterfaceClass	= USB_CLASS_VIDEO,
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		=
> > UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> > +	  .driver_info		=
> > UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> > 
> >  					| UVC_QUIRK_PROBE_EXTRAFIELDS)
> > 
> > },
> > 
> >  	/* Aveo Technology USB 2.0 Camera (Tasco USB Microscope) */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> > 
> > @@ -2725,7 +2725,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	  .bInterfaceClass	= USB_CLASS_VIDEO,
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		=
> > UVC_QUIRK_INFO(UVC_QUIRK_PROBE_EXTRAFIELDS) },
> > +	  .driver_info		=
> > UVC_INFO_QUIRK(UVC_QUIRK_PROBE_EXTRAFIELDS) },
> > 
> >  	/* Manta MM-353 Plako */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> >  	
> >  				| USB_DEVICE_ID_MATCH_INT_INFO,
> > 
> > @@ -2771,7 +2771,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	  .bInterfaceClass	= USB_CLASS_VIDEO,
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		=
> > UVC_QUIRK_INFO(UVC_QUIRK_STATUS_INTERVAL) },
> > +	  .driver_info		=
> > UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
> > 
> >  	/* MSI StarCam 370i */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> >  	
> >  				| USB_DEVICE_ID_MATCH_INT_INFO,
> > 
> > @@ -2798,7 +2798,7 @@ static int uvc_clock_param_set(const char *val,
> > const struct kernel_param *kp)
> > 
> >  	  .bInterfaceClass	= USB_CLASS_VIDEO,
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		=
> > UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> > +	  .driver_info		=
> > UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> > 
> > UVC_QUIRK_IGNORE_SELECTOR_UNIT) },
> > 
> >  	/* Oculus VR Positional Tracker DK2 */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
Laurent Pinchart Aug. 20, 2018, 12:02 p.m. UTC | #4
Hi Guennadi,

Thank you for the patch.

On Friday, 3 August 2018 14:36:56 EEST Guennadi Liakhovetski wrote:
> This macro defines "information about quirks," not "quirks for
> information."
> 
> Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>

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

and taken in my tree.

> ---
>  drivers/media/usb/uvc/uvc_driver.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c
> b/drivers/media/usb/uvc/uvc_driver.c index d46dc43..699984b 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -2344,7 +2344,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .quirks = UVC_QUIRK_FORCE_Y8,
>  };
> 
> -#define UVC_QUIRK_INFO(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks
> = q} +#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct
> uvc_device_info){.quirks = q}
> 
>  /*
>   * The Logitech cameras listed below have their interface class set to
> @@ -2453,7 +2453,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
>  	/* Chicony CNF7129 (Asus EEE 100HE) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> 
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> 
> @@ -2462,7 +2462,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_RESTRICT_FRAME_RATE) },
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTRICT_FRAME_RATE) },
>  	/* Alcor Micro AU3820 (Future Boy PC USB Webcam) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> 
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> 
> @@ -2525,7 +2525,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> 
>  					| UVC_QUIRK_BUILTIN_ISIGHT) },
> 
>  	/* Apple Built-In iSight via iBridge */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2607,7 +2607,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> 
>  					| UVC_QUIRK_PROBE_DEF) },
> 
>  	/* IMC Networks (Medion Akoya) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2707,7 +2707,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> 
>  					| UVC_QUIRK_PROBE_EXTRAFIELDS) },
> 
>  	/* Aveo Technology USB 2.0 Camera (Tasco USB Microscope) */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> @@ -2725,7 +2725,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_EXTRAFIELDS) },
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_EXTRAFIELDS) },
>  	/* Manta MM-353 Plako */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> 
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> 
> @@ -2771,7 +2771,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_STATUS_INTERVAL) },
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
>  	/* MSI StarCam 370i */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> 
>  				| USB_DEVICE_ID_MATCH_INT_INFO,
> 
> @@ -2798,7 +2798,7 @@ static int uvc_clock_param_set(const char *val, const
> struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
>  	  .bInterfaceSubClass	= 1,
>  	  .bInterfaceProtocol	= 0,
> -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> 
>  					| UVC_QUIRK_IGNORE_SELECTOR_UNIT) },
> 
>  	/* Oculus VR Positional Tracker DK2 */
>  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
Laurent Pinchart Aug. 20, 2018, 12:05 p.m. UTC | #5
Hi Guennadi,

On Monday, 20 August 2018 15:02:53 EEST Laurent Pinchart wrote:
> On Friday, 3 August 2018 14:36:56 EEST Guennadi Liakhovetski wrote:
> > This macro defines "information about quirks," not "quirks for
> > information."

To address Nicolas' objection, would you mind saying "device information 
containing quirks" instead of "information about quirks" ? It you're fine with 
that I'll fix it in my tree, there's no need to resubmit.

> > Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> and taken in my tree.
> 
> > ---
> > 
> >  drivers/media/usb/uvc/uvc_driver.c | 18 +++++++++---------
> >  1 file changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c
> > b/drivers/media/usb/uvc/uvc_driver.c index d46dc43..699984b 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -2344,7 +2344,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .quirks = UVC_QUIRK_FORCE_Y8,
> > 
> >  };
> > 
> > -#define UVC_QUIRK_INFO(q) (kernel_ulong_t)&(struct
> > uvc_device_info){.quirks = q} +#define UVC_INFO_QUIRK(q)
> > (kernel_ulong_t)&(struct
> > uvc_device_info){.quirks = q}
> > 
> >  /*
> >  
> >   * The Logitech cameras listed below have their interface class set to
> > 
> > @@ -2453,7 +2453,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
> > 
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) 
},
> > +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) 
},
> > 
> >  	/* Chicony CNF7129 (Asus EEE 100HE) */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> >  	
> >  				| USB_DEVICE_ID_MATCH_INT_INFO,
> > 
> > @@ -2462,7 +2462,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
> > 
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_RESTRICT_FRAME_RATE) },
> > +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTRICT_FRAME_RATE) },
> > 
> >  	/* Alcor Micro AU3820 (Future Boy PC USB Webcam) */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> >  	
> >  				| USB_DEVICE_ID_MATCH_INT_INFO,
> > 
> > @@ -2525,7 +2525,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
> > 
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> > +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> > 
> >  					| UVC_QUIRK_BUILTIN_ISIGHT) },
> >  	
> >  	/* Apple Built-In iSight via iBridge */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> > 
> > @@ -2607,7 +2607,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
> > 
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> > +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> > 
> >  					| UVC_QUIRK_PROBE_DEF) },
> >  	
> >  	/* IMC Networks (Medion Akoya) */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> > 
> > @@ -2707,7 +2707,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
> > 
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> > +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> > 
> >  					| UVC_QUIRK_PROBE_EXTRAFIELDS) },
> >  	
> >  	/* Aveo Technology USB 2.0 Camera (Tasco USB Microscope) */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> > 
> > @@ -2725,7 +2725,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
> > 
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_EXTRAFIELDS) },
> > +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_EXTRAFIELDS) },
> > 
> >  	/* Manta MM-353 Plako */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> >  	
> >  				| USB_DEVICE_ID_MATCH_INT_INFO,
> > 
> > @@ -2771,7 +2771,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
> > 
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_STATUS_INTERVAL) },
> > +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
> > 
> >  	/* MSI StarCam 370i */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
> >  	
> >  				| USB_DEVICE_ID_MATCH_INT_INFO,
> > 
> > @@ -2798,7 +2798,7 @@ static int uvc_clock_param_set(const char *val,
> > const
> > struct kernel_param *kp) .bInterfaceClass	= USB_CLASS_VIDEO,
> > 
> >  	  .bInterfaceSubClass	= 1,
> >  	  .bInterfaceProtocol	= 0,
> > 
> > -	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
> > +	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
> > 
> >  					| UVC_QUIRK_IGNORE_SELECTOR_UNIT) },
> >  	
> >  	/* Oculus VR Positional Tracker DK2 */
> >  	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
Laurent Pinchart Aug. 20, 2018, 12:42 p.m. UTC | #6
Hi Guennadi,

Thank you for the patch.

On Monday, 20 August 2018 09:45:16 EEST Guennadi Liakhovetski wrote:
> Hi Laurent,
> 
> As far as I understand we've missed the 4.19 cycle. Can we move on with
> this please?

I've taken this patch in my tree and will try to handle the rest this week.
diff mbox series

Patch

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index d46dc43..699984b 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2344,7 +2344,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	.quirks = UVC_QUIRK_FORCE_Y8,
 };
 
-#define UVC_QUIRK_INFO(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
+#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
 
 /*
  * The Logitech cameras listed below have their interface class set to
@@ -2453,7 +2453,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	  .bInterfaceClass	= USB_CLASS_VIDEO,
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) },
 	/* Chicony CNF7129 (Asus EEE 100HE) */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
@@ -2462,7 +2462,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	  .bInterfaceClass	= USB_CLASS_VIDEO,
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_RESTRICT_FRAME_RATE) },
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_RESTRICT_FRAME_RATE) },
 	/* Alcor Micro AU3820 (Future Boy PC USB Webcam) */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
@@ -2525,7 +2525,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	  .bInterfaceClass	= USB_CLASS_VIDEO,
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
 					| UVC_QUIRK_BUILTIN_ISIGHT) },
 	/* Apple Built-In iSight via iBridge */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
@@ -2607,7 +2607,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	  .bInterfaceClass	= USB_CLASS_VIDEO,
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
 					| UVC_QUIRK_PROBE_DEF) },
 	/* IMC Networks (Medion Akoya) */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
@@ -2707,7 +2707,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	  .bInterfaceClass	= USB_CLASS_VIDEO,
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
 					| UVC_QUIRK_PROBE_EXTRAFIELDS) },
 	/* Aveo Technology USB 2.0 Camera (Tasco USB Microscope) */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
@@ -2725,7 +2725,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	  .bInterfaceClass	= USB_CLASS_VIDEO,
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_EXTRAFIELDS) },
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_EXTRAFIELDS) },
 	/* Manta MM-353 Plako */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
@@ -2771,7 +2771,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	  .bInterfaceClass	= USB_CLASS_VIDEO,
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_STATUS_INTERVAL) },
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_STATUS_INTERVAL) },
 	/* MSI StarCam 370i */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
@@ -2798,7 +2798,7 @@  static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 	  .bInterfaceClass	= USB_CLASS_VIDEO,
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
-	  .driver_info		= UVC_QUIRK_INFO(UVC_QUIRK_PROBE_MINMAX
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_PROBE_MINMAX
 					| UVC_QUIRK_IGNORE_SELECTOR_UNIT) },
 	/* Oculus VR Positional Tracker DK2 */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE