Re: [PATCH 3/3] dma-pool: limit DMA and DMA32 zone size pools

From: Christoph Hellwig
Date: Sun Aug 21 2022 - 06:43:49 EST


On Wed, Aug 17, 2022 at 01:50:09PM +0100, Robin Murphy wrote:
>> +#if defined(CONFIG_ZONE_DMA) || defined(CONFIG_ZONE_DMA32)
>
> This #ifdeffery seems horribly clunky - I think it would be much nicer to
> mark this __maybe_unused, and preserve the has_managed_dma/IS_ENABLED logic
> below.

>> static int __init dma_atomic_pool_init(void)
>> {
>> + unsigned long nr_zone_dma_pages, nr_zone_dma32_pages;
>
> ...otherwise, I expect the buildbots will be along shortly with unused
> variable warnings for these :)

Amazingly they haven't complained yet, even if they should. But
simple IS_ENABLED won't work either as the ZONE_DMA / ZONE_DMA32
constants are not defined unless the corresponding config options
are set. I'll see what I can do here using helpers.