public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration
@ 2014-12-16 14:39 Jia He
  2014-12-29  2:42 ` hejianet
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jia He @ 2014-12-16 14:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jia He, Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman

make sparse happy since these two fuchtion are only used in module.c.
tested by successful compilation.

Signed-off-by: Jia He <hejianet@gmail.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/lustre/lustre/libcfs/module.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index 2c4fc74..b9ee37c 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -42,8 +42,7 @@
 #include "../../include/linux/lnet/lnet.h"
 #include "tracefile.h"
 
-void
-kportal_memhog_free (struct libcfs_device_userstate *ldu)
+static void kportal_memhog_free (struct libcfs_device_userstate *ldu)
 {
 	struct page **level0p = &ldu->ldu_memhog_root_page;
 	struct page **level1p;
@@ -86,8 +85,7 @@ kportal_memhog_free (struct libcfs_device_userstate *ldu)
 	LASSERT (ldu->ldu_memhog_pages == 0);
 }
 
-int
-kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
+static int kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
 		     gfp_t flags)
 {
 	struct page **level0p;
-- 
1.9.1


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

* Re: [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration
  2014-12-16 14:39 [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration Jia He
@ 2014-12-29  2:42 ` hejianet
  2015-01-14  3:49 ` hejianet
  2015-01-14  6:35 ` Jeremiah Mahler
  2 siblings, 0 replies; 9+ messages in thread
From: hejianet @ 2014-12-29  2:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman

Ping.
Thanks for any comments

On Tue, 16 Dec 2014 22:39:38 +0800 from hejianet@gmail.com wrote:
> make sparse happy since these two fuchtion are only used in module.c.
> tested by successful compilation.
>
> Signed-off-by: Jia He <hejianet@gmail.com>
> Cc: Oleg Drokin <oleg.drokin@intel.com>
> Cc: Andreas Dilger <andreas.dilger@intel.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/staging/lustre/lustre/libcfs/module.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
> index 2c4fc74..b9ee37c 100644
> --- a/drivers/staging/lustre/lustre/libcfs/module.c
> +++ b/drivers/staging/lustre/lustre/libcfs/module.c
> @@ -42,8 +42,7 @@
>  #include "../../include/linux/lnet/lnet.h"
>  #include "tracefile.h"
>  
> -void
> -kportal_memhog_free (struct libcfs_device_userstate *ldu)
> +static void kportal_memhog_free (struct libcfs_device_userstate *ldu)
>  {
>  	struct page **level0p = &ldu->ldu_memhog_root_page;
>  	struct page **level1p;
> @@ -86,8 +85,7 @@ kportal_memhog_free (struct libcfs_device_userstate *ldu)
>  	LASSERT (ldu->ldu_memhog_pages == 0);
>  }
>  
> -int
> -kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
> +static int kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
>  		     gfp_t flags)
>  {
>  	struct page **level0p;


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

* Re: [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration
  2014-12-16 14:39 [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration Jia He
  2014-12-29  2:42 ` hejianet
@ 2015-01-14  3:49 ` hejianet
  2015-01-14  6:35 ` Jeremiah Mahler
  2 siblings, 0 replies; 9+ messages in thread
From: hejianet @ 2015-01-14  3:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman

Hi all
Ping again, any comments are welcome

Justin

On Tue, 16 Dec 2014 22:39:38 +0800 from hejianet@gmail.com wrote:
> make sparse happy since these two fuchtion are only used in module.c.
> tested by successful compilation.
>
> Signed-off-by: Jia He <hejianet@gmail.com>
> Cc: Oleg Drokin <oleg.drokin@intel.com>
> Cc: Andreas Dilger <andreas.dilger@intel.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/staging/lustre/lustre/libcfs/module.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
> index 2c4fc74..b9ee37c 100644
> --- a/drivers/staging/lustre/lustre/libcfs/module.c
> +++ b/drivers/staging/lustre/lustre/libcfs/module.c
> @@ -42,8 +42,7 @@
>  #include "../../include/linux/lnet/lnet.h"
>  #include "tracefile.h"
>  
> -void
> -kportal_memhog_free (struct libcfs_device_userstate *ldu)
> +static void kportal_memhog_free (struct libcfs_device_userstate *ldu)
>  {
>  	struct page **level0p = &ldu->ldu_memhog_root_page;
>  	struct page **level1p;
> @@ -86,8 +85,7 @@ kportal_memhog_free (struct libcfs_device_userstate *ldu)
>  	LASSERT (ldu->ldu_memhog_pages == 0);
>  }
>  
> -int
> -kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
> +static int kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
>  		     gfp_t flags)
>  {
>  	struct page **level0p;


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

* Re: [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration
  2014-12-16 14:39 [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration Jia He
  2014-12-29  2:42 ` hejianet
  2015-01-14  3:49 ` hejianet
@ 2015-01-14  6:35 ` Jeremiah Mahler
  2015-01-16  1:45   ` [PATCH 1/2] " Jia He
  2015-01-16  8:58   ` [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration Jia He
  2 siblings, 2 replies; 9+ messages in thread
From: Jeremiah Mahler @ 2015-01-14  6:35 UTC (permalink / raw)
  To: Jia He; +Cc: linux-kernel, Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman

Jia He,

On Tue, Dec 16, 2014 at 10:39:38PM +0800, Jia He wrote:
> make sparse happy since these two fuchtion are only used in module.c.
> tested by successful compilation.
> 
spelling: s/fuchtion/function/

Not sure if "make sparse happy" is the best way to describe what you are
doing.  You are fixing sparse warnings.

[...]
> -void
> -kportal_memhog_free (struct libcfs_device_userstate *ldu)
> +static void kportal_memhog_free (struct libcfs_device_userstate *ldu)

You might as well fix the checkpatch warning created by this line too.

[...]

These functions aren't used outside of this file so making them static
looks correct.

-- 
- Jeremiah Mahler

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

* [PATCH 1/2] staging: lustre: libcfs: fix sparse warnings about static declaration
  2015-01-14  6:35 ` Jeremiah Mahler
@ 2015-01-16  1:45   ` Jia He
  2015-01-16  1:45     ` [PATCH 2/2] staging: lustre: libcfs: fix space between function and open parenthesis Jia He
  2015-01-16  8:58   ` [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration Jia He
  1 sibling, 1 reply; 9+ messages in thread
From: Jia He @ 2015-01-16  1:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jia He, Jeremiah Mahler, Oleg Drokin, Andreas Dilger,
	Greg Kroah-Hartman

These functions aren't used outside of this file so making them static
to suppress the sparse warnings about static declaration.

Signed-off-by: Jia He <hejianet@gmail.com>
Cc: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/lustre/lustre/libcfs/module.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index 2c4fc74..b9ee37c 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -42,8 +42,7 @@
 #include "../../include/linux/lnet/lnet.h"
 #include "tracefile.h"
 
-void
-kportal_memhog_free (struct libcfs_device_userstate *ldu)
+static void kportal_memhog_free (struct libcfs_device_userstate *ldu)
 {
 	struct page **level0p = &ldu->ldu_memhog_root_page;
 	struct page **level1p;
@@ -86,8 +85,7 @@ kportal_memhog_free (struct libcfs_device_userstate *ldu)
 	LASSERT (ldu->ldu_memhog_pages == 0);
 }
 
-int
-kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
+static int kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
 		     gfp_t flags)
 {
 	struct page **level0p;
-- 
1.9.1


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

* [PATCH 2/2] staging: lustre: libcfs: fix space between function and open parenthesis
  2015-01-16  1:45   ` [PATCH 1/2] " Jia He
@ 2015-01-16  1:45     ` Jia He
  2015-01-16  6:21       ` Jeremiah Mahler
  0 siblings, 1 reply; 9+ messages in thread
From: Jia He @ 2015-01-16  1:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jia He, Jeremiah Mahler, Oleg Drokin, Andreas Dilger,
	Greg Kroah-Hartman

This fixes the space warning checked by check_patch.pl

Signed-off-by: Jia He <hejianet@gmail.com>
Cc: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/lustre/lustre/libcfs/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index b9ee37c..1af6a37 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -42,7 +42,7 @@
 #include "../../include/linux/lnet/lnet.h"
 #include "tracefile.h"
 
-static void kportal_memhog_free (struct libcfs_device_userstate *ldu)
+static void kportal_memhog_free(struct libcfs_device_userstate *ldu)
 {
 	struct page **level0p = &ldu->ldu_memhog_root_page;
 	struct page **level1p;
-- 
1.9.1


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

* Re: [PATCH 2/2] staging: lustre: libcfs: fix space between function and open parenthesis
  2015-01-16  1:45     ` [PATCH 2/2] staging: lustre: libcfs: fix space between function and open parenthesis Jia He
@ 2015-01-16  6:21       ` Jeremiah Mahler
  0 siblings, 0 replies; 9+ messages in thread
From: Jeremiah Mahler @ 2015-01-16  6:21 UTC (permalink / raw)
  To: Jia He; +Cc: linux-kernel, Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman

Jia He,

On Fri, Jan 16, 2015 at 09:45:47AM +0800, Jia He wrote:
> This fixes the space warning checked by check_patch.pl
                                              ^^^
                                          checkpatch.pl
> 
[...]
> -static void kportal_memhog_free (struct libcfs_device_userstate *ldu)
> +static void kportal_memhog_free(struct libcfs_device_userstate *ldu)
>  {
[...]

I would have included this change in with the previous patch since it is
that patch that has the checkpatch warning.

-- 
- Jeremiah Mahler

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

* [PATCH] staging: lustre: libcfs: fix sparse warnings about static  declaration
  2015-01-14  6:35 ` Jeremiah Mahler
  2015-01-16  1:45   ` [PATCH 1/2] " Jia He
@ 2015-01-16  8:58   ` Jia He
  2015-01-16 19:07     ` Jeremiah Mahler
  1 sibling, 1 reply; 9+ messages in thread
From: Jia He @ 2015-01-16  8:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jia He, Jeremiah Mahler, Oleg Drokin, Andreas Dilger,
	Greg Kroah-Hartman

  These functions kportal_memhog_{alloc,free} aren't used outside of 
this file, so making them static to suppress the sparse warnings about 
static declaration.
  Besides, this also fixes the space warning checked by checkpatch.pl

Signed-off-by: Jia He <hejianet@gmail.com>
Cc: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/lustre/lustre/libcfs/module.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index 2c4fc74..1af6a37 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -42,8 +42,7 @@
 #include "../../include/linux/lnet/lnet.h"
 #include "tracefile.h"
 
-void
-kportal_memhog_free (struct libcfs_device_userstate *ldu)
+static void kportal_memhog_free(struct libcfs_device_userstate *ldu)
 {
 	struct page **level0p = &ldu->ldu_memhog_root_page;
 	struct page **level1p;
@@ -86,8 +85,7 @@ kportal_memhog_free (struct libcfs_device_userstate *ldu)
 	LASSERT (ldu->ldu_memhog_pages == 0);
 }
 
-int
-kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
+static int kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
 		     gfp_t flags)
 {
 	struct page **level0p;
-- 
1.9.1


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

* Re: [PATCH] staging: lustre: libcfs: fix sparse warnings about static  declaration
  2015-01-16  8:58   ` [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration Jia He
@ 2015-01-16 19:07     ` Jeremiah Mahler
  0 siblings, 0 replies; 9+ messages in thread
From: Jeremiah Mahler @ 2015-01-16 19:07 UTC (permalink / raw)
  To: Jia He; +Cc: linux-kernel, Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman

Jia He,

Your patch is looking better :-)
A few nits though.

On Fri, Jan 16, 2015 at 04:58:12PM +0800, Jia He wrote:
>   These functions kportal_memhog_{alloc,free} aren't used outside of 
^^^^^ Don't indent paragraphs, just use a line between paragraphs.
> this file, so making them static to suppress the sparse warnings about 
> static declaration.

>   Besides, this also fixes the space warning checked by checkpatch.pl
"Besides" doesn't sound right here.  I would just say something like
"Also fix the space warning ..."

In your subject line it is helpful to add a version number so people
can tell that this is a new revision.  For example: [PATCH v2].
git format-patch can add this automatically with the '-v' option.

[...]

-- 
- Jeremiah Mahler

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

end of thread, other threads:[~2015-01-16 19:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16 14:39 [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration Jia He
2014-12-29  2:42 ` hejianet
2015-01-14  3:49 ` hejianet
2015-01-14  6:35 ` Jeremiah Mahler
2015-01-16  1:45   ` [PATCH 1/2] " Jia He
2015-01-16  1:45     ` [PATCH 2/2] staging: lustre: libcfs: fix space between function and open parenthesis Jia He
2015-01-16  6:21       ` Jeremiah Mahler
2015-01-16  8:58   ` [PATCH] staging: lustre: libcfs: fix sparse warnings about static declaration Jia He
2015-01-16 19:07     ` Jeremiah Mahler

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