diff mbox

[media] uvcvideo: small cleanup in uvc_video_clock_update()

Message ID 20151022090905.GB9202@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Oct. 22, 2015, 9:09 a.m. UTC
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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Laurent Pinchart Oct. 30, 2015, 3:44 p.m. UTC | #1
Hi Dan,

Thank you for the patch.

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.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

and applied to my tree.

> diff --git a/drivers/media/usb/uvc/uvc_video.c
> b/drivers/media/usb/uvc/uvc_video.c index 2b276ab..4abe3e9 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -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);
>  }
> 
>  /* ------------------------------------------------------------------------
diff mbox

Patch

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 2b276ab..4abe3e9 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -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);
 }
 
 /* ------------------------------------------------------------------------