lkml.org 
[lkml]   [2022]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/3] dma-pool: don't return errors from dma_atomic_pool_init
From
On 2022-08-17 07:06, Christoph Hellwig wrote:
> Returning errors from initcalls does not change a thing, thus don't
> bother with returning -ENOMEM if one of the pool allocations failed.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> kernel/dma/pool.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
> index 56f96678934bf..5b07b0379a501 100644
> --- a/kernel/dma/pool.c
> +++ b/kernel/dma/pool.c
> @@ -195,8 +195,6 @@ static unsigned long calculate_pool_size(unsigned long zone_pages)
>
> static int __init dma_atomic_pool_init(void)
> {
> - int ret = 0;
> -
> /*
> * If coherent_pool was not used on the command line, default the pool
> * sizes to 128KB per 1GB of memory, min 128KB, max MAX_ORDER-1.
> @@ -208,23 +206,17 @@ static int __init dma_atomic_pool_init(void)
>
> atomic_pool_kernel = __dma_atomic_pool_init(atomic_pool_size,
> GFP_KERNEL);
> - if (!atomic_pool_kernel)
> - ret = -ENOMEM;
> if (has_managed_dma()) {
> atomic_pool_dma = __dma_atomic_pool_init(atomic_pool_size,
> GFP_KERNEL | GFP_DMA);
> - if (!atomic_pool_dma)
> - ret = -ENOMEM;
> }
> if (IS_ENABLED(CONFIG_ZONE_DMA32)) {
> atomic_pool_dma32 = __dma_atomic_pool_init(atomic_pool_size,
> GFP_KERNEL | GFP_DMA32);
> - if (!atomic_pool_dma32)
> - ret = -ENOMEM;
> }
>
> dma_atomic_pool_debugfs_init();
> - return ret;
> + return 0;
> }
> postcore_initcall(dma_atomic_pool_init);
>

\
 
 \ /
  Last update: 2022-08-17 14:38    [W:0.094 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site