* [PATCH] watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu()
@ 2025-06-05 0:12 Yury Norov
2025-06-09 17:16 ` Doug Anderson
0 siblings, 1 reply; 3+ messages in thread
From: Yury Norov @ 2025-06-05 0:12 UTC (permalink / raw)
To: Douglas Anderson, Yury Norov [NVIDIA], linux-kernel
From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
The dedicated helper is more verbose and efficient comparing to
cpumask_next() followed by cpumask_first().
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
---
kernel/watchdog_buddy.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/watchdog_buddy.c b/kernel/watchdog_buddy.c
index 34dbfe091f4b..ee754d767c21 100644
--- a/kernel/watchdog_buddy.c
+++ b/kernel/watchdog_buddy.c
@@ -12,10 +12,7 @@ static unsigned int watchdog_next_cpu(unsigned int cpu)
{
unsigned int next_cpu;
- next_cpu = cpumask_next(cpu, &watchdog_cpus);
- if (next_cpu >= nr_cpu_ids)
- next_cpu = cpumask_first(&watchdog_cpus);
-
+ next_cpu = cpumask_next_wrap(cpu, &watchdog_cpus);
if (next_cpu == cpu)
return nr_cpu_ids;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu()
2025-06-05 0:12 [PATCH] watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu() Yury Norov
@ 2025-06-09 17:16 ` Doug Anderson
2025-06-21 14:58 ` Yury Norov
0 siblings, 1 reply; 3+ messages in thread
From: Doug Anderson @ 2025-06-09 17:16 UTC (permalink / raw)
To: Yury Norov; +Cc: linux-kernel
Hi,
On Wed, Jun 4, 2025 at 5:12 PM Yury Norov <yury.norov@gmail.com> wrote:
>
> From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
>
> The dedicated helper is more verbose and efficient comparing to
> cpumask_next() followed by cpumask_first().
>
> Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
> ---
> kernel/watchdog_buddy.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
Reviewed-by: Douglas Anderson <dianders@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu()
2025-06-09 17:16 ` Doug Anderson
@ 2025-06-21 14:58 ` Yury Norov
0 siblings, 0 replies; 3+ messages in thread
From: Yury Norov @ 2025-06-21 14:58 UTC (permalink / raw)
To: Doug Anderson; +Cc: linux-kernel
On Mon, Jun 09, 2025 at 10:16:51AM -0700, Doug Anderson wrote:
> Hi,
>
> On Wed, Jun 4, 2025 at 5:12 PM Yury Norov <yury.norov@gmail.com> wrote:
> >
> > From: Yury Norov [NVIDIA] <yury.norov@gmail.com>
> >
> > The dedicated helper is more verbose and efficient comparing to
> > cpumask_next() followed by cpumask_first().
> >
> > Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
> > ---
> > kernel/watchdog_buddy.c | 5 +----
> > 1 file changed, 1 insertion(+), 4 deletions(-)
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
Thanks, Douglas. Adding in bitmap-for-next for testing.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-21 14:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 0:12 [PATCH] watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu() Yury Norov
2025-06-09 17:16 ` Doug Anderson
2025-06-21 14:58 ` Yury Norov
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).