Skip to contentSkip to conversation

uvcvideo: Fix empty packet statistic

PATCH In review Kieran Bingham 2 participants 2 messages Apr 3, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uvcvideo: Fix empty packet statistic

From: Kieran Bingham <[email protected]>

The frame counters are inadvertently counting packets with content as empty.

Fix it by correcting the logic expression

Fixes 7bc5edb00bbd [media] uvcvideo: Extract video stream statistics
---
 drivers/media/usb/uvc/uvc_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/uvc/uvc_video.c +1 -1
index 075a0fe77485..7777ed24908b 100644
@@ -818,7 +818,7 @@ static void uvc_video_stats_decode(struct uvc_streaming *stream,
 
 	/* Update the packets counters. */
 	stream->stats.frame.nb_packets++;
-	if (len > header_size)
+	if (len <= header_size)
 		stream->stats.frame.nb_empty++;
 
 	if (data[1] & UVC_STREAM_ERR)
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi Kieran,

Thank you for the patch.

Quoted 9 lines · On Monday 03 Apr 2017 12:25:32 Kieran Bingham wrote:

From: Kieran Bingham <[email protected]>

The frame counters are inadvertently counting packets with content as empty.

Fix it by correcting the logic expression

Fixes 7bc5edb00bbd [media] uvcvideo: Extract video stream statistics

and applied to my tree.

Quoted 18 lines
---
 drivers/media/usb/uvc/uvc_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/media/usb/uvc/uvc_video.c index 075a0fe77485..7777ed24908b 100644

drivers/media/usb/uvc/uvc_video.c +1 -1
@@ -818,7 +818,7 @@ static void uvc_video_stats_decode(struct uvc_streaming
 *stream,
 
 	/* Update the packets counters. */
 	stream->stats.frame.nb_packets++;
-	if (len > header_size)
+	if (len <= header_size)
 		stream->stats.frame.nb_empty++;
 

if (data[1] & UVC_STREAM_ERR)

Signature · 3 lines
Regards,

Laurent Pinchart