lkml.org 
[lkml]   [2021]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ARM: dma-mapping: remove redundant NULL check
Date
Fix below warnings reported by coccicheck:
./arch/arm/common/dmabounce.c:565:2-18: WARNING: NULL check before some
freeing functions is not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Suggested-by: Yang Li <oswb@linux.alibaba.com>
Signed-off-by: Abaci Team <abaci-bugfix@linux.alibaba.com>
---
arch/arm/common/dmabounce.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 7996c04..bf1218a 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -561,10 +561,8 @@ void dmabounce_unregister_dev(struct device *dev)
BUG();
}

- if (device_info->small.pool)
- dma_pool_destroy(device_info->small.pool);
- if (device_info->large.pool)
- dma_pool_destroy(device_info->large.pool);
+ dma_pool_destroy(device_info->small.pool);
+ dma_pool_destroy(device_info->large.pool);

#ifdef STATS
if (device_info->attr_res == 0)
--
1.8.3.1
\
 
 \ /
  Last update: 2021-01-27 10:31    [W:0.028 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site