mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] xfs: fix sparse warnings
@ 2009-03-04 18:33 Hannes Eder
  2009-03-04 18:33 ` [PATCH 1/3] xfs: move declaration to header file Hannes Eder
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Hannes Eder @ 2009-03-04 18:33 UTC (permalink / raw)
  To: Felix Blyakher; +Cc: kernel-janitors, linux-kernel, Christoph Hellwig

The following series fixes a fair amount of the remaining sparse
warnings in fs/xfs with !CONFIG_XFS_DEBUG.

With CONFIG_XFS_DEBUG we still got alot of "Should it be static?"
warnings, but that's a different issue.

---
Hannes Eder (3):
      xfs: include header files for prototypes
      xfs: make symbols static
      xfs: move declaration to header file

 fs/xfs/linux-2.6/xfs_ioctl.c |    1 +
 fs/xfs/linux-2.6/xfs_super.c |    6 +++---
 fs/xfs/support/debug.c       |    1 +
 fs/xfs/xfs_bmap.c            |    2 +-
 fs/xfs/xfs_da_btree.h        |    1 +
 fs/xfs/xfs_dir2.c            |    2 --
 fs/xfs/xfs_dir2_leaf.c       |    2 +-
 7 files changed, 8 insertions(+), 7 deletions(-)

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

* [PATCH 1/3] xfs: move declaration to header file
  2009-03-04 18:33 [PATCH 0/3] xfs: fix sparse warnings Hannes Eder
@ 2009-03-04 18:33 ` Hannes Eder
  2009-03-05 13:37   ` Christoph Hellwig
  2009-03-04 18:34 ` [PATCH 2/3] xfs: make symbols static Hannes Eder
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Hannes Eder @ 2009-03-04 18:33 UTC (permalink / raw)
  To: Felix Blyakher; +Cc: kernel-janitors, linux-kernel, Christoph Hellwig

Fix this sparse warning:
  fs/xfs/xfs_da_btree.c:1550:26: warning: symbol 'xfs_default_nameops' was not declared. Should it be static?

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
 fs/xfs/xfs_da_btree.h |    1 +
 fs/xfs/xfs_dir2.c     |    2 --
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h
index 9d5a7e8..41f27b3 100644
--- a/fs/xfs/xfs_da_btree.h
+++ b/fs/xfs/xfs_da_btree.h
@@ -268,5 +268,6 @@ xfs_daddr_t xfs_da_blkno(xfs_dabuf_t *dabuf);
 
 extern struct kmem_zone *xfs_da_state_zone;
 extern struct kmem_zone *xfs_dabuf_zone;
+extern const struct xfs_nameops xfs_default_nameops;
 
 #endif	/* __XFS_DA_BTREE_H__ */
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index 1afb122..c657bec 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -46,8 +46,6 @@
 
 struct xfs_name xfs_name_dotdot = {"..", 2};
 
-extern const struct xfs_nameops xfs_default_nameops;
-
 /*
  * ASCII case-insensitive (ie. A-Z) support for directories that was
  * used in IRIX.


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

* [PATCH 2/3] xfs: make symbols static
  2009-03-04 18:33 [PATCH 0/3] xfs: fix sparse warnings Hannes Eder
  2009-03-04 18:33 ` [PATCH 1/3] xfs: move declaration to header file Hannes Eder
@ 2009-03-04 18:34 ` Hannes Eder
  2009-03-05 13:38   ` Christoph Hellwig
  2009-03-04 18:34 ` [PATCH 3/3] xfs: include header files for prototypes Hannes Eder
  2009-03-05 17:43 ` [PATCH 0/3] xfs: fix sparse warnings Felix Blyakher
  3 siblings, 1 reply; 10+ messages in thread
From: Hannes Eder @ 2009-03-04 18:34 UTC (permalink / raw)
  To: Felix Blyakher; +Cc: kernel-janitors, linux-kernel, Christoph Hellwig

Instead of the keyword 'static' the macro 'STATIC' is used, so the
symbols are still global with CONFIG_XFS_DEBUG.

Fix this sparse warnings:
  fs/xfs/linux-2.6/xfs_super.c:638:1: warning: symbol 'xfs_blkdev_get' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_super.c:655:1: warning: symbol 'xfs_blkdev_put' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_super.c:876:1: warning: symbol 'xfsaild' was not declared. Should it be static?
  fs/xfs/xfs_bmap.c:6208:1: warning: symbol 'xfs_check_block' was not declared. Should it be static?
  fs/xfs/xfs_dir2_leaf.c:553:1: warning: symbol 'xfs_dir2_leaf_check' was not declared. Should it be static?

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
 fs/xfs/linux-2.6/xfs_super.c |    6 +++---
 fs/xfs/xfs_bmap.c            |    2 +-
 fs/xfs/xfs_dir2_leaf.c       |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index bc1e647..9633c3c 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -633,7 +633,7 @@ xfs_max_file_offset(
 	return (((__uint64_t)pagefactor) << bitshift) - 1;
 }
 
-int
+STATIC int
 xfs_blkdev_get(
 	xfs_mount_t		*mp,
 	const char		*name,
@@ -650,7 +650,7 @@ xfs_blkdev_get(
 	return -error;
 }
 
-void
+STATIC void
 xfs_blkdev_put(
 	struct block_device	*bdev)
 {
@@ -871,7 +871,7 @@ xfsaild_wakeup(
 	wake_up_process(ailp->xa_task);
 }
 
-int
+STATIC int
 xfsaild(
 	void	*data)
 {
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index c852cd6..27062d0 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -6204,7 +6204,7 @@ xfs_bmap_get_bp(
 	return(bp);
 }
 
-void
+STATIC void
 xfs_check_block(
 	struct xfs_btree_block	*block,
 	xfs_mount_t		*mp,
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index ef805a3..6427ff1 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -549,7 +549,7 @@ xfs_dir2_leaf_addname(
  * Check the internal consistency of a leaf1 block.
  * Pop an assert if something is wrong.
  */
-void
+STATIC void
 xfs_dir2_leaf_check(
 	xfs_inode_t		*dp,		/* incore directory inode */
 	xfs_dabuf_t		*bp)		/* leaf's buffer */


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

* [PATCH 3/3] xfs: include header files for prototypes
  2009-03-04 18:33 [PATCH 0/3] xfs: fix sparse warnings Hannes Eder
  2009-03-04 18:33 ` [PATCH 1/3] xfs: move declaration to header file Hannes Eder
  2009-03-04 18:34 ` [PATCH 2/3] xfs: make symbols static Hannes Eder
@ 2009-03-04 18:34 ` Hannes Eder
  2009-03-05 13:39   ` Christoph Hellwig
  2009-03-05 17:43 ` [PATCH 0/3] xfs: fix sparse warnings Felix Blyakher
  3 siblings, 1 reply; 10+ messages in thread
From: Hannes Eder @ 2009-03-04 18:34 UTC (permalink / raw)
  To: Felix Blyakher; +Cc: kernel-janitors, linux-kernel, Christoph Hellwig

Fix this sparse warnings:
  fs/xfs/linux-2.6/xfs_ioctl.c:72:1: warning: symbol 'xfs_find_handle' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:249:1: warning: symbol 'xfs_open_by_handle' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:361:1: warning: symbol 'xfs_readlink_by_handle' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:496:1: warning: symbol 'xfs_attrmulti_attr_get' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:525:1: warning: symbol 'xfs_attrmulti_attr_set' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:555:1: warning: symbol 'xfs_attrmulti_attr_remove' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:657:1: warning: symbol 'xfs_ioc_space' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:1340:1: warning: symbol 'xfs_file_ioctl' was not declared. Should it be static?
  fs/xfs/support/debug.c:65:1: warning: symbol 'xfs_fs_vcmn_err' was not declared. Should it be static?
  fs/xfs/support/debug.c:112:1: warning: symbol 'xfs_hex_dump' was not declared. Should it be static?

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
 fs/xfs/linux-2.6/xfs_ioctl.c |    1 +
 fs/xfs/support/debug.c       |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 6f04493..d0b4994 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -34,6 +34,7 @@
 #include "xfs_dir2_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_ioctl.h"
 #include "xfs_btree.h"
 #include "xfs_ialloc.h"
 #include "xfs_rtalloc.h"
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c
index ae54829..f49cbc1 100644
--- a/fs/xfs/support/debug.c
+++ b/fs/xfs/support/debug.c
@@ -19,6 +19,7 @@
 #include "debug.h"
 
 /* xfs_mount.h drags a lot of crap in, sorry.. */
+#include "xfs_error.h"
 #include "xfs_sb.h"
 #include "xfs_inum.h"
 #include "xfs_ag.h"


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

* Re: [PATCH 1/3] xfs: move declaration to header file
  2009-03-04 18:33 ` [PATCH 1/3] xfs: move declaration to header file Hannes Eder
@ 2009-03-05 13:37   ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2009-03-05 13:37 UTC (permalink / raw)
  To: Hannes Eder
  Cc: Felix Blyakher, kernel-janitors, linux-kernel, Christoph Hellwig

On Wed, Mar 04, 2009 at 07:33:48PM +0100, Hannes Eder wrote:
> Fix this sparse warning:
>   fs/xfs/xfs_da_btree.c:1550:26: warning: symbol 'xfs_default_nameops' was not declared. Should it be static?
> 
> Signed-off-by: Hannes Eder <hannes@hanneseder.net>

Looks good to me.

And for future patches please always send them to the mailinglist
(xfs@oss.sgi.com)


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

* Re: [PATCH 2/3] xfs: make symbols static
  2009-03-04 18:34 ` [PATCH 2/3] xfs: make symbols static Hannes Eder
@ 2009-03-05 13:38   ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2009-03-05 13:38 UTC (permalink / raw)
  To: Hannes Eder
  Cc: Felix Blyakher, kernel-janitors, linux-kernel, Christoph Hellwig

On Wed, Mar 04, 2009 at 07:34:10PM +0100, Hannes Eder wrote:
> Instead of the keyword 'static' the macro 'STATIC' is used, so the
> symbols are still global with CONFIG_XFS_DEBUG.

Looks good.


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

* Re: [PATCH 3/3] xfs: include header files for prototypes
  2009-03-04 18:34 ` [PATCH 3/3] xfs: include header files for prototypes Hannes Eder
@ 2009-03-05 13:39   ` Christoph Hellwig
  2009-03-05 14:20     ` [PATCH 3/3 v2] " Hannes Eder
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2009-03-05 13:39 UTC (permalink / raw)
  To: Hannes Eder
  Cc: Felix Blyakher, kernel-janitors, linux-kernel, Christoph Hellwig

looks good, except for a tiny nit-pick:

> +++ b/fs/xfs/support/debug.c
> @@ -19,6 +19,7 @@
>  #include "debug.h"
>  
>  /* xfs_mount.h drags a lot of crap in, sorry.. */
> +#include "xfs_error.h"
>  #include "xfs_sb.h"
>  #include "xfs_inum.h"
>  #include "xfs_ag.h"

as xfs_mount.h doesn't require xfs_error.h it should be included 
above that comment.

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

* [PATCH 3/3 v2] xfs: include header files for prototypes
  2009-03-05 13:39   ` Christoph Hellwig
@ 2009-03-05 14:20     ` Hannes Eder
  2009-03-05 21:29       ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Hannes Eder @ 2009-03-05 14:20 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Felix Blyakher, kernel-janitors, linux-kernel, xfs

Fix this sparse warnings:
  fs/xfs/linux-2.6/xfs_ioctl.c:72:1: warning: symbol 'xfs_find_handle' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:249:1: warning: symbol 'xfs_open_by_handle' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:361:1: warning: symbol 'xfs_readlink_by_handle' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:496:1: warning: symbol 'xfs_attrmulti_attr_get' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:525:1: warning: symbol 'xfs_attrmulti_attr_set' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:555:1: warning: symbol 'xfs_attrmulti_attr_remove' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:657:1: warning: symbol 'xfs_ioc_space' was not declared. Should it be static?
  fs/xfs/linux-2.6/xfs_ioctl.c:1340:1: warning: symbol 'xfs_file_ioctl' was not declared. Should it be static?
  fs/xfs/support/debug.c:65:1: warning: symbol 'xfs_fs_vcmn_err' was not declared. Should it be static?
  fs/xfs/support/debug.c:112:1: warning: symbol 'xfs_hex_dump' was not declared. Should it be static?

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Acked-by: Christoph Hellwig <hch@lst.de>
---

On Thu, Mar 5, 2009 at 2:39 PM, Christoph Hellwig <hch@lst.de> wrote:
> looks good, except for a tiny nit-pick:

I still treat this as a Acked-by: ... Ok?

>> +++ b/fs/xfs/support/debug.c
>> @@ -19,6 +19,7 @@
>>  #include "debug.h"
>>
>>  /* xfs_mount.h drags a lot of crap in, sorry.. */
>> +#include "xfs_error.h"
>>  #include "xfs_sb.h"
>>  #include "xfs_inum.h"
>>  #include "xfs_ag.h"
>
> as xfs_mount.h doesn't require xfs_error.h it should be included
> above that comment.

hm. but that way it is still included before xfs_mount.h.


 fs/xfs/linux-2.6/xfs_ioctl.c |    1 +
 fs/xfs/support/debug.c       |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 6f04493..d0b4994 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -34,6 +34,7 @@
 #include "xfs_dir2_sf.h"
 #include "xfs_dinode.h"
 #include "xfs_inode.h"
+#include "xfs_ioctl.h"
 #include "xfs_btree.h"
 #include "xfs_ialloc.h"
 #include "xfs_rtalloc.h"
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c
index ae54829..930bb34 100644
--- a/fs/xfs/support/debug.c
+++ b/fs/xfs/support/debug.c
@@ -17,6 +17,7 @@
  */
 #include <xfs.h>
 #include "debug.h"
+#include "xfs_error.h"
 
 /* xfs_mount.h drags a lot of crap in, sorry.. */
 #include "xfs_sb.h"


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

* Re: [PATCH 0/3] xfs: fix sparse warnings
  2009-03-04 18:33 [PATCH 0/3] xfs: fix sparse warnings Hannes Eder
                   ` (2 preceding siblings ...)
  2009-03-04 18:34 ` [PATCH 3/3] xfs: include header files for prototypes Hannes Eder
@ 2009-03-05 17:43 ` Felix Blyakher
  3 siblings, 0 replies; 10+ messages in thread
From: Felix Blyakher @ 2009-03-05 17:43 UTC (permalink / raw)
  To: Hannes Eder; +Cc: kernel-janitors, linux-kernel, Christoph Hellwig


On Mar 4, 2009, at 12:33 PM, Hannes Eder wrote:

> The following series fixes a fair amount of the remaining sparse
> warnings in fs/xfs with !CONFIG_XFS_DEBUG.
>
> With CONFIG_XFS_DEBUG we still got alot of "Should it be static?"
> warnings, but that's a different issue.

Looks good to me with the changes Christoph pointed out.
I'll push it in. Thanks.

Reviewed-by: Felix Blyakher <felixb@sgi.com>

>
>
> ---
> Hannes Eder (3):
>      xfs: include header files for prototypes
>      xfs: make symbols static
>      xfs: move declaration to header file
>
> fs/xfs/linux-2.6/xfs_ioctl.c |    1 +
> fs/xfs/linux-2.6/xfs_super.c |    6 +++---
> fs/xfs/support/debug.c       |    1 +
> fs/xfs/xfs_bmap.c            |    2 +-
> fs/xfs/xfs_da_btree.h        |    1 +
> fs/xfs/xfs_dir2.c            |    2 --
> fs/xfs/xfs_dir2_leaf.c       |    2 +-
> 7 files changed, 8 insertions(+), 7 deletions(-)


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

* Re: [PATCH 3/3 v2] xfs: include header files for prototypes
  2009-03-05 14:20     ` [PATCH 3/3 v2] " Hannes Eder
@ 2009-03-05 21:29       ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2009-03-05 21:29 UTC (permalink / raw)
  To: Hannes Eder
  Cc: Christoph Hellwig, Felix Blyakher, kernel-janitors, linux-kernel, xfs

On Thu, Mar 05, 2009 at 03:20:25PM +0100, Hannes Eder wrote:
> I still treat this as a Acked-by: ... Ok?

Should be a review, as far as you can review these sort of patches..

> hm. but that way it is still included before xfs_mount.h.

Sure, but the point is entirely the comment which describes the block
of includes below.

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

end of thread, other threads:[~2009-03-05 21:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-04 18:33 [PATCH 0/3] xfs: fix sparse warnings Hannes Eder
2009-03-04 18:33 ` [PATCH 1/3] xfs: move declaration to header file Hannes Eder
2009-03-05 13:37   ` Christoph Hellwig
2009-03-04 18:34 ` [PATCH 2/3] xfs: make symbols static Hannes Eder
2009-03-05 13:38   ` Christoph Hellwig
2009-03-04 18:34 ` [PATCH 3/3] xfs: include header files for prototypes Hannes Eder
2009-03-05 13:39   ` Christoph Hellwig
2009-03-05 14:20     ` [PATCH 3/3 v2] " Hannes Eder
2009-03-05 21:29       ` Christoph Hellwig
2009-03-05 17:43 ` [PATCH 0/3] xfs: fix sparse warnings Felix Blyakher

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

Powered by JetHome