lkml.org 
[lkml]   [2011]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] fs, coda: Fix compile warning when CONFIG_SYSCTL=n.
From
When CONFIG_SYSCTL=n, we get the following warning:

fs/coda/sysctl.c:18: warning: ‘coda_table’ defined but not used

Following patches fixes the above warning by making sure coda_table
and it's callee
function are in the same context. It also cleans up the code by
removing extra #ifdef.


Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
---

diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c
index c6405ce..d9cc2b3 100644
--- a/fs/coda/sysctl.c
+++ b/fs/coda/sysctl.c
@@ -13,7 +13,6 @@

#ifdef CONFIG_SYSCTL
static struct ctl_table_header *fs_table_header;
-#endif

static ctl_table coda_table[] = {
{
@@ -40,7 +39,6 @@ static ctl_table coda_table[] = {
{}
};

-#ifdef CONFIG_SYSCTL
static ctl_table fs_table[] = {
{
.procname = "coda",
@@ -49,22 +47,23 @@ static ctl_table fs_table[] = {
},
{}
};
-#endif

void coda_sysctl_init(void)
{
-#ifdef CONFIG_SYSCTL
if ( !fs_table_header )
fs_table_header = register_sysctl_table(fs_table);
-#endif
}

void coda_sysctl_clean(void)
{
-#ifdef CONFIG_SYSCTL
if ( fs_table_header ) {
unregister_sysctl_table(fs_table_header);
fs_table_header = NULL;
}
-#endif
}
+#else
+
+#define coda_sysctl_init() do { } while (0);
+#define coda_sysctl_clean() do { } while (0);
+
+#endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2011-03-13 16:51    [W:0.064 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site