Skip to contentSkip to conversation

staging: lustre: lustre: lmv: fix sparse warnings about static declarations

PATCH In review Mohammad Jamal 2 participants 2 messages Feb 3, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: lustre: lmv: fix sparse warnings about static declarations

This patch adds a static keyword to lprocfs_lmv_init_vars and lprocfs_lmv_module_vars to suppress the sparse warnings about static declaration

---
 drivers/staging/lustre/lustre/lmv/lproc_lmv.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/lmv/lproc_lmv.c +2 -2
index 5be4176..804476b 100644
@@ -215,7 +215,7 @@ static struct lprocfs_vars lprocfs_lmv_module_vars[] = {
 	{ NULL }
 };
 
-struct file_operations lmv_proc_target_fops = {
+static struct file_operations lmv_proc_target_fops = {
 	.owner		= THIS_MODULE,
 	.open		 = lmv_target_seq_open,
 	.read		 = seq_read,
@@ -223,7 +223,7 @@ struct file_operations lmv_proc_target_fops = {
 	.release	      = seq_release,
 };
 
-void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars)
+static void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars)
 {
 	lvars->module_vars    = lprocfs_lmv_module_vars;
 	lvars->obd_vars       = lprocfs_lmv_obd_vars;
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 3 lines · Mohammad Jamal

This patch adds a static keyword to lprocfs_lmv_init_vars and lprocfs_lmv_module_vars to suppress the sparse warnings about static declaration

have you build tested your patch?

After your patch:
drivers/staging/lustre/lustre/lmv/lproc_lmv.c:218:31: warning: ‘lmv_proc_target_fops’ defined but not used [-Wunused-variable] drivers/staging/lustre/lustre/lmv/lproc_lmv.c:226:13: warning: ‘lprocfs_lmv_init_vars’ defined but not used [-Wunused-function]

WARNING: "lprocfs_lmv_init_vars" [drivers/staging/lustre/lustre/lmv/lmv.ko] undefined!
WARNING: "lmv_proc_target_fops" [drivers/staging/lustre/lustre/lmv/lmv.ko] undefined!

regards
sudip

Quoted 3 lines

---

<snip>

Quoted 2 lines

More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/