Skip to contentSkip to conversation

uvcvideo: small cleanup in uvc_video_clock_update()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 22, 2015 – Oct 30, 2015

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

PATCH 1/1 uvcvideo: small cleanup in uvc_video_clock_update()

Smatch is not smart enough to see that "&stream->clock.lock" and "&clock->lock" are the same thing so it complains about the locking here. Let's make it more consistent.

drivers/media/usb/uvc/uvc_video.c +1 -1
index 2b276ab..4abe3e9 100644
@@ -709,7 +709,7 @@ void uvc_video_clock_update(struct uvc_streaming *stream,
 	vbuf->timestamp.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
 
 done:
-	spin_unlock_irqrestore(&stream->clock.lock, flags);
+	spin_unlock_irqrestore(&clock->lock, flags);
 }
 
 /* ------------------------------------------------------------------------
maintainer Acked-by on v1 1/1
#1 lore raw

Hi Dan,

Thank you for the patch.

Quoted 5 lines · On Thursday 22 October 2015 12:09:05 Dan Carpenter wrote:

Smatch is not smart enough to see that "&stream->clock.lock" and "&clock->lock" are the same thing so it complains about the locking here. Let's make it more consistent.

and applied to my tree.

Quoted 13 lines
(quoted diff) +0 -0

b/drivers/media/usb/uvc/uvc_video.c index 2b276ab..4abe3e9 100644

drivers/media/usb/uvc/uvc_video.c +1 -1
@@ -709,7 +709,7 @@ void uvc_video_clock_update(struct uvc_streaming
 *stream, vbuf->timestamp.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
 
 done:
-	spin_unlock_irqrestore(&stream->clock.lock, flags);
+	spin_unlock_irqrestore(&clock->lock, flags);
 }
 
 /* ------------------------------------------------------------------------
Signature · 3 lines
Regards,

Laurent Pinchart