* [PATCH 3/3] ipc: fix warning of not used variable
@ 2008-12-04 1:00 Jianjun Kong
2008-12-04 10:13 ` Ingo Molnar
0 siblings, 1 reply; 3+ messages in thread
From: Jianjun Kong @ 2008-12-04 1:00 UTC (permalink / raw)
To: akpm; +Cc: Linux-Kernel-Mailing-List
fix this warning:
ipc/ipc_sysctl.c:39: warning: ‘ipc_auto_callback’ defined but not used
ipc_auto_callback() just called when CONFIG_PROC_FS was defined.
Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
---
ipc/ipc_sysctl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 0dfebc5..9e42478 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -35,6 +35,7 @@ static void *get_ipc(ctl_table *table)
* add/remove or ipc namespace creation/removal.
* 1: register back the callback routine.
*/
+#ifdef CONFIG_PROC_FS
static void ipc_auto_callback(int val)
{
if (!val)
@@ -49,7 +50,6 @@ static void ipc_auto_callback(int val)
}
}
-#ifdef CONFIG_PROC_FS
static int proc_ipc_dointvec(ctl_table *table, int write, struct file *filp,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
--
1.5.6.3
--
Jianjun Kong | Happy Hacking
HOMEPAGE: http://kongove.cn/
GTALK: kongjianjun@gmail.com
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] ipc: fix warning of not used variable
2008-12-04 1:00 [PATCH 3/3] ipc: fix warning of not used variable Jianjun Kong
@ 2008-12-04 10:13 ` Ingo Molnar
2008-12-04 11:25 ` Américo Wang
0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2008-12-04 10:13 UTC (permalink / raw)
To: Jianjun Kong; +Cc: akpm, Linux-Kernel-Mailing-List
* Jianjun Kong <jianjun@zeuux.org> wrote:
>
> fix this warning:
> ipc/ipc_sysctl.c:39: warning: ‘ipc_auto_callback’ defined but not used
> ipc_auto_callback() just called when CONFIG_PROC_FS was defined.
>
>
> Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
> ---
> ipc/ipc_sysctl.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
NAK.
the proper fix, considering all the possibilities, is below.
Ingo
------------------->
>From 8f845313ba091a6041e666c611ef9bb751d91723 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Mon, 20 Oct 2008 09:19:55 +0200
Subject: [PATCH] fix warning in ipc/ipc_sysctl.c
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
fix this warning:
ipc/ipc_sysctl.c:39: warning: ‘ipc_auto_callback’ defined but not used
Move the already present #ifdef CONFIG_PROC_FS up by one function.
Also prepare get_ipc() for the !PROC_FS && !SYSCTL_SYSCALL case.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
ipc/ipc_sysctl.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 0dfebc5..010850a 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -18,6 +18,7 @@
#include <linux/msg.h>
#include "util.h"
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSCTL_SYSCALL)
static void *get_ipc(ctl_table *table)
{
char *which = table->data;
@@ -25,7 +26,9 @@ static void *get_ipc(ctl_table *table)
which = (which - (char *)&init_ipc_ns) + (char *)ipc_ns;
return which;
}
+#endif
+#ifdef CONFIG_PROC_FS
/*
* Routine that is called when the file "auto_msgmni" has successfully been
* written.
@@ -49,7 +52,6 @@ static void ipc_auto_callback(int val)
}
}
-#ifdef CONFIG_PROC_FS
static int proc_ipc_dointvec(ctl_table *table, int write, struct file *filp,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] ipc: fix warning of not used variable
2008-12-04 10:13 ` Ingo Molnar
@ 2008-12-04 11:25 ` Américo Wang
0 siblings, 0 replies; 3+ messages in thread
From: Américo Wang @ 2008-12-04 11:25 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Jianjun Kong, akpm, Linux-Kernel-Mailing-List
On Thu, Dec 4, 2008 at 10:13 AM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Jianjun Kong <jianjun@zeuux.org> wrote:
>
>>
>> fix this warning:
>> ipc/ipc_sysctl.c:39: warning: 'ipc_auto_callback' defined but not used
>> ipc_auto_callback() just called when CONFIG_PROC_FS was defined.
>>
>>
>> Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
>> ---
>> ipc/ipc_sysctl.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> NAK.
>
> the proper fix, considering all the possibilities, is below.
>
Already fixed in -mm, please do search lkml archive before posting.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-04 11:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-04 1:00 [PATCH 3/3] ipc: fix warning of not used variable Jianjun Kong
2008-12-04 10:13 ` Ingo Molnar
2008-12-04 11:25 ` Américo Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox