Skip to contentSkip to conversation

Staging: lustre: obdclass: Declare function as static

PATCH In review Bhumika Goyal 2 participants 3 messages Feb 12, 2016 – Feb 13, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lustre: obdclass: Declare function as static

Declare the function cache_stats_print as static since it is used only in this file. Used grep to find occurences. Problem found using sparse.

---
 drivers/staging/lustre/lustre/obdclass/cl_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/lustre/lustre/obdclass/cl_object.c +2 -1
index 57c8d54..f118983 100644
@@ -362,7 +362,8 @@ void cache_stats_init(struct cache_stats *cs, const char *name)
 		atomic_set(&cs->cs_stats[i], 0);
 }
 
-int cache_stats_print(const struct cache_stats *cs, struct seq_file *m, int h)
+static int cache_stats_print(const struct cache_stats *cs,
+			     struct seq_file *m, int h)
 {
 	int i;
 	/*
Signature · 1 line
1.9.1
#1 lore raw
Quoted 3 lines · Bhumika Goyal

Declare the function cache_stats_print as static since it is used only in this file. Used grep to find occurences. Problem found using sparse.

Good idea. You may also find some functions that are simply not used at all.

julia

Quoted 30 lines
---
 drivers/staging/lustre/lustre/obdclass/cl_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/lustre/lustre/obdclass/cl_object.c +2 -1
index 57c8d54..f118983 100644
@@ -362,7 +362,8 @@ void cache_stats_init(struct cache_stats *cs, const char *name)
 		atomic_set(&cs->cs_stats[i], 0);
 }
 
-int cache_stats_print(const struct cache_stats *cs, struct seq_file *m, int h)
+static int cache_stats_print(const struct cache_stats *cs,
+			     struct seq_file *m, int h)
 {
 	int i;
 	/*
Signature · 8 lines
1.9.1

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1455258208-7768-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
#2 lore raw

I am surely sending some patches for removing unused functions. Thanks,
Bhumika