linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma-buf: heaps: Remove Unneeded variable "ret" in dma_heap_dma_buf_begin_cpu_access()
@ 2020-05-06  6:18 Jason Yan
  2020-05-06  9:13 ` Brian Starkey
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Yan @ 2020-05-06  6:18 UTC (permalink / raw)
  To: sumit.semwal, afd, benjamin.gaignard, lmark, labbott,
	Brian.Starkey, john.stultz, seanpaul, linux-media, dri-devel,
	linaro-mm-sig, linux-kernel
  Cc: Jason Yan

Fix the following coccicheck warning:

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

Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/dma-buf/heaps/heap-helpers.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma-buf/heaps/heap-helpers.c b/drivers/dma-buf/heaps/heap-helpers.c
index 9f964ca3f59c..c82872501ba2 100644
--- a/drivers/dma-buf/heaps/heap-helpers.c
+++ b/drivers/dma-buf/heaps/heap-helpers.c
@@ -200,7 +200,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);
 
@@ -213,7 +212,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,
-- 
2.21.1


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

* Re: [PATCH] dma-buf: heaps: Remove Unneeded variable "ret" in dma_heap_dma_buf_begin_cpu_access()
  2020-05-06  6:18 [PATCH] dma-buf: heaps: Remove Unneeded variable "ret" in dma_heap_dma_buf_begin_cpu_access() Jason Yan
@ 2020-05-06  9:13 ` Brian Starkey
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Starkey @ 2020-05-06  9:13 UTC (permalink / raw)
  To: Jason Yan
  Cc: sumit.semwal, afd, benjamin.gaignard, lmark, labbott,
	john.stultz, seanpaul, linux-media, dri-devel, linaro-mm-sig,
	linux-kernel, nd

Hi Jason,

On Wed, May 06, 2020 at 02:18:51PM +0800, Jason Yan wrote:
> Fix the following coccicheck warning:
> 
> drivers/dma-buf/heaps/heap-helpers.c:203:5-8: Unneeded variable: "ret".
> Return "0" on line 216
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

LGTM.

Reviewed-by: Brian Starkey <brian.starkey@arm.com>

Thanks,
-Brian

> ---
>  drivers/dma-buf/heaps/heap-helpers.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/dma-buf/heaps/heap-helpers.c b/drivers/dma-buf/heaps/heap-helpers.c
> index 9f964ca3f59c..c82872501ba2 100644
> --- a/drivers/dma-buf/heaps/heap-helpers.c
> +++ b/drivers/dma-buf/heaps/heap-helpers.c
> @@ -200,7 +200,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);
>  
> @@ -213,7 +212,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,
> -- 
> 2.21.1
> 

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

end of thread, other threads:[~2020-05-06  9:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06  6:18 [PATCH] dma-buf: heaps: Remove Unneeded variable "ret" in dma_heap_dma_buf_begin_cpu_access() Jason Yan
2020-05-06  9:13 ` Brian Starkey

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