Whamcloud - gitweb
b=23685 don't define unused variables
authorBrian J. Murrell <brian.murrell@oracle.com>
Fri, 8 Oct 2010 14:15:32 +0000 (10:15 -0400)
committerVitaly Fertman <vitaly.fertman@sun.com>
Tue, 12 Oct 2010 22:27:22 +0000 (02:27 +0400)
When CONFIG_SYSCTL is not defined in the kernel config, a couple of
variables are left unused, yet still defined.

i=Dmitry Zogin
i=Andrew Perepechko

libcfs/libcfs/linux/linux-proc.c
lustre/obdclass/linux/linux-sysctl.c

index 5c5af72..220c671 100644 (file)
@@ -76,7 +76,9 @@
 #include <asm/div64.h>
 #include "tracefile.h"
 
 #include <asm/div64.h>
 #include "tracefile.h"
 
+#ifdef CONFIG_SYSCTL
 static cfs_sysctl_table_header_t *lnet_table_header = NULL;
 static cfs_sysctl_table_header_t *lnet_table_header = NULL;
+#endif
 extern char lnet_upcall[1024];
 /**
  * The path of debug log dump upcall script.
 extern char lnet_upcall[1024];
 /**
  * The path of debug log dump upcall script.
@@ -491,6 +493,7 @@ static cfs_sysctl_table_t lnet_table[] = {
         {0}
 };
 
         {0}
 };
 
+#ifdef CONFIG_SYSCTL
 static cfs_sysctl_table_t top_table[] = {
         {
                 .ctl_name = CTL_LNET,
 static cfs_sysctl_table_t top_table[] = {
         {
                 .ctl_name = CTL_LNET,
@@ -507,7 +510,6 @@ static cfs_sysctl_table_t top_table[] = {
 
 int insert_proc(void)
 {
 
 int insert_proc(void)
 {
-#ifdef CONFIG_SYSCTL
         if (lnet_table_header == NULL)
                 lnet_table_header = cfs_register_sysctl_table(top_table, 0);
 #endif
         if (lnet_table_header == NULL)
                 lnet_table_header = cfs_register_sysctl_table(top_table, 0);
 #endif
index 4f10cdb..dc3b1fb 100644 (file)
@@ -54,7 +54,9 @@
 #include <obd_support.h>
 #include <lprocfs_status.h>
 
 #include <obd_support.h>
 #include <lprocfs_status.h>
 
+#ifdef CONFIG_SYSCTL
 cfs_sysctl_table_header_t *obd_table_header = NULL;
 cfs_sysctl_table_header_t *obd_table_header = NULL;
+#endif
 
 #ifndef HAVE_SYSCTL_UNNUMBERED
 
 
 #ifndef HAVE_SYSCTL_UNNUMBERED
 
@@ -322,6 +324,7 @@ int LL_PROC_PROTO(proc_at_history)
         return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
 }
 
         return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
 }
 
+#ifdef CONFIG_SYSCTL
 static cfs_sysctl_table_t obd_table[] = {
         {
                 .ctl_name = OBD_FAIL_LOC,
 static cfs_sysctl_table_t obd_table[] = {
         {
                 .ctl_name = OBD_FAIL_LOC,
@@ -483,6 +486,7 @@ static cfs_sysctl_table_t parent_table[] = {
         },
         {0}
 };
         },
         {0}
 };
+#endif
 
 void obd_sysctl_init (void)
 {
 
 void obd_sysctl_init (void)
 {