summaryrefslogtreecommitdiff
path: root/kernel/rcu
diff options
context:
space:
mode:
authorJinjie Ruan <ruanjinjie@huawei.com>2024-09-02 19:06:54 +0800
committerFrederic Weisbecker <frederic@kernel.org>2024-11-12 21:41:04 +0100
commit5d2501f42cf8caad1abb44a37f20195a52e1cf07 (patch)
tree745c2a2e64aabcb34f469bce41e6e33c67383f1a /kernel/rcu
parentc32912069654f7bf4352f51c9e6386de71b10b62 (diff)
downloadlwn-5d2501f42cf8caad1abb44a37f20195a52e1cf07.tar.gz
lwn-5d2501f42cf8caad1abb44a37f20195a52e1cf07.zip
rcu: Use the BITS_PER_LONG macro
sizeof(unsigned long) * 8 is the number of bits in an unsigned long variable, replace it with BITS_PER_LONG macro to make it simpler. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Reviewed-by: "Paul E. McKenney" <paulmck@kernel.org> Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/tree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index b1f883fcd918..38b121a77366 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -5580,8 +5580,7 @@ void rcu_init_geometry(void)
* Complain and fall back to the compile-time values if this
* limit is exceeded.
*/
- if (rcu_fanout_leaf < 2 ||
- rcu_fanout_leaf > sizeof(unsigned long) * 8) {
+ if (rcu_fanout_leaf < 2 || rcu_fanout_leaf > BITS_PER_LONG) {
rcu_fanout_leaf = RCU_FANOUT_LEAF;
WARN_ON(1);
return;