All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations
@ 2022-10-25  5:04 Pedro Guilherme Siqueira Moreira
  2022-10-25  5:04 ` [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition Pedro Guilherme Siqueira Moreira
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Pedro Guilherme Siqueira Moreira @ 2022-10-25  5:04 UTC (permalink / raw)
  To: laurent.pinchart
  Cc: mchehab, linux-media, linux-kernel, Pedro Guilherme Siqueira Moreira

Fixes 'Missing a blank line after declarations' warning issued by
scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c

Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
---
 drivers/media/usb/uvc/uvc_driver.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 215fb483efb0..b591ad823c66 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -732,6 +732,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
 	/* Parse the alternate settings to find the maximum bandwidth. */
 	for (i = 0; i < intf->num_altsetting; ++i) {
 		struct usb_host_endpoint *ep;
+
 		alts = &intf->altsetting[i];
 		ep = uvc_find_endpoint(alts,
 				streaming->header.bEndpointAddress);
@@ -1859,12 +1860,14 @@ static void uvc_delete(struct kref *kref)
 
 	list_for_each_safe(p, n, &dev->chains) {
 		struct uvc_video_chain *chain;
+
 		chain = list_entry(p, struct uvc_video_chain, list);
 		kfree(chain);
 	}
 
 	list_for_each_safe(p, n, &dev->entities) {
 		struct uvc_entity *entity;
+
 		entity = list_entry(p, struct uvc_entity, list);
 #ifdef CONFIG_MEDIA_CONTROLLER
 		uvc_mc_cleanup_entity(entity);
@@ -1874,6 +1877,7 @@ static void uvc_delete(struct kref *kref)
 
 	list_for_each_safe(p, n, &dev->streams) {
 		struct uvc_streaming *streaming;
+
 		streaming = list_entry(p, struct uvc_streaming, list);
 		usb_driver_release_interface(&uvc_driver.driver,
 			streaming->intf);
-- 
2.38.1


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

* [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition
  2022-10-25  5:04 [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations Pedro Guilherme Siqueira Moreira
@ 2022-10-25  5:04 ` Pedro Guilherme Siqueira Moreira
  2022-10-25  8:45   ` Ricardo Ribalda
  2022-10-25  5:04 ` [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal Pedro Guilherme Siqueira Moreira
  2022-10-25 18:50 ` [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations Laurent Pinchart
  2 siblings, 1 reply; 11+ messages in thread
From: Pedro Guilherme Siqueira Moreira @ 2022-10-25  5:04 UTC (permalink / raw)
  To: laurent.pinchart
  Cc: mchehab, linux-media, linux-kernel, Pedro Guilherme Siqueira Moreira

Fixes 'do not use assignment in if condition' errors issued by
scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c

Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
---
 drivers/media/usb/uvc/uvc_driver.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index b591ad823c66..7b6c97ad3a41 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1174,7 +1174,8 @@ static int uvc_parse_control(struct uvc_device *dev)
 		    buffer[1] != USB_DT_CS_INTERFACE)
 			goto next_descriptor;
 
-		if ((ret = uvc_parse_standard_control(dev, buffer, buflen)) < 0)
+		ret = uvc_parse_standard_control(dev, buffer, buflen);
+		if (ret < 0)
 			return ret;
 
 next_descriptor:
@@ -2213,7 +2214,8 @@ static int uvc_probe(struct usb_interface *intf,
 	usb_set_intfdata(intf, dev);
 
 	/* Initialize the interrupt URB. */
-	if ((ret = uvc_status_init(dev)) < 0) {
+	ret = uvc_status_init(dev);
+	if (ret < 0) {
 		dev_info(&dev->udev->dev,
 			 "Unable to initialize the status endpoint (%d), status interrupt will not be supported.\n",
 			 ret);
-- 
2.38.1


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

* [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal
  2022-10-25  5:04 [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations Pedro Guilherme Siqueira Moreira
  2022-10-25  5:04 ` [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition Pedro Guilherme Siqueira Moreira
@ 2022-10-25  5:04 ` Pedro Guilherme Siqueira Moreira
  2022-10-25 14:58   ` Ricardo Ribalda
  2022-10-25 18:50 ` [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations Laurent Pinchart
  2 siblings, 1 reply; 11+ messages in thread
From: Pedro Guilherme Siqueira Moreira @ 2022-10-25  5:04 UTC (permalink / raw)
  To: laurent.pinchart
  Cc: mchehab, linux-media, linux-kernel, Pedro Guilherme Siqueira Moreira

Change symbolic permissions to octal equivalents as recommended by
scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c.

Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
---
 drivers/media/usb/uvc/uvc_driver.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 7b6c97ad3a41..c5adad4e51e2 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2362,17 +2362,17 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
 }
 
 module_param_call(clock, uvc_clock_param_set, uvc_clock_param_get,
-		  &uvc_clock_param, S_IRUGO|S_IWUSR);
+		  &uvc_clock_param, 0644);
 MODULE_PARM_DESC(clock, "Video buffers timestamp clock");
-module_param_named(hwtimestamps, uvc_hw_timestamps_param, uint, S_IRUGO|S_IWUSR);
+module_param_named(hwtimestamps, uvc_hw_timestamps_param, uint, 0644);
 MODULE_PARM_DESC(hwtimestamps, "Use hardware timestamps");
-module_param_named(nodrop, uvc_no_drop_param, uint, S_IRUGO|S_IWUSR);
+module_param_named(nodrop, uvc_no_drop_param, uint, 0644);
 MODULE_PARM_DESC(nodrop, "Don't drop incomplete frames");
-module_param_named(quirks, uvc_quirks_param, uint, S_IRUGO|S_IWUSR);
+module_param_named(quirks, uvc_quirks_param, uint, 0644);
 MODULE_PARM_DESC(quirks, "Forced device quirks");
-module_param_named(trace, uvc_dbg_param, uint, S_IRUGO|S_IWUSR);
+module_param_named(trace, uvc_dbg_param, uint, 0644);
 MODULE_PARM_DESC(trace, "Trace level bitmask");
-module_param_named(timeout, uvc_timeout_param, uint, S_IRUGO|S_IWUSR);
+module_param_named(timeout, uvc_timeout_param, uint, 0644);
 MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
 
 /* ------------------------------------------------------------------------
-- 
2.38.1


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

* Re: [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition
  2022-10-25  5:04 ` [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition Pedro Guilherme Siqueira Moreira
@ 2022-10-25  8:45   ` Ricardo Ribalda
  2022-10-25 18:54     ` Laurent Pinchart
  0 siblings, 1 reply; 11+ messages in thread
From: Ricardo Ribalda @ 2022-10-25  8:45 UTC (permalink / raw)
  To: Pedro Guilherme Siqueira Moreira
  Cc: laurent.pinchart, mchehab, linux-media, linux-kernel

On Tue, 25 Oct 2022 at 07:08, Pedro Guilherme Siqueira Moreira
<pedro.guilherme@espectro.eng.br> wrote:
>
> Fixes 'do not use assignment in if condition' errors issued by
> scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c
>
> Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/media/usb/uvc/uvc_driver.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index b591ad823c66..7b6c97ad3a41 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -1174,7 +1174,8 @@ static int uvc_parse_control(struct uvc_device *dev)
>                     buffer[1] != USB_DT_CS_INTERFACE)
>                         goto next_descriptor;
>
> -               if ((ret = uvc_parse_standard_control(dev, buffer, buflen)) < 0)
> +               ret = uvc_parse_standard_control(dev, buffer, buflen);
> +               if (ret < 0)
>                         return ret;
>
>  next_descriptor:
> @@ -2213,7 +2214,8 @@ static int uvc_probe(struct usb_interface *intf,
>         usb_set_intfdata(intf, dev);
>
>         /* Initialize the interrupt URB. */
> -       if ((ret = uvc_status_init(dev)) < 0) {
> +       ret = uvc_status_init(dev);
> +       if (ret < 0) {
>                 dev_info(&dev->udev->dev,
>                          "Unable to initialize the status endpoint (%d), status interrupt will not be supported.\n",
>                          ret);
> --
> 2.38.1
>


-- 
Ricardo Ribalda

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

* Re: [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal
  2022-10-25  5:04 ` [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal Pedro Guilherme Siqueira Moreira
@ 2022-10-25 14:58   ` Ricardo Ribalda
  2022-10-25 18:54     ` Laurent Pinchart
  0 siblings, 1 reply; 11+ messages in thread
From: Ricardo Ribalda @ 2022-10-25 14:58 UTC (permalink / raw)
  To: Pedro Guilherme Siqueira Moreira
  Cc: laurent.pinchart, mchehab, linux-media, linux-kernel

On Tue, 25 Oct 2022 at 07:40, Pedro Guilherme Siqueira Moreira
<pedro.guilherme@espectro.eng.br> wrote:
>
> Change symbolic permissions to octal equivalents as recommended by
> scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c.
>
> Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  drivers/media/usb/uvc/uvc_driver.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 7b6c97ad3a41..c5adad4e51e2 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -2362,17 +2362,17 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
>  }
>
>  module_param_call(clock, uvc_clock_param_set, uvc_clock_param_get,
> -                 &uvc_clock_param, S_IRUGO|S_IWUSR);
> +                 &uvc_clock_param, 0644);
>  MODULE_PARM_DESC(clock, "Video buffers timestamp clock");
> -module_param_named(hwtimestamps, uvc_hw_timestamps_param, uint, S_IRUGO|S_IWUSR);
> +module_param_named(hwtimestamps, uvc_hw_timestamps_param, uint, 0644);
>  MODULE_PARM_DESC(hwtimestamps, "Use hardware timestamps");
> -module_param_named(nodrop, uvc_no_drop_param, uint, S_IRUGO|S_IWUSR);
> +module_param_named(nodrop, uvc_no_drop_param, uint, 0644);
>  MODULE_PARM_DESC(nodrop, "Don't drop incomplete frames");
> -module_param_named(quirks, uvc_quirks_param, uint, S_IRUGO|S_IWUSR);
> +module_param_named(quirks, uvc_quirks_param, uint, 0644);
>  MODULE_PARM_DESC(quirks, "Forced device quirks");
> -module_param_named(trace, uvc_dbg_param, uint, S_IRUGO|S_IWUSR);
> +module_param_named(trace, uvc_dbg_param, uint, 0644);
>  MODULE_PARM_DESC(trace, "Trace level bitmask");
> -module_param_named(timeout, uvc_timeout_param, uint, S_IRUGO|S_IWUSR);
> +module_param_named(timeout, uvc_timeout_param, uint, 0644);
>  MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
>
>  /* ------------------------------------------------------------------------
> --
> 2.38.1
>


-- 
Ricardo Ribalda

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

* Re: [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations
  2022-10-25  5:04 [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations Pedro Guilherme Siqueira Moreira
  2022-10-25  5:04 ` [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition Pedro Guilherme Siqueira Moreira
  2022-10-25  5:04 ` [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal Pedro Guilherme Siqueira Moreira
@ 2022-10-25 18:50 ` Laurent Pinchart
  2022-10-25 18:57   ` Laurent Pinchart
  2 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2022-10-25 18:50 UTC (permalink / raw)
  To: Pedro Guilherme Siqueira Moreira; +Cc: mchehab, linux-media, linux-kernel

Hi Pedro,

Thank you for the patch.

On Tue, Oct 25, 2022 at 02:04:48AM -0300, Pedro Guilherme Siqueira Moreira wrote:
> Fixes 'Missing a blank line after declarations' warning issued by
> scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c
> 
> Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>

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

> ---
>  drivers/media/usb/uvc/uvc_driver.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 215fb483efb0..b591ad823c66 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -732,6 +732,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
>  	/* Parse the alternate settings to find the maximum bandwidth. */
>  	for (i = 0; i < intf->num_altsetting; ++i) {
>  		struct usb_host_endpoint *ep;
> +
>  		alts = &intf->altsetting[i];
>  		ep = uvc_find_endpoint(alts,
>  				streaming->header.bEndpointAddress);
> @@ -1859,12 +1860,14 @@ static void uvc_delete(struct kref *kref)
>  
>  	list_for_each_safe(p, n, &dev->chains) {
>  		struct uvc_video_chain *chain;
> +
>  		chain = list_entry(p, struct uvc_video_chain, list);
>  		kfree(chain);
>  	}
>  
>  	list_for_each_safe(p, n, &dev->entities) {
>  		struct uvc_entity *entity;
> +
>  		entity = list_entry(p, struct uvc_entity, list);
>  #ifdef CONFIG_MEDIA_CONTROLLER
>  		uvc_mc_cleanup_entity(entity);
> @@ -1874,6 +1877,7 @@ static void uvc_delete(struct kref *kref)
>  
>  	list_for_each_safe(p, n, &dev->streams) {
>  		struct uvc_streaming *streaming;
> +
>  		streaming = list_entry(p, struct uvc_streaming, list);
>  		usb_driver_release_interface(&uvc_driver.driver,
>  			streaming->intf);

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition
  2022-10-25  8:45   ` Ricardo Ribalda
@ 2022-10-25 18:54     ` Laurent Pinchart
  0 siblings, 0 replies; 11+ messages in thread
From: Laurent Pinchart @ 2022-10-25 18:54 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Pedro Guilherme Siqueira Moreira, mchehab, linux-media, linux-kernel

On Tue, Oct 25, 2022 at 10:45:40AM +0200, Ricardo Ribalda wrote:
> On Tue, 25 Oct 2022 at 07:08, Pedro Guilherme Siqueira Moreira
> <pedro.guilherme@espectro.eng.br> wrote:
> >
> > Fixes 'do not use assignment in if condition' errors issued by
> > scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c
> >
> > Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
>
> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>

Likewise, this looks good to me.

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

> > ---
> >  drivers/media/usb/uvc/uvc_driver.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> > index b591ad823c66..7b6c97ad3a41 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -1174,7 +1174,8 @@ static int uvc_parse_control(struct uvc_device *dev)
> >                     buffer[1] != USB_DT_CS_INTERFACE)
> >                         goto next_descriptor;
> >
> > -               if ((ret = uvc_parse_standard_control(dev, buffer, buflen)) < 0)
> > +               ret = uvc_parse_standard_control(dev, buffer, buflen);
> > +               if (ret < 0)
> >                         return ret;
> >
> >  next_descriptor:
> > @@ -2213,7 +2214,8 @@ static int uvc_probe(struct usb_interface *intf,
> >         usb_set_intfdata(intf, dev);
> >
> >         /* Initialize the interrupt URB. */
> > -       if ((ret = uvc_status_init(dev)) < 0) {
> > +       ret = uvc_status_init(dev);
> > +       if (ret < 0) {
> >                 dev_info(&dev->udev->dev,
> >                          "Unable to initialize the status endpoint (%d), status interrupt will not be supported.\n",
> >                          ret);

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal
  2022-10-25 14:58   ` Ricardo Ribalda
@ 2022-10-25 18:54     ` Laurent Pinchart
  0 siblings, 0 replies; 11+ messages in thread
From: Laurent Pinchart @ 2022-10-25 18:54 UTC (permalink / raw)
  To: Ricardo Ribalda
  Cc: Pedro Guilherme Siqueira Moreira, mchehab, linux-media, linux-kernel

On Tue, Oct 25, 2022 at 04:58:56PM +0200, Ricardo Ribalda wrote:
> On Tue, 25 Oct 2022 at 07:40, Pedro Guilherme Siqueira Moreira wrote:
> >
> > Change symbolic permissions to octal equivalents as recommended by
> > scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c.
> >
> > Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
>
> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>

And for this one too:

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

> > ---
> >  drivers/media/usb/uvc/uvc_driver.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> > index 7b6c97ad3a41..c5adad4e51e2 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -2362,17 +2362,17 @@ static int uvc_clock_param_set(const char *val, const struct kernel_param *kp)
> >  }
> >
> >  module_param_call(clock, uvc_clock_param_set, uvc_clock_param_get,
> > -                 &uvc_clock_param, S_IRUGO|S_IWUSR);
> > +                 &uvc_clock_param, 0644);
> >  MODULE_PARM_DESC(clock, "Video buffers timestamp clock");
> > -module_param_named(hwtimestamps, uvc_hw_timestamps_param, uint, S_IRUGO|S_IWUSR);
> > +module_param_named(hwtimestamps, uvc_hw_timestamps_param, uint, 0644);
> >  MODULE_PARM_DESC(hwtimestamps, "Use hardware timestamps");
> > -module_param_named(nodrop, uvc_no_drop_param, uint, S_IRUGO|S_IWUSR);
> > +module_param_named(nodrop, uvc_no_drop_param, uint, 0644);
> >  MODULE_PARM_DESC(nodrop, "Don't drop incomplete frames");
> > -module_param_named(quirks, uvc_quirks_param, uint, S_IRUGO|S_IWUSR);
> > +module_param_named(quirks, uvc_quirks_param, uint, 0644);
> >  MODULE_PARM_DESC(quirks, "Forced device quirks");
> > -module_param_named(trace, uvc_dbg_param, uint, S_IRUGO|S_IWUSR);
> > +module_param_named(trace, uvc_dbg_param, uint, 0644);
> >  MODULE_PARM_DESC(trace, "Trace level bitmask");
> > -module_param_named(timeout, uvc_timeout_param, uint, S_IRUGO|S_IWUSR);
> > +module_param_named(timeout, uvc_timeout_param, uint, 0644);
> >  MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
> >
> >  /* ------------------------------------------------------------------------

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations
  2022-10-25 18:50 ` [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations Laurent Pinchart
@ 2022-10-25 18:57   ` Laurent Pinchart
  2022-10-25 19:48     ` Pedro Guilherme Siqueira Moreira
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2022-10-25 18:57 UTC (permalink / raw)
  To: Pedro Guilherme Siqueira Moreira; +Cc: mchehab, linux-media, linux-kernel

I forgot to mention, the subject line should start with "media:
uvcvideo:", not "media: uvc_driver:". You can have a look at the git log
to see how subject lines are usually formatted for a driver or
subsystem.

No need to send a v3, I'll change this in my tree, for all three patches
in the series.

On Tue, Oct 25, 2022 at 09:51:03PM +0300, Laurent Pinchart wrote:
> Hi Pedro,
> 
> Thank you for the patch.
> 
> On Tue, Oct 25, 2022 at 02:04:48AM -0300, Pedro Guilherme Siqueira Moreira wrote:
> > Fixes 'Missing a blank line after declarations' warning issued by
> > scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c
> > 
> > Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  drivers/media/usb/uvc/uvc_driver.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> > index 215fb483efb0..b591ad823c66 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -732,6 +732,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
> >  	/* Parse the alternate settings to find the maximum bandwidth. */
> >  	for (i = 0; i < intf->num_altsetting; ++i) {
> >  		struct usb_host_endpoint *ep;
> > +
> >  		alts = &intf->altsetting[i];
> >  		ep = uvc_find_endpoint(alts,
> >  				streaming->header.bEndpointAddress);
> > @@ -1859,12 +1860,14 @@ static void uvc_delete(struct kref *kref)
> >  
> >  	list_for_each_safe(p, n, &dev->chains) {
> >  		struct uvc_video_chain *chain;
> > +
> >  		chain = list_entry(p, struct uvc_video_chain, list);
> >  		kfree(chain);
> >  	}
> >  
> >  	list_for_each_safe(p, n, &dev->entities) {
> >  		struct uvc_entity *entity;
> > +
> >  		entity = list_entry(p, struct uvc_entity, list);
> >  #ifdef CONFIG_MEDIA_CONTROLLER
> >  		uvc_mc_cleanup_entity(entity);
> > @@ -1874,6 +1877,7 @@ static void uvc_delete(struct kref *kref)
> >  
> >  	list_for_each_safe(p, n, &dev->streams) {
> >  		struct uvc_streaming *streaming;
> > +
> >  		streaming = list_entry(p, struct uvc_streaming, list);
> >  		usb_driver_release_interface(&uvc_driver.driver,
> >  			streaming->intf);

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations
  2022-10-25 18:57   ` Laurent Pinchart
@ 2022-10-25 19:48     ` Pedro Guilherme Siqueira Moreira
  0 siblings, 0 replies; 11+ messages in thread
From: Pedro Guilherme Siqueira Moreira @ 2022-10-25 19:48 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: mchehab, linux-media, linux-kernel

Hi Laurent,

Thank you for the info and for accepting my patch!  I'll better revise 
the subject lines from now on.

On 25/10/2022 15:57, Laurent Pinchart wrote:
> I forgot to mention, the subject line should start with "media:
> uvcvideo:", not "media: uvc_driver:". You can have a look at the git log
> to see how subject lines are usually formatted for a driver or
> subsystem.
> 
> No need to send a v3, I'll change this in my tree, for all three patches
> in the series.
> 
> On Tue, Oct 25, 2022 at 09:51:03PM +0300, Laurent Pinchart wrote:
>> Hi Pedro,
>>
>> Thank you for the patch.
>>
>> On Tue, Oct 25, 2022 at 02:04:48AM -0300, Pedro Guilherme Siqueira Moreira wrote:
>>> Fixes 'Missing a blank line after declarations' warning issued by
>>> scripts/checkpatch.pl on drivers/media/usb/uvc/uvc_driver.c
>>>
>>> Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
>>
>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>
>>> ---
>>>   drivers/media/usb/uvc/uvc_driver.c | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
>>> index 215fb483efb0..b591ad823c66 100644
>>> --- a/drivers/media/usb/uvc/uvc_driver.c
>>> +++ b/drivers/media/usb/uvc/uvc_driver.c
>>> @@ -732,6 +732,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
>>>   	/* Parse the alternate settings to find the maximum bandwidth. */
>>>   	for (i = 0; i < intf->num_altsetting; ++i) {
>>>   		struct usb_host_endpoint *ep;
>>> +
>>>   		alts = &intf->altsetting[i];
>>>   		ep = uvc_find_endpoint(alts,
>>>   				streaming->header.bEndpointAddress);
>>> @@ -1859,12 +1860,14 @@ static void uvc_delete(struct kref *kref)
>>>   
>>>   	list_for_each_safe(p, n, &dev->chains) {
>>>   		struct uvc_video_chain *chain;
>>> +
>>>   		chain = list_entry(p, struct uvc_video_chain, list);
>>>   		kfree(chain);
>>>   	}
>>>   
>>>   	list_for_each_safe(p, n, &dev->entities) {
>>>   		struct uvc_entity *entity;
>>> +
>>>   		entity = list_entry(p, struct uvc_entity, list);
>>>   #ifdef CONFIG_MEDIA_CONTROLLER
>>>   		uvc_mc_cleanup_entity(entity);
>>> @@ -1874,6 +1877,7 @@ static void uvc_delete(struct kref *kref)
>>>   
>>>   	list_for_each_safe(p, n, &dev->streams) {
>>>   		struct uvc_streaming *streaming;
>>> +
>>>   		streaming = list_entry(p, struct uvc_streaming, list);
>>>   		usb_driver_release_interface(&uvc_driver.driver,
>>>   			streaming->intf);
> 

-- 
Regards,
Pedro

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

* [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition
  2022-10-25  2:19 ` [PATCH v2 " Pedro Guilherme Siqueira Moreira
@ 2022-10-25  2:19   ` Pedro Guilherme Siqueira Moreira
  0 siblings, 0 replies; 11+ messages in thread
From: Pedro Guilherme Siqueira Moreira @ 2022-10-25  2:19 UTC (permalink / raw)
  To: laurent.pinchart
  Cc: mchehab, linux-media, linux-kernel, Pedro Guilherme Siqueira Moreira

Fixes 'do not use assignment in if condition' errors issued by
scripts/checkpatch.pl on lines 1464 and 2500 on
drivers/media/usb/uvc/uvc_driver.c

Signed-off-by: Pedro Guilherme Siqueira Moreira <pedro.guilherme@espectro.eng.br>
---
 drivers/media/usb/uvc/uvc_driver.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index b591ad823c66..7b6c97ad3a41 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1174,7 +1174,8 @@ static int uvc_parse_control(struct uvc_device *dev)
 		    buffer[1] != USB_DT_CS_INTERFACE)
 			goto next_descriptor;
 
-		if ((ret = uvc_parse_standard_control(dev, buffer, buflen)) < 0)
+		ret = uvc_parse_standard_control(dev, buffer, buflen);
+		if (ret < 0)
 			return ret;
 
 next_descriptor:
@@ -2213,7 +2214,8 @@ static int uvc_probe(struct usb_interface *intf,
 	usb_set_intfdata(intf, dev);
 
 	/* Initialize the interrupt URB. */
-	if ((ret = uvc_status_init(dev)) < 0) {
+	ret = uvc_status_init(dev);
+	if (ret < 0) {
 		dev_info(&dev->udev->dev,
 			 "Unable to initialize the status endpoint (%d), status interrupt will not be supported.\n",
 			 ret);
-- 
2.38.1


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

end of thread, other threads:[~2022-10-25 19:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25  5:04 [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations Pedro Guilherme Siqueira Moreira
2022-10-25  5:04 ` [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition Pedro Guilherme Siqueira Moreira
2022-10-25  8:45   ` Ricardo Ribalda
2022-10-25 18:54     ` Laurent Pinchart
2022-10-25  5:04 ` [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal Pedro Guilherme Siqueira Moreira
2022-10-25 14:58   ` Ricardo Ribalda
2022-10-25 18:54     ` Laurent Pinchart
2022-10-25 18:50 ` [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations Laurent Pinchart
2022-10-25 18:57   ` Laurent Pinchart
2022-10-25 19:48     ` Pedro Guilherme Siqueira Moreira
  -- strict thread matches above, loose matches on Subject: below --
2022-10-25  1:36 [PATCH " Laurent Pinchart
2022-10-25  2:19 ` [PATCH v2 " Pedro Guilherme Siqueira Moreira
2022-10-25  2:19   ` [PATCH v2 2/3] media: uvc_driver: fix assignment inside if condition Pedro Guilherme Siqueira Moreira

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.