public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Markus Stockhausen <markus.stockhausen@gmx.de>,
	tsbogend@alpha.franken.de, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org, s.gottschall@dd-wrt.com
Cc: Markus Stockhausen <markus.stockhausen@gmx.de>
Subject: Re: [PATCH] irqchip/mips-gic: allow forced affinity for current cpu during hotplug
Date: Sun, 25 May 2025 11:10:19 +0200	[thread overview]
Message-ID: <87bjrhqcn8.ffs@tglx> (raw)
In-Reply-To: <20250523151542.3903598-1-markus.stockhausen@gmx.de>

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

  reply	other threads:[~2025-05-25  9:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23 15:15 [PATCH] irqchip/mips-gic: allow forced affinity for current cpu during hotplug Markus Stockhausen
2025-05-25  9:10 ` Thomas Gleixner [this message]
2025-05-25  9:43   ` AW: " markus.stockhausen
2025-05-25 18:40     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bjrhqcn8.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=markus.stockhausen@gmx.de \
    --cc=s.gottschall@dd-wrt.com \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox