Re: [PATCH] irqchip/mips-gic: allow forced affinity for current cpu during hotplug

From: Thomas Gleixner
Date: Sun May 25 2025 - 05:10:29 EST


On Fri, May 23 2025 at 11:15, Markus Stockhausen wrote:
> +
> + if ((cpu >= NR_CPUS) && !force)
> + /* In normal mode allow only online CPUs. */
> return -EINVAL;
>
> + if (cpu >= NR_CPUS) {
> + /* In force mode allow current not yet online CPU for hotplug handlers. */
> + cpu = cpumask_first(cpumask);
> + if (cpu != get_cpu())
> + return -EINVAL;
> + }

This logic really makes my brain hurt. Why not doing the obvious:

if (cpu >= NR_CPUS) {
/* Sensible comment */
if (!force)
return -EINVAL;
...
}

Hmm?

Thanks

tglx