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

* [PATCH 2/3] Restrict definition of a label in kernel/module.c
  2009-03-18 21:49 [PATCH 1/3] Restrict definition of a variable in kernel/sysctl.c Dmitri Vorobiev
@ 2009-03-18 21:49 ` Dmitri Vorobiev
  2009-03-18 21:49   ` [PATCH 3/3] Restrict definition of a static function in kernel/auditsc.c Dmitri Vorobiev
  2009-03-19  7:25 ` [PATCH 1/3] Restrict definition of a variable in kernel/sysctl.c Ingo Molnar
  1 sibling, 1 reply; 5+ messages in thread
From: Dmitri Vorobiev @ 2009-03-18 21:49 UTC (permalink / raw)
  To: akpm, linux-kernel; +Cc: Dmitri Vorobiev

In function 'load_module' in kernel/module.c, the label 'free_init'
is used if and only if both CONFIG_MODULE_UNLOAD and CONFIG_SMP are
defined. However, the label itself is defined unconditionally,
which may produce the following warning:

kernel/module.c:2291: warning: label 'free_init' defined but not used

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

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

diff --git a/kernel/module.c b/kernel/module.c
index 1196f5d..df00a1b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2288,8 +2288,8 @@ static noinline struct module *load_module(void __user *umod,
 	ftrace_release(mod->module_core, mod->core_size);
  free_unload:
 	module_unload_free(mod);
- free_init:
 #if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
+ free_init:
 	percpu_modfree(mod->refptr);
 #endif
 	module_free(mod, mod->module_init);
-- 
1.5.6.3


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

* [PATCH 3/3] Restrict definition of a static function in kernel/auditsc.c
  2009-03-18 21:49 ` [PATCH 2/3] Restrict definition of a label in kernel/module.c Dmitri Vorobiev
@ 2009-03-18 21:49   ` Dmitri Vorobiev
  2009-03-30 21:32     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitri Vorobiev @ 2009-03-18 21:49 UTC (permalink / raw)
  To: akpm, linux-kernel; +Cc: Dmitri Vorobiev

The function 'audit_set_auditable' in kernel/auditsc.c is called
only when the CONFIG_AUDIT_TREE option is set. Therefore, the
following warning may be produced:

kernel/auditsc.c:745: warning: 'audit_set_auditable' defined but not used

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

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

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 8cbddff..bac40d0 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -741,6 +741,7 @@ void audit_filter_inodes(struct task_struct *tsk, struct audit_context *ctx)
 	rcu_read_unlock();
 }
 
+#ifdef CONFIG_AUDIT_TREE
 static void audit_set_auditable(struct audit_context *ctx)
 {
 	if (!ctx->prio) {
@@ -748,6 +749,7 @@ static void audit_set_auditable(struct audit_context *ctx)
 		ctx->current_state = AUDIT_RECORD_CONTEXT;
 	}
 }
+#endif
 
 static inline struct audit_context *audit_get_context(struct task_struct *tsk,
 						      int return_valid,
-- 
1.5.6.3


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

* Re: [PATCH 1/3] Restrict definition of a variable in kernel/sysctl.c
  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-19  7:25 ` Ingo Molnar
  1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2009-03-19  7:25 UTC (permalink / raw)
  To: Dmitri Vorobiev; +Cc: akpm, linux-kernel


* Dmitri Vorobiev <dmitri.vorobiev@movial.com> wrote:

> 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(-)

Note, this warning is already fixed in the tip:core/softlockup tree 
and queued up for v2.6.30.

	Ingo

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

* Re: [PATCH 3/3] Restrict definition of a static function in kernel/auditsc.c
  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
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2009-03-30 21:32 UTC (permalink / raw)
  To: Dmitri Vorobiev; +Cc: linux-kernel, dmitri.vorobiev

On Wed, 18 Mar 2009 23:49:27 +0200
Dmitri Vorobiev <dmitri.vorobiev@movial.com> wrote:

> The function 'audit_set_auditable' in kernel/auditsc.c is called
> only when the CONFIG_AUDIT_TREE option is set. Therefore, the
> following warning may be produced:
> 
> kernel/auditsc.c:745: warning: 'audit_set_auditable' defined but not used
> 
> This patch fixes the warning by moving the function definition under an
> appropriate preprocessor construct.
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
> ---
>  kernel/auditsc.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index 8cbddff..bac40d0 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -741,6 +741,7 @@ void audit_filter_inodes(struct task_struct *tsk, struct audit_context *ctx)
>  	rcu_read_unlock();
>  }
>  
> +#ifdef CONFIG_AUDIT_TREE
>  static void audit_set_auditable(struct audit_context *ctx)
>  {
>  	if (!ctx->prio) {
> @@ -748,6 +749,7 @@ static void audit_set_auditable(struct audit_context *ctx)
>  		ctx->current_state = AUDIT_RECORD_CONTEXT;
>  	}
>  }
> +#endif
>  
>  static inline struct audit_context *audit_get_context(struct task_struct *tsk,
>  						      int return_valid,

I already fixed this with the (IMO superior) patch below.

The patch was sent to the audit maintainers on Feb 11 and was resent on
March 4 and was both times ignored, along with the other two audit
patches I sent.

Bugger it, I'm fed up with this.  I'll merge them myself.



From: Andrew Morton <akpm@linux-foundation.org>

kernel/auditsc.c:745: warning: 'audit_set_auditable' defined but not used

Reported-by: Rakib Mullick <rakib.mullick@gmail.com>
Cc: Valdis.Kletnieks@vt.edu
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/auditsc.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff -puN kernel/auditsc.c~kernel-auditscc-fix-warning kernel/auditsc.c
--- a/kernel/auditsc.c~kernel-auditscc-fix-warning
+++ a/kernel/auditsc.c
@@ -364,6 +364,15 @@ static int grow_tree_refs(struct audit_c
 	ctx->tree_count = 31;
 	return 1;
 }
+
+static void audit_set_auditable(struct audit_context *ctx)
+{
+	if (!ctx->prio) {
+		ctx->prio = 1;
+		ctx->current_state = AUDIT_RECORD_CONTEXT;
+	}
+}
+
 #endif
 
 static void unroll_tree_refs(struct audit_context *ctx,
@@ -741,14 +750,6 @@ void audit_filter_inodes(struct task_str
 	rcu_read_unlock();
 }
 
-static void audit_set_auditable(struct audit_context *ctx)
-{
-	if (!ctx->prio) {
-		ctx->prio = 1;
-		ctx->current_state = AUDIT_RECORD_CONTEXT;
-	}
-}
-
 static inline struct audit_context *audit_get_context(struct task_struct *tsk,
 						      int return_valid,
 						      int return_code)
_


^ permalink raw reply	[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