From: Yury Norov <yury.norov@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alexghiti@rivosinc.com>,
Yury Norov <yury.norov@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Charlie Jenkins <charlie@rivosinc.com>,
"Matthew Wilcox \(Oracle\)" <willy@infradead.org>,
Samuel Holland <samuel.holland@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
linux-riscv@lists.infradead.org
Subject: [PATCH] cpumask: de-duplicate assign_cpu() API
Date: Wed, 31 Jul 2024 12:53:54 -0700 [thread overview]
Message-ID: <20240731195355.97488-1-yury.norov@gmail.com> (raw)
We've got cpumask_assign_cpu() function and assign_cpu() macro, both
doing the same thing. We need to drop one to avoid unneeded duplicatioon.
Now that underlying assign_bit() implemented as a macro, it would make
sense to keep assign_cpu() which is also implemented as a macro, in sake
of unification.
This patch also removes __cpumask_assign_cpu() as the function is
unused.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
arch/riscv/mm/cacheflush.c | 2 +-
include/linux/cpumask.h | 16 ----------------
2 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c
index a03c994eed3b..fa136627ccaa 100644
--- a/arch/riscv/mm/cacheflush.c
+++ b/arch/riscv/mm/cacheflush.c
@@ -171,7 +171,7 @@ static void set_icache_stale_mask(void)
stale_cpu = cpumask_test_cpu(smp_processor_id(), mask);
cpumask_setall(mask);
- cpumask_assign_cpu(smp_processor_id(), mask, stale_cpu);
+ assign_cpu(smp_processor_id(), mask, stale_cpu);
}
#endif
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 801a7e524113..f896c6ffa78e 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -534,22 +534,6 @@ static __always_inline void __cpumask_clear_cpu(int cpu, struct cpumask *dstp)
__clear_bit(cpumask_check(cpu), cpumask_bits(dstp));
}
-/**
- * cpumask_assign_cpu - assign a cpu in a cpumask
- * @cpu: cpu number (< nr_cpu_ids)
- * @dstp: the cpumask pointer
- * @bool: the value to assign
- */
-static __always_inline void cpumask_assign_cpu(int cpu, struct cpumask *dstp, bool value)
-{
- assign_bit(cpumask_check(cpu), cpumask_bits(dstp), value);
-}
-
-static __always_inline void __cpumask_assign_cpu(int cpu, struct cpumask *dstp, bool value)
-{
- __assign_bit(cpumask_check(cpu), cpumask_bits(dstp), value);
-}
-
/**
* cpumask_test_cpu - test for a cpu in a cpumask
* @cpu: cpu number (< nr_cpu_ids)
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2024-07-31 19:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 19:53 Yury Norov [this message]
2024-08-01 17:27 ` [PATCH] cpumask: de-duplicate assign_cpu() API Charlie Jenkins
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=20240731195355.97488-1-yury.norov@gmail.com \
--to=yury.norov@gmail.com \
--cc=alexghiti@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=charlie@rivosinc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@rasmusvillemoes.dk \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=samuel.holland@sifive.com \
--cc=willy@infradead.org \
/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