mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: clean function declarations in class_obd.c up
@ 2016-09-15 13:51 Baoyou Xie
  2016-09-15 14:52 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Baoyou Xie @ 2016-09-15 13:51 UTC (permalink / raw)
  To: oleg.drokin, andreas.dilger, jsimmons, gregkh, john.hammond,
	shraddha.6596, di.wang, ksenija.stanojevic, mike.rapoport,
	andrew.perepechko, kirill.shutemov, lustre-devel
  Cc: devel, linux-kernel, arnd, baoyou.xie, xie.baoyou

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

drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:413:5: warning: no previous prototype for 'class_procfs_init' [-Wmissing-prototypes]
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:449:5: warning: no previous prototype for 'class_procfs_clean' [-Wmissing-prototypes]

In fact, both functions are declared in
drivers/staging/lustre/lustre/obdclass/class_obd.c,but 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  | 4 ++++
 drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index 9702ad4..9965a01 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -1712,6 +1712,10 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid);
 void class_init_uuidlist(void);
 void class_exit_uuidlist(void);
 
+/*linux-module.c*/
+int class_procfs_init(void);
+int class_procfs_clean(void);
+
 /* class_obd.c */
 extern char obd_jobid_node[];
 extern struct miscdevice obd_psdev;
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 6700167..397929a 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -446,8 +446,6 @@ static int obd_init_checks(void)
 	return ret;
 }
 
-extern int class_procfs_init(void);
-extern int class_procfs_clean(void);
 
 static int __init obdclass_init(void)
 {
-- 
2.7.4

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

* Re: [PATCH] staging: lustre: clean function declarations in class_obd.c up
  2016-09-15 13:51 [PATCH] staging: lustre: clean function declarations in class_obd.c up Baoyou Xie
@ 2016-09-15 14:52 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-09-15 14:52 UTC (permalink / raw)
  To: Baoyou Xie
  Cc: oleg.drokin, andreas.dilger, jsimmons, john.hammond,
	shraddha.6596, di.wang, ksenija.stanojevic, mike.rapoport,
	andrew.perepechko, kirill.shutemov, lustre-devel, devel,
	xie.baoyou, linux-kernel, arnd

On Thu, Sep 15, 2016 at 09:51:27PM +0800, Baoyou Xie wrote:
> We get 2 warnings when building kernel with W=1:

Don't do that!  :)

> 
> drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:413:5: warning: no previous prototype for 'class_procfs_init' [-Wmissing-prototypes]
> drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:449:5: warning: no previous prototype for 'class_procfs_clean' [-Wmissing-prototypes]
> 
> In fact, both functions are declared in
> drivers/staging/lustre/lustre/obdclass/class_obd.c,but 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  | 4 ++++
>  drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 --
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
> index 9702ad4..9965a01 100644
> --- a/drivers/staging/lustre/lustre/include/obd_class.h
> +++ b/drivers/staging/lustre/lustre/include/obd_class.h
> @@ -1712,6 +1712,10 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid);
>  void class_init_uuidlist(void);
>  void class_exit_uuidlist(void);
>  
> +/*linux-module.c*/

Here, have a ' '.  make that two...

thanks,

greg k-h

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

end of thread, other threads:[~2016-09-15 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 13:51 [PATCH] staging: lustre: clean function declarations in class_obd.c up Baoyou Xie
2016-09-15 14:52 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®