* [PATCH] media: uvcvideo: drop useless assignment in uvc_parse_format()
@ 2026-08-20 20:11 Sergey Shtylyov
2026-08-20 20:15 ` Sergey Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Sergey Shtylyov @ 2026-08-20 20:11 UTC (permalink / raw)
To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab,
linux-media
Cc: Sergey Shtylyov
Close to the end of uvc_parse_format(), the parameter buflen is decremented
(again) but that statement seems pointless as buflen isn't used afterwards.
Drop the useless assignment (gcc doesn't generate any code for it anyways).
Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.
Signed-off-by: Sergey Shtylyov <s.shtylyov@auroraos.dev>
---
drivers/media/usb/uvc/uvc_driver.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index e289cc71ba98..0e78e8bcd320 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -520,7 +520,6 @@ static int uvc_parse_format(struct uvc_device *dev,
format->xfer_func = uvc_xfer_func(buffer[4]);
format->ycbcr_enc = uvc_ycbcr_enc(buffer[5]);
- buflen -= buffer[0];
buffer += buffer[0];
} else {
format->colorspace = V4L2_COLORSPACE_SRGB;
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: uvcvideo: drop useless assignment in uvc_parse_format()
2026-08-20 20:11 [PATCH] media: uvcvideo: drop useless assignment in uvc_parse_format() Sergey Shtylyov
@ 2026-08-20 20:15 ` Sergey Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Shtylyov @ 2026-08-20 20:15 UTC (permalink / raw)
To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab,
linux-media
On 8/20/26 11:11 PM, Sergey Shtylyov wrote:
> Close to the end of uvc_parse_format(), the parameter buflen is decremented
> (again) but that statement seems pointless as buflen isn't used afterwards.
> Drop the useless assignment (gcc doesn't generate any code for it anyways).
>
> Found by Linux Verification Center (linuxtesting.org) with the Svace static
> analysis tool.
>
> Signed-off-by: Sergey Shtylyov <s.shtylyov@auroraos.dev>
Duh, forgot to add that the patch is against the next branch of the
linuxtv.org/media.git repo!
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-20 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 20:11 [PATCH] media: uvcvideo: drop useless assignment in uvc_parse_format() Sergey Shtylyov
2026-08-20 20:15 ` Sergey Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox