public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Restrict definition of a variable in kernel/sysctl.c
@ 2009-03-18 21:49 Dmitri Vorobiev
  2009-03-18 21:49 ` [PATCH 2/3] Restrict definition of a label in kernel/module.c Dmitri Vorobiev
  2009-03-19  7:25 ` [PATCH 1/3] Restrict definition of a variable in kernel/sysctl.c Ingo Molnar
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitri Vorobiev @ 2009-03-18 21:49 UTC (permalink / raw)
  To: akpm, linux-kernel; +Cc: Dmitri Vorobiev

The variable "one" in kernel/sysctl.c is used only if either CONFIG_HIGHMEM,
or CONFIG_DETECT_SOFTLOCKUP are defined (or both). Hence, if neither option
is enabled, the following error is produced:

  CC      kernel/sysctl.o
kernel/sysctl.c:99: warning: 'one' defined but not used

This patch fixes the warning by moving the variable definition under an
appropriate preprocessor construct.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
---
 kernel/sysctl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index c5ef44f..f172d9f 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -95,12 +95,15 @@ static int sixty = 60;
 static int neg_one = -1;
 #endif
 
+#if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM)
+static int one = 1;
+#endif
+
 #if defined(CONFIG_MMU) && defined(CONFIG_FILE_LOCKING)
 static int two = 2;
 #endif
 
 static int zero;
-static int one = 1;
 static unsigned long one_ul = 1;
 static int one_hundred = 100;
 
-- 
1.5.6.3


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

end of thread, other threads:[~2009-03-30 21:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-18 21:49 [PATCH 1/3] Restrict definition of a variable in kernel/sysctl.c Dmitri Vorobiev
2009-03-18 21:49 ` [PATCH 2/3] Restrict definition of a label in kernel/module.c Dmitri Vorobiev
2009-03-18 21:49   ` [PATCH 3/3] Restrict definition of a static function in kernel/auditsc.c Dmitri Vorobiev
2009-03-30 21:32     ` Andrew Morton
2009-03-19  7:25 ` [PATCH 1/3] Restrict definition of a variable in kernel/sysctl.c Ingo Molnar

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