[PATCH] staging: lustre: osc: Make osc_init() static

Andreas Ruprecht rupran at einserver.de
Mon Feb 2 19:24:14 UTC 2015


osc_init() is marked as the module_init function in osc_request.c
and is never used anywhere else. Hence, it can (and should) be
declared static.

sparse also complained about this with the following warning, which
is fixed by this patch.

andreas at workbox:~/linux-next$ make C=1 M=drivers/staging/lustre/lustre/osc/
[...]
drivers/staging/lustre/lustre/osc/osc_request.c:3335:12: warning:
symbol 'osc_init' was not declared. Should it be static?
[...]

Signed-off-by: Andreas Ruprecht <rupran at einserver.de>
---
 drivers/staging/lustre/lustre/osc/osc_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c
index b9450b9..0adfa70 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -3332,7 +3332,7 @@ extern struct lu_kmem_descr osc_caches[];
 extern spinlock_t osc_ast_guard;
 extern struct lock_class_key osc_ast_guard_class;
 
-int __init osc_init(void)
+static int __init osc_init(void)
 {
 	struct lprocfs_static_vars lvars = { NULL };
 	int rc;
-- 
1.9.1



More information about the devel mailing list