The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Hannes Reinecke <hare@suse.de>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Yury Norov <yury.norov@gmail.com>
Subject: [PATCH] scsi/fcoe: simplify fcoe_select_cpu()
Date: Wed,  4 Jun 2025 19:42:00 -0400	[thread overview]
Message-ID: <20250604234201.42509-1-yury.norov@gmail.com> (raw)

cpumask_next() followed by cpumask_first() opencodes
cpumask_next_wrap(). Fix it.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
 drivers/scsi/fcoe/fcoe.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index b911fdb387f3..07eddafe52ff 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1312,10 +1312,7 @@ static inline unsigned int fcoe_select_cpu(void)
 {
 	static unsigned int selected_cpu;
 
-	selected_cpu = cpumask_next(selected_cpu, cpu_online_mask);
-	if (selected_cpu >= nr_cpu_ids)
-		selected_cpu = cpumask_first(cpu_online_mask);
-
+	selected_cpu = cpumask_next_wrap(selected_cpu, cpu_online_mask);
 	return selected_cpu;
 }
 
-- 
2.43.0


             reply	other threads:[~2025-06-04 23:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04 23:42 Yury Norov [this message]
2025-06-05  0:13 ` [PATCH] scsi/fcoe: simplify fcoe_select_cpu() Bart Van Assche
2025-06-05  0:35   ` Yury Norov
2025-06-05  6:01     ` Hannes Reinecke

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=20250604234201.42509-1-yury.norov@gmail.com \
    --to=yury.norov@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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