linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] media: uvcvideo: avoid variable shadowing in uvc_ctrl_cleanup_fh
@ 2025-07-08 14:46 Desnes Nunes
  2025-07-08 16:43 ` Laurent Pinchart
       [not found] ` <686d50ec.050a0220.28a07d.4a7b@mx.google.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Desnes Nunes @ 2025-07-08 14:46 UTC (permalink / raw)
  To: laurent.pinchart, hansg; +Cc: linux-media, linux-kernel, Desnes Nunes, stable

This avoids a variable loop shadowing occurring between the local loop
iterating through the uvc_entity's controls and the global one going
through the pending async controls of the file handle

Cc: stable@kernel.org
Fixes: 10acb9101355 ("media: uvcvideo: Increase/decrease the PM counter per IOCTL")
Signed-off-by: Desnes Nunes <desnesn@redhat.com>
---
 drivers/media/usb/uvc/uvc_ctrl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 303b7509ec47..6b9486749c3f 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -3299,7 +3299,6 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
 void uvc_ctrl_cleanup_fh(struct uvc_fh *handle)
 {
 	struct uvc_entity *entity;
-	int i;
 
 	guard(mutex)(&handle->chain->ctrl_mutex);
 
@@ -3317,7 +3316,7 @@ void uvc_ctrl_cleanup_fh(struct uvc_fh *handle)
 	if (!WARN_ON(handle->pending_async_ctrls))
 		return;
 
-	for (i = 0; i < handle->pending_async_ctrls; i++)
+	for (unsigned int i = 0; i < handle->pending_async_ctrls; i++)
 		uvc_pm_put(handle->stream->dev);
 }
 
-- 
2.50.0


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

* Re: [PATCH v3] media: uvcvideo: avoid variable shadowing in uvc_ctrl_cleanup_fh
  2025-07-08 14:46 [PATCH v3] media: uvcvideo: avoid variable shadowing in uvc_ctrl_cleanup_fh Desnes Nunes
@ 2025-07-08 16:43 ` Laurent Pinchart
  2025-07-21 12:11   ` Hans de Goede
       [not found] ` <686d50ec.050a0220.28a07d.4a7b@mx.google.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2025-07-08 16:43 UTC (permalink / raw)
  To: Desnes Nunes; +Cc: hansg, linux-media, linux-kernel, stable

Hi Desnes,

Thank you for the patch.

On Tue, Jul 08, 2025 at 11:46:28AM -0300, Desnes Nunes wrote:
> This avoids a variable loop shadowing occurring between the local loop
> iterating through the uvc_entity's controls and the global one going
> through the pending async controls of the file handle

s/handle/handle./

(easily handled when applying the patch, no need to resend)

> Cc: stable@kernel.org
> Fixes: 10acb9101355 ("media: uvcvideo: Increase/decrease the PM counter per IOCTL")

I think CI will ask for Cc to go after Fixes. If so that can also be
handled when applying.

> Signed-off-by: Desnes Nunes <desnesn@redhat.com>

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

> ---
>  drivers/media/usb/uvc/uvc_ctrl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
> index 303b7509ec47..6b9486749c3f 100644
> --- a/drivers/media/usb/uvc/uvc_ctrl.c
> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> @@ -3299,7 +3299,6 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
>  void uvc_ctrl_cleanup_fh(struct uvc_fh *handle)
>  {
>  	struct uvc_entity *entity;
> -	int i;
>  
>  	guard(mutex)(&handle->chain->ctrl_mutex);
>  
> @@ -3317,7 +3316,7 @@ void uvc_ctrl_cleanup_fh(struct uvc_fh *handle)
>  	if (!WARN_ON(handle->pending_async_ctrls))
>  		return;
>  
> -	for (i = 0; i < handle->pending_async_ctrls; i++)
> +	for (unsigned int i = 0; i < handle->pending_async_ctrls; i++)
>  		uvc_pm_put(handle->stream->dev);
>  }
>  

-- 
Regards,

Laurent Pinchart

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

* Re: [v3] media: uvcvideo: avoid variable shadowing in uvc_ctrl_cleanup_fh
       [not found] ` <686d50ec.050a0220.28a07d.4a7b@mx.google.com>
@ 2025-07-15 13:48   ` Desnes Nunes
  0 siblings, 0 replies; 4+ messages in thread
From: Desnes Nunes @ 2025-07-15 13:48 UTC (permalink / raw)
  To: linux-media

Hello,

On Tue, Jul 8, 2025 at 2:10 PM Patchwork Integration
<patchwork@media-ci.org> wrote:
>
> Dear Desnes Nunes:
>
> Thanks for your patches! Unfortunately the Media CI robot detected some
> issues:
>
> Please fix your series, and upload a new version. If you have a patchwork
> account, do not forget to mark the current series as Superseded.
>
> For more details, check the full report at:
> https://linux-media.pages.freedesktop.org/-/users/patchwork/-/jobs/80019682/artifacts/report.htm .

It seems that there was a connection error with the container?

>
> Best regards, and Happy Hacking!
> Media CI robot on behalf of the linux-media community.
>
> ---
> Check the latest rules for contributing your patches at:
> https://docs.kernel.org/driver-api/media/maintainer-entry-profile.html
>
> If you believe that the CI is wrong, kindly open an issue at
> https://gitlab.freedesktop.org/linux-media/media-ci/-/issues or reply-all
> to this message.

Just re-trigger the pipeline if the connection is back?

Best Regards,

-- 
Desnes Nunes


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

* Re: [PATCH v3] media: uvcvideo: avoid variable shadowing in uvc_ctrl_cleanup_fh
  2025-07-08 16:43 ` Laurent Pinchart
@ 2025-07-21 12:11   ` Hans de Goede
  0 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2025-07-21 12:11 UTC (permalink / raw)
  To: Laurent Pinchart, Desnes Nunes; +Cc: linux-media, linux-kernel, stable

Hi,

On 8-Jul-25 6:43 PM, Laurent Pinchart wrote:
> Hi Desnes,
> 
> Thank you for the patch.
> 
> On Tue, Jul 08, 2025 at 11:46:28AM -0300, Desnes Nunes wrote:
>> This avoids a variable loop shadowing occurring between the local loop
>> iterating through the uvc_entity's controls and the global one going
>> through the pending async controls of the file handle
> 
> s/handle/handle./
> 
> (easily handled when applying the patch, no need to resend)
> 
>> Cc: stable@kernel.org
>> Fixes: 10acb9101355 ("media: uvcvideo: Increase/decrease the PM counter per IOCTL")
> 
> I think CI will ask for Cc to go after Fixes. If so that can also be
> handled when applying.
> 
>> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thank you both for the patch and review. I've amended the commit
message while applying as suggested by Laurent and I have merged
this into:

https://gitlab.freedesktop.org/linux-media/users/uvc/-/commits/for-next/

Regards,

Hans





>> ---
>>  drivers/media/usb/uvc/uvc_ctrl.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
>> index 303b7509ec47..6b9486749c3f 100644
>> --- a/drivers/media/usb/uvc/uvc_ctrl.c
>> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
>> @@ -3299,7 +3299,6 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
>>  void uvc_ctrl_cleanup_fh(struct uvc_fh *handle)
>>  {
>>  	struct uvc_entity *entity;
>> -	int i;
>>  
>>  	guard(mutex)(&handle->chain->ctrl_mutex);
>>  
>> @@ -3317,7 +3316,7 @@ void uvc_ctrl_cleanup_fh(struct uvc_fh *handle)
>>  	if (!WARN_ON(handle->pending_async_ctrls))
>>  		return;
>>  
>> -	for (i = 0; i < handle->pending_async_ctrls; i++)
>> +	for (unsigned int i = 0; i < handle->pending_async_ctrls; i++)
>>  		uvc_pm_put(handle->stream->dev);
>>  }
>>  
> 


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

end of thread, other threads:[~2025-07-21 12:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08 14:46 [PATCH v3] media: uvcvideo: avoid variable shadowing in uvc_ctrl_cleanup_fh Desnes Nunes
2025-07-08 16:43 ` Laurent Pinchart
2025-07-21 12:11   ` Hans de Goede
     [not found] ` <686d50ec.050a0220.28a07d.4a7b@mx.google.com>
2025-07-15 13:48   ` [v3] " Desnes Nunes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).