linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Fushuai Wang <wangfushuai@baidu.com>
Cc: frederic@kernel.org, christophe.leroy@csgroup.eu,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] soc/fsl/qbman: Use for_each_online_cpu() instead of for_each_cpu()
Date: Mon, 11 Aug 2025 22:16:38 +0530	[thread overview]
Message-ID: <f3ecce9f-22cf-48e2-843e-63f08a577e69@linux.ibm.com> (raw)
In-Reply-To: <20250811065216.3320-1-wangfushuai@baidu.com>



On 8/11/25 12:22, Fushuai Wang wrote:
> Replace the opencoded for_each_cpu(cpu, cpu_online_mask) loop with the
> more readable and equivalent for_each_online_cpu(cpu) macro.
> 
> Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
> ---
>   drivers/soc/fsl/qbman/qman_test_stash.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/fsl/qbman/qman_test_stash.c b/drivers/soc/fsl/qbman/qman_test_stash.c
> index f4d3c2146f4f..6f7597950aa3 100644
> --- a/drivers/soc/fsl/qbman/qman_test_stash.c
> +++ b/drivers/soc/fsl/qbman/qman_test_stash.c
> @@ -103,7 +103,7 @@ static int on_all_cpus(int (*fn)(void))
>   {
>   	int cpu;
>   
> -	for_each_cpu(cpu, cpu_online_mask) {
> +	for_each_online_cpu(cpu) {
>   		struct bstrap bstrap = {
>   			.fn = fn,
>   			.started = ATOMIC_INIT(0)

Yes. This change makes sense given that for_each_online_cpu expands into the same.

Why not do for the remaining ones too?

linux_tip$ grep -Rw "for_each_cpu" * | grep  cpu_online_mask
arch/riscv/kernel/unaligned_access_speed.c:     for_each_cpu(cpu, cpu_online_mask) {
arch/riscv/kernel/unaligned_access_speed.c:     for_each_cpu(cpu, cpu_online_mask) {
drivers/soc/fsl/qbman/qman_test_stash.c:        for_each_cpu(cpu, cpu_online_mask) {    ** current patch addresses this.
drivers/infiniband/hw/hfi1/sdma.c:      for_each_cpu(cpu, cpu_online_mask) {
drivers/cpuidle/cpuidle-tegra.c:        for_each_cpu(lcpu, cpu_online_mask) {
include/rv/da_monitor.h:        for_each_cpu(cpu, cpu_online_mask) {
kernel/trace/trace_osnoise.c:   for_each_cpu(cpu, cpu_online_mask) {
kernel/trace/trace_osnoise.c:   for_each_cpu(cpu, cpu_online_mask) {


Rest everyone seems to have moved.
linux_tip$ grep -Rw "for_each_online_cpu" * | wc
     416    1141   23047




           reply	other threads:[~2025-08-11 22:03 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20250811065216.3320-1-wangfushuai@baidu.com>]

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=f3ecce9f-22cf-48e2-843e-63f08a577e69@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=frederic@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=wangfushuai@baidu.com \
    /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;
as well as URLs for NNTP newsgroup(s).