]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcu: Use the BITS_PER_LONG macro
authorJinjie Ruan <ruanjinjie@huawei.com>
Mon, 2 Sep 2024 11:06:54 +0000 (19:06 +0800)
committerFrederic Weisbecker <frederic@kernel.org>
Tue, 12 Nov 2024 20:41:04 +0000 (21:41 +0100)
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>
kernel/rcu/tree.c

index b1f883fcd9185a5e22c10102d1024c40688f57fb..38b121a773669d231da43536b09a4e3fa0afcfc8 100644 (file)
@@ -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;