Skip to contentSkip to conversation

staging: lustre: lov: Fix sparse warning

PATCH In review Paul Davies C 2 participants 2 messages Nov 21, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: lov: Fix sparse warning

This patch fixes the following warnings:-

drivers/staging/lustre/lustre/lov/lov_object.c:926:22: warning: symbol 'lov_lsm_get' was not declared. Should it be static? drivers/staging/lustre/lustre/lov/lov_object.c:942:6: warning: symbol 'lov_lsm_put' was not declared. Should it be static?

---
 drivers/staging/lustre/lustre/lov/lov_object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/lov/lov_object.c +2 -2
index c7ff817..a667336 100644
@@ -923,7 +923,7 @@ static struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov)
 	return lsm;
 }
 
-struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj)
+static struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj)
 {
 	struct lu_object *luobj;
 	struct lov_stripe_md *lsm = NULL;
@@ -939,7 +939,7 @@ struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj)
 }
 EXPORT_SYMBOL(lov_lsm_get);
 
-void lov_lsm_put(struct cl_object *unused, struct lov_stripe_md *lsm)
+static void lov_lsm_put(struct cl_object *unused, struct lov_stripe_md *lsm)
 {
 	if (lsm != NULL)
 		lov_free_memmd(&lsm);
Signature · 1 line
1.9.1
#1 lore raw

Hello!

Quoted 24 lines · Paul Davies C

This patch fixes the following warnings:-

drivers/staging/lustre/lustre/lov/lov_object.c:926:22: warning: symbol 'lov_lsm_get' was not declared. Should it be static? drivers/staging/lustre/lustre/lov/lov_object.c:942:6: warning: symbol 'lov_lsm_put' was not declared. Should it be static?

---
drivers/staging/lustre/lustre/lov/lov_object.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/lov/lov_object.c +1 -1
index c7ff817..a667336 100644
@@ -923,7 +923,7 @@ static struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov)
 	return lsm;
 }
 
-struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj)
+static struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj)
 {
 	struct lu_object *luobj;
 	struct lov_stripe_md *lsm = NULL;

drivers/staging/lustre/lustre/lov/lov_object.c struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) · line 940

Quoted 2 lines
drivers/staging/lustre/lustre/lov/lov_object.c +0 -0
@@ -939,7 +939,7 @@ struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj)
 }
 EXPORT_SYMBOL(lov_lsm_get);

You did not compile-tested this, did you?
This symbol is still used in lustre/lclient/lcommon_cl.c but also leaving EXPORT_SYMBOL intact for a static symbol?

Quoted 9 lines
drivers/staging/lustre/lustre/lov/lov_object.c +1 -1
-void lov_lsm_put(struct cl_object *unused, struct lov_stripe_md *lsm)
+static void lov_lsm_put(struct cl_object *unused, struct lov_stripe_md *lsm)
 {
 	if (lsm != NULL)
 		lov_free_memmd(&lsm);
Signature · 1 line
1.9.1