Re: [PATCH v4 3/4] x86/boot/compressed: Mark process_mem_region() index __maybe_unused
From: Ingo Molnar
Date: Tue Nov 10 2026 - 03:22:26 EST
* Thorsten Blum <blum@xxxxxxxxxx> wrote:
> The local index variable i in process_mem_region() is unused when either
> CONFIG_MEMORY_HOTREMOVE or CONFIG_ACPI is disabled.
>
> Mark it __maybe_unused accordingly.
>
> Reviewed-by: Jan Stancek <jstancek@xxxxxxxxxx>
> Reviewed-by: Nicolas Schier <n.schier@xxxxxxxxx>
> Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
> ---
> arch/x86/boot/compressed/kaslr.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
> index 290153818d0f..6f95092fa97e 100644
> --- a/arch/x86/boot/compressed/kaslr.c
> +++ b/arch/x86/boot/compressed/kaslr.c
> @@ -599,7 +599,8 @@ static bool process_mem_region(struct mem_vector *region,
> unsigned long minimum,
> unsigned long image_size)
> {
> - int i;
> + int i __maybe_unused;
> +
> /*
> * If no immovable memory found, or MEMORY_HOTREMOVE disabled,
> * use @region directly.
Please improve the code instead of uglifying it with an attribute
of uncertainty. 99% of __maybe_unused uses are unnecessary, such as
this one - let's not introduce new unnecessary uses.
Thanks,
Ingo