linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2][next] media: uvcvideo: Remove duplicate assignments to pointer dma_dev
@ 2021-02-10 21:01 Gustavo A. R. Silva
  2021-02-10 23:42 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2021-02-10 21:01 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab, Ricardo Ribalda, Tomasz Figa
  Cc: linux-media, linux-kernel, Gustavo A. R. Silva

Remove redundant assignments to pointer dma_dev.

Fixes: fdcd02a641e2 ("media: uvcvideo: Use dma_alloc_noncontiguos API")
Addresses-Coverity-ID: 1501703 ("Evaluation order violation")
Addresses-Coverity-ID: 1501692 ("Evaluation order violation")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
Changes in v2:
 - Remove another redundant assignment in function
   uvc_free_urb_buffers().

 drivers/media/usb/uvc/uvc_video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index dc81f9a86eca..6f2f308d86fe 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1105,7 +1105,7 @@ static inline struct device *stream_to_dmadev(struct uvc_streaming *stream)
 
 static void uvc_urb_dma_sync(struct uvc_urb *uvc_urb, bool for_device)
 {
-	struct device *dma_dev = dma_dev = stream_to_dmadev(uvc_urb->stream);
+	struct device *dma_dev = stream_to_dmadev(uvc_urb->stream);
 
 	if (for_device) {
 		dma_sync_sgtable_for_device(dma_dev, uvc_urb->sgt,
@@ -1586,7 +1586,7 @@ static void uvc_video_complete(struct urb *urb)
  */
 static void uvc_free_urb_buffers(struct uvc_streaming *stream)
 {
-	struct device *dma_dev = dma_dev = stream_to_dmadev(stream);
+	struct device *dma_dev = stream_to_dmadev(stream);
 	struct uvc_urb *uvc_urb;
 
 	for_each_uvc_urb(uvc_urb, stream) {
-- 
2.27.0


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

* Re: [PATCH v2][next] media: uvcvideo: Remove duplicate assignments to pointer dma_dev
  2021-02-10 21:01 [PATCH v2][next] media: uvcvideo: Remove duplicate assignments to pointer dma_dev Gustavo A. R. Silva
@ 2021-02-10 23:42 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2021-02-10 23:42 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Mauro Carvalho Chehab, Ricardo Ribalda, Tomasz Figa, linux-media,
	linux-kernel

Hi Gustavo,

Thank you for the patch.

On Wed, Feb 10, 2021 at 03:01:49PM -0600, Gustavo A. R. Silva wrote:
> Remove redundant assignments to pointer dma_dev.
> 
> Fixes: fdcd02a641e2 ("media: uvcvideo: Use dma_alloc_noncontiguos API")
> Addresses-Coverity-ID: 1501703 ("Evaluation order violation")
> Addresses-Coverity-ID: 1501692 ("Evaluation order violation")
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Colin King has already submitted the same patch ("[PATCH][next][V2]
media: uvcvideo: remove duplicated dma_dev assignments"). As they're
identical, I can only decide to use the first patch that reached my
mailbox.

> ---
> Changes in v2:
>  - Remove another redundant assignment in function
>    uvc_free_urb_buffers().
> 
>  drivers/media/usb/uvc/uvc_video.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index dc81f9a86eca..6f2f308d86fe 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -1105,7 +1105,7 @@ static inline struct device *stream_to_dmadev(struct uvc_streaming *stream)
>  
>  static void uvc_urb_dma_sync(struct uvc_urb *uvc_urb, bool for_device)
>  {
> -	struct device *dma_dev = dma_dev = stream_to_dmadev(uvc_urb->stream);
> +	struct device *dma_dev = stream_to_dmadev(uvc_urb->stream);
>  
>  	if (for_device) {
>  		dma_sync_sgtable_for_device(dma_dev, uvc_urb->sgt,
> @@ -1586,7 +1586,7 @@ static void uvc_video_complete(struct urb *urb)
>   */
>  static void uvc_free_urb_buffers(struct uvc_streaming *stream)
>  {
> -	struct device *dma_dev = dma_dev = stream_to_dmadev(stream);
> +	struct device *dma_dev = stream_to_dmadev(stream);
>  	struct uvc_urb *uvc_urb;
>  
>  	for_each_uvc_urb(uvc_urb, stream) {

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2021-02-10 23:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 21:01 [PATCH v2][next] media: uvcvideo: Remove duplicate assignments to pointer dma_dev Gustavo A. R. Silva
2021-02-10 23:42 ` Laurent Pinchart

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).