rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c
Subsystems (2)
PATCH 1/1 rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c
To fix:
kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?
--- kernel/ksysfs.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/ksysfs.c +2 -0
@@ -19,6 +19,8 @@#include <linux/sched.h> #include <linux/capability.h> +#include "rcu/rcu.h" /* rcu_expedited */ +#define KERNEL_ATTR_RO (_name) \ static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
Signature · 1 line
1.8.5.2
Paul E. McKenney
AppliedQuoted 6 lines · Paul Gortmaker
To fix:
kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?Cc "Paul E. McKenney" <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Queued, thank you!
Thanx, Paul
Quoted 20 lines
--- kernel/ksysfs.c | 2 ++ 1 file changed, 2 insertions(+)kernel/ksysfs.c +2
-0@@ -19,6 +19,8 @@#include <linux/sched.h> #include <linux/capability.h> +#include "rcu/rcu.h" /* rcu_expedited */ +#define KERNEL_ATTR_RO (_name) \ static struct kobj_attribute _name##_attr = __ATTR_RO(_name)Signature · 1 line
1.8.5.2
Quoted 9 lines · Paul E. McKenney
Quoted 6 lines · Paul Gortmaker
To fix:
kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?Cc "Paul E. McKenney" <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>Queued, thank you!
Upon further review, I moved the rcu_expedited declaration to include/linux/rcupdate.h in order to avoid including RCU-specific kernel/rcu/rcu.h into non-RCU files. This resulted in the patch below. Please let me know if you have any objections to this change.
Thanx, Paul
------------------------------------------------------------------------
rcu: Fix sparse warning for rcu_expedited from kernel/ksysfs.c
This commit fixes the follwoing warning:
kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?
[ paulmck: Moved the declaration to include/linux/rcupdate.h to avoid
including the RCU-internal rcu.h file outside of RCU. ]
include/linux/rcupdate.h +1 -0
@@ -46,6 +46,7 @@#include <linux/compiler.h> #include <asm/barrier.h> +extern int rcu_expedited;/* for sysctl */ #ifdef CONFIG_RCU_TORTURE_TEST extern int rcutorture_runnable;/* for sysctl */ #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
kernel/ksysfs.c +2 -0
@@ -19,6 +19,8 @@#include <linux/sched.h> #include <linux/capability.h> +#include <linux/rcupdate.h> /* rcu_expedited */ +#define KERNEL_ATTR_RO (_name) \ static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
kernel/rcu/rcu.h +0 -2
@@ -116,8 +116,6 @@ static inline bool __rcu_reclaim(const char *rn, struct rcu_head *head) } } -extern int rcu_expedited; -#ifdef CONFIG_RCU_STALL_COMMON extern int rcu_cpu_stall_suppress;
Quoted 9 lines · [Re: [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c]…
Quoted 8 lines · Paul E. McKenney
Quoted 6 lines · Paul Gortmaker
To fix:
kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?Cc "Paul E. McKenney" <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Quoted 6 lines
Quoted 1 line
Queued, thank you!
Upon further review, I moved the
rcu_expediteddeclaration toinclude/linux/rcupdate.hin order to avoid including RCU-specifickernel/rcu/rcu.hinto non-RCU files. This resulted in the patch below. Please let me know if you have any objections to this change.
I should learn to read my mailbox from oldest to newest after a holiday! Looks good to me. [I compiled it by eye, without speculative writes ;) ]
I think we should still use the other rcu.h / trace header fix I'd sent in response to Fengguang's report even with this change though.
Thanks,
Paul.
--
Quoted 55 lines
Thanx, Paul
------------------------------------------------------------------------
rcu: Fix sparse warning for
rcu_expeditedfromkernel/ksysfs.cThis commit fixes the follwoing warning:
kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?Signed-off-by Paul Gortmaker <[email protected]>[ paulmck: Moved the declaration to
include/linux/rcupdate.hto avoid
including the RCU-internalrcu.hfile outside of RCU. ]Signed-off-by Paul E. McKenney <[email protected]>include/linux/rcupdate.h +1
-0@@ -46,6 +46,7 @@#include <linux/compiler.h> #include <asm/barrier.h> +extern int rcu_expedited;/* for sysctl */ #ifdef CONFIG_RCU_TORTURE_TEST extern int rcutorture_runnable;/* for sysctl */ #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ kernel/ksysfs.c +2
-0@@ -19,6 +19,8 @@#include <linux/sched.h> #include <linux/capability.h> +#include <linux/rcupdate.h> /* rcu_expedited */ +#define KERNEL_ATTR_RO (_name) \ static struct kobj_attribute _name##_attr = __ATTR_RO(_name)kernel/rcu/rcu.h +0
-2@@ -116,8 +116,6 @@ static inline bool __rcu_reclaim(const char *rn, struct rcu_head *head) } } -extern int rcu_expedited; -#ifdef CONFIG_RCU_STALL_COMMON extern int rcu_cpu_stall_suppress;