提交 62494681 编写于 作者: P Peng Tao 提交者: Greg Kroah-Hartman

staging/lustre: fix defined not used warning

register_sysctl_table/unregister_sysctl_table are defined
regardless of CONFIG_SYSCTL true or false. so we don't need
to surround them with #ifdef CONFIG_SYSCTL. Besides, current
code got build warnings when CONFIG_SYSCTL is not set:
drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c:368:20: warning:
‘lnet_table’ defined but not used [-Wunused-variable]
Signed-off-by: NPeng Tao <bergwolf@gmail.com>
Signed-off-by: NAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c7c5da01
......@@ -908,21 +908,17 @@ static ctl_table_t top_table[] = {
void
lnet_proc_init(void)
{
#ifdef CONFIG_SYSCTL
if (lnet_table_header == NULL)
lnet_table_header = register_sysctl_table(top_table);
#endif
}
void
lnet_proc_fini(void)
{
#ifdef CONFIG_SYSCTL
if (lnet_table_header != NULL)
unregister_sysctl_table(lnet_table_header);
lnet_table_header = NULL;
#endif
}
#else
......
......@@ -65,9 +65,7 @@
#include <asm/div64.h>
#include "tracefile.h"
#ifdef CONFIG_SYSCTL
static ctl_table_header_t *lnet_table_header = NULL;
#endif
extern char lnet_upcall[1024];
/**
* The path of debug log dump upcall script.
......@@ -518,7 +516,6 @@ static ctl_table_t lnet_table[] = {
}
};
#ifdef CONFIG_SYSCTL
static ctl_table_t top_table[] = {
{
.procname = "lnet",
......@@ -530,23 +527,18 @@ static ctl_table_t top_table[] = {
{
}
};
#endif
int insert_proc(void)
{
#ifdef CONFIG_SYSCTL
if (lnet_table_header == NULL)
lnet_table_header = register_sysctl_table(top_table);
#endif
return 0;
}
void remove_proc(void)
{
#ifdef CONFIG_SYSCTL
if (lnet_table_header != NULL)
unregister_sysctl_table(lnet_table_header);
lnet_table_header = NULL;
#endif
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册