Skip to contentSkip to conversation

xfs: fix sparse warnings

PATCH In review Hannes Eder 4 participants 10 messages Mar 4, 2009 – Mar 5, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover xfs: fix sparse warnings

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(-)
#1 lore raw

PATCH 1/3 xfs: move declaration to header file

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

---
 fs/xfs/xfs_da_btree.h |    1 +
 fs/xfs/xfs_dir2.c     |    2 --
 2 files changed, 1 insertions(+), 2 deletions(-)
fs/xfs/xfs_da_btree.h +1 -0
index 9d5a7e8..41f27b3 100644
@@ -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__ */
fs/xfs/xfs_dir2.c +0 -2
index 1afb122..c657bec 100644
@@ -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.
#2 lore raw

Re: [PATCH 1/3] xfs: move declaration to header file

Quoted 4 lines · Hannes Eder

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

Looks good to me.

And for future patches please always send them to the mailinglist ([email protected])

#3 lore raw

PATCH 2/3 xfs: make symbols static

In reply to Hannes Eder

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?

---
 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(-)
fs/xfs/linux-2.6/xfs_super.c +3 -3
index bc1e647..9633c3c 100644
@@ -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)
 {
fs/xfs/xfs_bmap.c +1 -1
index c852cd6..27062d0 100644
@@ -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,
fs/xfs/xfs_dir2_leaf.c +1 -1
index ef805a3..6427ff1 100644
@@ -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 */
#4 lore raw

Re: [PATCH 2/3] xfs: make symbols static

Quoted 2 lines · Hannes Eder

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

Looks good.

#5 lore raw

PATCH 3/3 xfs: include header files for prototypes

In reply to Hannes Eder

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?

---
 fs/xfs/linux-2.6/xfs_ioctl.c |    1 +
 fs/xfs/support/debug.c       |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
fs/xfs/linux-2.6/xfs_ioctl.c +1 -0
index 6f04493..d0b4994 100644
@@ -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"
fs/xfs/support/debug.c +1 -0
index ae54829..f49cbc1 100644
@@ -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"
#6 lore raw

Re: [PATCH 3/3] xfs: include header files for prototypes

looks good, except for a tiny nit-pick:

fs/xfs/support/debug.c line 25

Quoted 9 lines

+++ b/fs/xfs/support/debug.c

fs/xfs/support/debug.c +1 -0
@@ -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.

#7 lore raw

PATCH v2 3/3 xfs: include header files for prototypes

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?

---

Quoted 1 line · Christoph Hellwig

looks good, except for a tiny nit-pick:

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

Quoted 4 lines
Quoted 4 lines

+++ b/fs/xfs/support/debug.c

(quoted diff) +0 -0
@@ -19,6 +19,7 @@
 #include "debug.h"
 
Quoted 8 lines

Review line 25

Quoted 5 lines
(quoted diff) +1 -0
 /* 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(-)
fs/xfs/linux-2.6/xfs_ioctl.c +1 -0
index 6f04493..d0b4994 100644
@@ -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"
fs/xfs/support/debug.c +1 -0
index ae54829..930bb34 100644
@@ -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"
#8 lore raw

Re: [PATCH 3/3 v2] xfs: include header files for prototypes

Quoted 1 line · Hannes Eder

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

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

Quoted 1 line

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.

Reviewed-by on the v1 series
#9 lore raw
In reply to Hannes Eder
Quoted 5 lines · Hannes Eder

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.

Quoted 16 lines

---
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(-)