2020-03-27 16:30:39

by Alex Dewar

[permalink] [raw]
Subject: [PATCH] arm: dma-mapping: Remove unneeded NULL checks

dma_pool_destroy() already checks for NULL arguments, so the extra check
is unnecessary.

Signed-off-by: Alex Dewar <[email protected]>
---
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 f4b719bde763..a7c776cdc38f 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -560,10 +560,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)
--
2.26.0


2020-04-03 16:52:26

by Alex Dewar

[permalink] [raw]
Subject: Re: [PATCH] arm: dma-mapping: Remove unneeded NULL checks

On Fri Mar 27, 2020 at 4:29 PM, Alex Dewar wrote:
> dma_pool_destroy() already checks for NULL arguments, so the extra check
> is unnecessary.
>
>
> Signed-off-by: Alex Dewar <[email protected]>

Gentle ping?
> ---
> 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 f4b719bde763..a7c776cdc38f 100644
> --- a/arch/arm/common/dmabounce.c
> +++ b/arch/arm/common/dmabounce.c
> @@ -560,10 +560,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)
> --
> 2.26.0
>
>
>
>
>
>