All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: obdclass: clean function declarations in obd_config.c and class_obd.c up
@ 2016-09-17 13:30 ` Baoyou Xie
  0 siblings, 0 replies; 2+ messages in thread
From: Baoyou Xie @ 2016-09-17 13:30 UTC (permalink / raw
  To: oleg.drokin, andreas.dilger, jsimmons, gregkh, john.hammond,
	shraddha.6596, di.wang, ksenija.stanojevic, mike.rapoport,
	andrew.perepechko, kirill.shutemov, emoly.liu, arnd, amir.shehata,
	dmitry.eremin
  Cc: lustre-devel, devel, linux-kernel, baoyou.xie, xie.baoyou

We get 3 warnings when building kernel with W=1:

drivers/staging/lustre/lustre/obdclass/obd_mount.c:705:5: warning: no previous prototype for 'lustre_check_exclusion' [-Wmissing-prototypes]
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1226:5: warning: no previous prototype for 'lustre_register_fs' [-Wmissing-prototypes]
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1231:5: warning: no previous prototype for 'lustre_unregister_fs' [-Wmissing-prototypes]

In fact, the first function is declared in
drivers/staging/lustre/lustre/obdclass/obd_config.c,
and the other two functions are declared in
drivers/staging/lustre/lustre/obdclass/class_obd.c,
but all of these functions should be declared in 
a header file, thus can be recognized in other file.

So this patch moves the declarations into
drivers/staging/lustre/lustre/include/obd_class.h.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/staging/lustre/lustre/include/obd_class.h   | 3 +++
 drivers/staging/lustre/lustre/obdclass/class_obd.c  | 4 ----
 drivers/staging/lustre/lustre/obdclass/obd_config.c | 2 --
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index 9965a01..4a8a459 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -1696,6 +1696,9 @@ struct lwp_register_item {
 extern int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c);
 
 /* obd_mount.c */
+int lustre_unregister_fs(void);
+int lustre_register_fs(void);
+int lustre_check_exclusion(struct super_block *sb, char *svname);
 
 /* sysctl.c */
 int obd_sysctl_init(void);
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 397929a..381b8ba 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -451,8 +451,6 @@ static int __init obdclass_init(void)
 {
 	int i, err;
 
-	int lustre_register_fs(void);
-
 	LCONSOLE_INFO("Lustre: Build Version: " LUSTRE_VERSION_STRING "\n");
 
 	spin_lock_init(&obd_types_lock);
@@ -519,8 +517,6 @@ static int __init obdclass_init(void)
 
 static void obdclass_exit(void)
 {
-	int lustre_unregister_fs(void);
-
 	lustre_unregister_fs();
 
 	misc_deregister(&obd_psdev);
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index b7dcadb..036f396 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -1047,8 +1047,6 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
 }
 EXPORT_SYMBOL(class_process_proc_param);
 
-extern int lustre_check_exclusion(struct super_block *sb, char *svname);
-
 /** Parse a configuration llog, doing various manipulations on them
  * for various reasons, (modifications for compatibility, skip obsolete
  * records, change uuids, etc), then class_process_config() resulting
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [lustre-devel] [PATCH] staging: lustre: obdclass: clean function declarations in obd_config.c and class_obd.c up
@ 2016-09-17 13:30 ` Baoyou Xie
  0 siblings, 0 replies; 2+ messages in thread
From: Baoyou Xie @ 2016-09-17 13:30 UTC (permalink / raw
  To: oleg.drokin, andreas.dilger, jsimmons, gregkh, john.hammond,
	shraddha.6596, di.wang, ksenija.stanojevic, mike.rapoport,
	andrew.perepechko, kirill.shutemov, emoly.liu, arnd, amir.shehata,
	dmitry.eremin
  Cc: lustre-devel, devel, linux-kernel, baoyou.xie, xie.baoyou

We get 3 warnings when building kernel with W=1:

drivers/staging/lustre/lustre/obdclass/obd_mount.c:705:5: warning: no previous prototype for 'lustre_check_exclusion' [-Wmissing-prototypes]
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1226:5: warning: no previous prototype for 'lustre_register_fs' [-Wmissing-prototypes]
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1231:5: warning: no previous prototype for 'lustre_unregister_fs' [-Wmissing-prototypes]

In fact, the first function is declared in
drivers/staging/lustre/lustre/obdclass/obd_config.c,
and the other two functions are declared in
drivers/staging/lustre/lustre/obdclass/class_obd.c,
but all of these functions should be declared in 
a header file, thus can be recognized in other file.

So this patch moves the declarations into
drivers/staging/lustre/lustre/include/obd_class.h.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/staging/lustre/lustre/include/obd_class.h   | 3 +++
 drivers/staging/lustre/lustre/obdclass/class_obd.c  | 4 ----
 drivers/staging/lustre/lustre/obdclass/obd_config.c | 2 --
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index 9965a01..4a8a459 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -1696,6 +1696,9 @@ struct lwp_register_item {
 extern int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c);
 
 /* obd_mount.c */
+int lustre_unregister_fs(void);
+int lustre_register_fs(void);
+int lustre_check_exclusion(struct super_block *sb, char *svname);
 
 /* sysctl.c */
 int obd_sysctl_init(void);
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 397929a..381b8ba 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -451,8 +451,6 @@ static int __init obdclass_init(void)
 {
 	int i, err;
 
-	int lustre_register_fs(void);
-
 	LCONSOLE_INFO("Lustre: Build Version: " LUSTRE_VERSION_STRING "\n");
 
 	spin_lock_init(&obd_types_lock);
@@ -519,8 +517,6 @@ static int __init obdclass_init(void)
 
 static void obdclass_exit(void)
 {
-	int lustre_unregister_fs(void);
-
 	lustre_unregister_fs();
 
 	misc_deregister(&obd_psdev);
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index b7dcadb..036f396 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -1047,8 +1047,6 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
 }
 EXPORT_SYMBOL(class_process_proc_param);
 
-extern int lustre_check_exclusion(struct super_block *sb, char *svname);
-
 /** Parse a configuration llog, doing various manipulations on them
  * for various reasons, (modifications for compatibility, skip obsolete
  * records, change uuids, etc), then class_process_config() resulting
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-17 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-17 13:30 [PATCH] staging: lustre: obdclass: clean function declarations in obd_config.c and class_obd.c up Baoyou Xie
2016-09-17 13:30 ` [lustre-devel] " Baoyou Xie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.