Skip to contentSkip to conversation

media: uvcvideo: remove duplicated dma_dev assignment

PATCH Superseded Colin King 1 participant 2 messages Feb 10, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 media: uvcvideo: remove duplicated dma_dev assignment

From: Colin Ian King <[email protected]>

The assignment to dma_dev has been performed twice in one statement. Fix this by removing the extraneous assignment.

Addresses-Coverity: ("Evaluation order violation")

Fixes fdcd02a641e2 ("media: uvcvideo: Use dma_alloc_noncontiguos API")
---
 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 dc81f9a86eca..edf451a956d8 100644
@@ -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,
Signature · 1 line
2.30.0
#1 lore raw

NAK: [PATCH][next] media: uvcvideo: remove duplicated dma_dev assignment

Quoted 18 lines · Colin King

From: Colin Ian King <[email protected]>

The assignment to dma_dev has been performed twice in one statement. Fix this by removing the extraneous assignment.

Addresses-Coverity: ("Evaluation order violation")

Fixes fdcd02a641e2 ("media: uvcvideo: Use dma_alloc_noncontiguos API")
---
 drivers/media/usb/uvc/uvc_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/uvc/uvc_video.c +0 -0
index dc81f9a86eca..edf451a956d8 100644

drivers/media/usb/uvc/uvc_video.c static inline struct device *stream_to_dmadev(struct uvc_streaming *stream) · line 1111

Quoted 8 lines
drivers/media/usb/uvc/uvc_video.c +1 -1
@@ -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,

there are some other occurrences of this, I'll send a V2.