public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c
@ 2014-02-11 21:10 Paul Gortmaker
  2014-02-14  0:32 ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Gortmaker @ 2014-02-11 21:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Paul E. McKenney

To fix:

kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?

Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 kernel/ksysfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index d945a949760f..53476a147b9a 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -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)
 
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c
  2014-02-11 21:10 [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c Paul Gortmaker
@ 2014-02-14  0:32 ` Paul E. McKenney
  2014-02-17 20:36   ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2014-02-14  0:32 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel

On Tue, Feb 11, 2014 at 04:10:12PM -0500, Paul Gortmaker wrote:
> To fix:
> 
> kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?
> 
> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Queued, thank you!

							Thanx, Paul

> ---
>  kernel/ksysfs.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
> index d945a949760f..53476a147b9a 100644
> --- a/kernel/ksysfs.c
> +++ b/kernel/ksysfs.c
> @@ -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)
> 
> -- 
> 1.8.5.2
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c
  2014-02-14  0:32 ` Paul E. McKenney
@ 2014-02-17 20:36   ` Paul E. McKenney
  2014-02-19  4:35     ` Paul Gortmaker
  0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2014-02-17 20:36 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel

On Thu, Feb 13, 2014 at 04:32:07PM -0800, Paul E. McKenney wrote:
> On Tue, Feb 11, 2014 at 04:10:12PM -0500, Paul Gortmaker wrote:
> > To fix:
> > 
> > kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?
> > 
> > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> 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?

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
[ paulmck: Moved the declaration to include/linux/rcupdate.h to avoid
   including the RCU-internal rcu.h file outside of RCU. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 55b605b49315..e4be6263807e 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -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 */
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index d945a949760f..e660964086e2 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -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)
 
diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
index 1bd787fddcb2..af2e60a8425d 100644
--- a/kernel/rcu/rcu.h
+++ b/kernel/rcu/rcu.h
@@ -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;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c
  2014-02-17 20:36   ` Paul E. McKenney
@ 2014-02-19  4:35     ` Paul Gortmaker
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Gortmaker @ 2014-02-19  4:35 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: linux-kernel

[Re: [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c] On 17/02/2014 (Mon 12:36) Paul E. McKenney wrote:

> On Thu, Feb 13, 2014 at 04:32:07PM -0800, Paul E. McKenney wrote:
> > On Tue, Feb 11, 2014 at 04:10:12PM -0500, Paul Gortmaker wrote:
> > > To fix:
> > > 
> > > kernel/ksysfs.c:143:5: warning: symbol 'rcu_expedited' was not declared. Should it be static?
> > > 
> > > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > 
> > 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.

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.
--
> 
> 							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?
> 
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> [ paulmck: Moved the declaration to include/linux/rcupdate.h to avoid
>    including the RCU-internal rcu.h file outside of RCU. ]
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 55b605b49315..e4be6263807e 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -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 */
> diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
> index d945a949760f..e660964086e2 100644
> --- a/kernel/ksysfs.c
> +++ b/kernel/ksysfs.c
> @@ -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)
>  
> diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
> index 1bd787fddcb2..af2e60a8425d 100644
> --- a/kernel/rcu/rcu.h
> +++ b/kernel/rcu/rcu.h
> @@ -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;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-19  4:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 21:10 [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c Paul Gortmaker
2014-02-14  0:32 ` Paul E. McKenney
2014-02-17 20:36   ` Paul E. McKenney
2014-02-19  4:35     ` Paul Gortmaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox