Skip to contentSkip to conversation

dma-buf: heaps: Remove unused variable ret

PATCH In review Zou Wei 3 participants 3 messages Sep 22, 2020

Subsystems (3)
lore
Share & tools
lore

Zou Wei

author
#0 lore raw

PATCH 1/1 dma-buf: heaps: Remove unused variable ret

This patch fixes below warnings reported by coccicheck

./drivers/dma-buf/heaps/heap-helpers.c:202:5-8: Unneeded variable: "ret". Return "0" on line 215

---
 drivers/dma-buf/heaps/heap-helpers.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma-buf/heaps/heap-helpers.c +1 -2
index d0696cf..7969510 100644
@@ -199,7 +199,6 @@ static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
 {
 	struct heap_helper_buffer *buffer = dmabuf->priv;
 	struct dma_heaps_attachment *a;
-	int ret = 0;
 
 	mutex_lock(&buffer->lock);
 
@@ -212,7 +211,7 @@ static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
 	}
 	mutex_unlock(&buffer->lock);
 
-	return ret;
+	return 0;
 }
 
 static int dma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
Signature · 1 line
2.6.2
maintainer Acked-by on v1 1/1
#1 lore raw

Am 22.09.20 um 09:53 schrieb Zou Wei:

Quoted 5 lines

This patch fixes below warnings reported by coccicheck

./drivers/dma-buf/heaps/heap-helpers.c:202:5-8: Unneeded variable: "ret". Return "0" on line 215

Going to pick this up for drm-misc-next.

Quoted 17 lines
---
  drivers/dma-buf/heaps/heap-helpers.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma-buf/heaps/heap-helpers.c +0 -1
index d0696cf..7969510 100644
@@ -199,7 +199,6 @@ static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
  {
  	struct heap_helper_buffer *buffer = dmabuf->priv;
  	struct dma_heaps_attachment *a;
-	int ret = 0;
 
  	mutex_lock(&buffer->lock);
 

drivers/dma-buf/heaps/heap-helpers.c static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, · line 217

Quoted 8 lines
drivers/dma-buf/heaps/heap-helpers.c +1 -1
@@ -212,7 +211,7 @@ static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
  	}
  	mutex_unlock(&buffer->lock);
 
-	return ret;
+	return 0;
  }
 
  static int dma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Acked-by
#2 lore raw

Hello Zou,

Quoted 11 lines · Christian König

Am 22.09.20 um 09:53 schrieb Zou Wei:

Quoted 5 lines

This patch fixes below warnings reported by coccicheck

./drivers/dma-buf/heaps/heap-helpers.c:202:5-8: Unneeded variable: "ret". Return "0" on line 215

Going to pick this up for drm-misc-next.

Thanks Christian!
Fwiw, feel free to add my

Quoted 21 lines
Quoted 21 lines
---
  drivers/dma-buf/heaps/heap-helpers.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma-buf/heaps/heap-helpers.c +0 -1
index d0696cf..7969510 100644
@@ -199,7 +199,6 @@ static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
  {
      struct heap_helper_buffer *buffer = dmabuf->priv;
      struct dma_heaps_attachment *a;
-     int ret = 0;
 
      mutex_lock(&buffer->lock);
 
@@ -212,7 +211,7 @@ static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
      }
      mutex_unlock(&buffer->lock);
 
Quoted 6 lines

drivers/dma-buf/heaps/heap-helpers.c static int dma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, · line 217

Quoted 5 lines
drivers/dma-buf/heaps/heap-helpers.c +1 -1
-     return ret;
+     return 0;
  }
 
  static int dma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,

Best,
Sumit.