[an error occurred while processing this directive]
| 
| [an error occurred while processing this directive] |  | 
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1607999915-53034-1-git-send-email-tiantao6@hisilicon.com>
Date:   Tue, 15 Dec 2020 10:38:35 +0800
From:   Tian Tao <tiantao6@...ilicon.com>
To:     <sumit.semwal@...aro.org>, <benjamin.gaignard@...aro.org>,
        <lmark@...eaurora.org>, <labbott@...hat.com>,
        <Brian.Starkey@....com>, <john.stultz@...aro.org>,
        <christian.koenig@....com>
CC:     <linux-media@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
        <linaro-mm-sig@...ts.linaro.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] dma-buf: system_heap: Use PTR_ERR_OR_ZERO() to simplify code
Fixes coccicheck warning:
drivers/dma-buf/heaps/system_heap.c:437:1-3: WARNING: PTR_ERR_OR_ZERO
can be used
Signed-off-by: Tian Tao <tiantao6@...ilicon.com>
---
 drivers/dma-buf/heaps/system_heap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c
index 17e0e9a..c5d8a40 100644
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -434,10 +434,8 @@ static int system_heap_create(void)
 	exp_info.priv = NULL;
 
 	sys_heap = dma_heap_add(&exp_info);
-	if (IS_ERR(sys_heap))
-		return PTR_ERR(sys_heap);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(sys_heap);
 }
 module_init(system_heap_create);
 MODULE_LICENSE("GPL v2");
-- 
2.7.4
Powered by blists - more mailing lists
 
