From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754326AbaBQUgX (ORCPT ); Mon, 17 Feb 2014 15:36:23 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:43575 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753280AbaBQUgW (ORCPT ); Mon, 17 Feb 2014 15:36:22 -0500 Date: Mon, 17 Feb 2014 12:36:18 -0800 From: "Paul E. McKenney" To: Paul Gortmaker Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: fix sparse warning for rcu_expedited from kernel/ksysfs.c Message-ID: <20140217203618.GA24824@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1392153012-14378-1-git-send-email-paul.gortmaker@windriver.com> <20140214003207.GN4250@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140214003207.GN4250@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14021720-1344-0000-0000-000005D5247E Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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" > > Signed-off-by: Paul Gortmaker > > 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 [ 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 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 #include +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 #include +#include /* 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;