Subject: [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations

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 <[email protected]>
---
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


Subject: [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal

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 <[email protected]>
---
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

2022-10-25 15:42:49

by Ricardo Ribalda

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal

On Tue, 25 Oct 2022 at 07:40, Pedro Guilherme Siqueira Moreira
<[email protected]> 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 <[email protected]>
Reviewed-by: Ricardo Ribalda <[email protected]>
> ---
> 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

2022-10-25 19:00:29

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations

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 <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

> ---
> 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

2022-10-25 19:05:14

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations

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 <[email protected]>
>
> Reviewed-by: Laurent Pinchart <[email protected]>
>
> > ---
> > 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

2022-10-25 19:16:43

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] media: uvc_driver: fix usage of symbolic permissions to octal

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 <[email protected]>
>
> Reviewed-by: Ricardo Ribalda <[email protected]>

And for this one too:

Reviewed-by: Laurent Pinchart <[email protected]>

> > ---
> > 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

Subject: Re: [PATCH v2 1/3] media: uvc_driver: fix missing newline after declarations

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 <[email protected]>
>>
>> Reviewed-by: Laurent Pinchart <[email protected]>
>>
>>> ---
>>> 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