* [PATCH 0/3] xfsprogs: trivial sparse tidyups
@ 2019-12-18 22:53 Eric Sandeen
2019-12-18 22:54 ` [PATCH 1/3] xfsprogs: include headers to fix sparse warnings about statics Eric Sandeen
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Eric Sandeen @ 2019-12-18 22:53 UTC (permalink / raw)
To: linux-xfs
None of these fix bugs, just keep sparse happier so more important
warnings won't get swamped out.
-Eric
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] xfsprogs: include headers to fix sparse warnings about statics
2019-12-18 22:53 [PATCH 0/3] xfsprogs: trivial sparse tidyups Eric Sandeen
@ 2019-12-18 22:54 ` Eric Sandeen
2019-12-18 23:10 ` Darrick J. Wong
2019-12-18 22:55 ` [PATCH 2/3] xfsprogs: make a couple of structures static Eric Sandeen
2019-12-18 22:56 ` [PATCH 3/3] fsr: remove shadow variable in fsr_setup_attr_fork Eric Sandeen
2 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2019-12-18 22:54 UTC (permalink / raw)
To: linux-xfs
From: Eric Sandeen <sandeen@redhat.com>
Addresses many "foo was not declared. Should it be static?"
warnings from sparse.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/libfrog/linux.c b/libfrog/linux.c
index 79bd79eb..d7264108 100644
--- a/libfrog/linux.c
+++ b/libfrog/linux.c
@@ -9,6 +9,7 @@
#include <sys/ioctl.h>
#include <sys/sysinfo.h>
+#include "libfrog/platform.h"
#include "libxfs_priv.h"
#include "xfs_fs.h"
#include "init.h"
diff --git a/libxfs/util.c b/libxfs/util.c
index 885dd42b..cd303341 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -28,6 +28,7 @@
#include "xfs_da_format.h"
#include "xfs_da_btree.h"
#include "xfs_dir2_priv.h"
+#include "xfs_health.h"
/*
* Calculate the worst case log unit reservation for a given superblock
diff --git a/libxfs/xfs_ag_resv.c b/libxfs/xfs_ag_resv.c
index 1328e5de..1fe13bf4 100644
--- a/libxfs/xfs_ag_resv.c
+++ b/libxfs/xfs_ag_resv.c
@@ -15,6 +15,8 @@
#include "xfs_btree.h"
#include "xfs_refcount_btree.h"
#include "xfs_ialloc_btree.h"
+#include "xfs_sb.h"
+#include "xfs_ag_resv.h"
/*
* Per-AG Block Reservations
diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c
index 7234f86c..1ce6359a 100644
--- a/libxfs/xfs_attr_remote.c
+++ b/libxfs/xfs_attr_remote.c
@@ -18,6 +18,7 @@
#include "xfs_inode.h"
#include "xfs_trans.h"
#include "xfs_bmap.h"
+#include "xfs_attr_remote.h"
#include "xfs_trace.h"
#define ATTR_RMTVALUE_MAPSIZE 1 /* # of map entries at once */
diff --git a/libxfs/xfs_bit.c b/libxfs/xfs_bit.c
index 6a76a5ad..3f97fa3e 100644
--- a/libxfs/xfs_bit.c
+++ b/libxfs/xfs_bit.c
@@ -5,6 +5,7 @@
*/
#include "libxfs_priv.h"
#include "xfs_log_format.h"
+#include "xfs_bit.h"
/*
* XFS bit manipulation routines, used in non-realtime code.
diff --git a/libxfs/xfs_dir2_data.c b/libxfs/xfs_dir2_data.c
index 68da426e..044f1272 100644
--- a/libxfs/xfs_dir2_data.c
+++ b/libxfs/xfs_dir2_data.c
@@ -13,6 +13,7 @@
#include "xfs_mount.h"
#include "xfs_inode.h"
#include "xfs_dir2.h"
+#include "xfs_dir2_priv.h"
#include "xfs_trans.h"
static xfs_failaddr_t xfs_dir2_data_freefind_verify(
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
index 583d29aa..4f750d19 100644
--- a/libxfs/xfs_sb.c
+++ b/libxfs/xfs_sb.c
@@ -10,6 +10,7 @@
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_bit.h"
+#include "xfs_sb.h"
#include "xfs_mount.h"
#include "xfs_ialloc.h"
#include "xfs_alloc.h"
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] xfsprogs: make a couple of structures static
2019-12-18 22:53 [PATCH 0/3] xfsprogs: trivial sparse tidyups Eric Sandeen
2019-12-18 22:54 ` [PATCH 1/3] xfsprogs: include headers to fix sparse warnings about statics Eric Sandeen
@ 2019-12-18 22:55 ` Eric Sandeen
2019-12-18 23:09 ` Darrick J. Wong
2019-12-18 22:56 ` [PATCH 3/3] fsr: remove shadow variable in fsr_setup_attr_fork Eric Sandeen
2 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2019-12-18 22:55 UTC (permalink / raw)
To: linux-xfs
From: Eric Sandeen <sandeen@redhat.com>
Eliminates 2 sparse warnings.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/db/btheight.c b/db/btheight.c
index 8aa17c89..fdb19a6d 100644
--- a/db/btheight.c
+++ b/db/btheight.c
@@ -22,7 +22,7 @@ static int rmap_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
return libxfs_rmapbt_maxrecs(blocklen, leaf);
}
-struct btmap {
+static struct btmap {
const char *tag;
int (*maxrecs)(struct xfs_mount *mp, int blocklen,
int leaf);
diff --git a/io/bulkstat.c b/io/bulkstat.c
index 201470b2..05a3d6d6 100644
--- a/io/bulkstat.c
+++ b/io/bulkstat.c
@@ -230,7 +230,7 @@ struct single_map {
uint64_t code;
};
-struct single_map tags[] = {
+static struct single_map tags[] = {
{"root", XFS_BULK_IREQ_SPECIAL_ROOT},
{NULL, 0},
};
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] fsr: remove shadow variable in fsr_setup_attr_fork
2019-12-18 22:53 [PATCH 0/3] xfsprogs: trivial sparse tidyups Eric Sandeen
2019-12-18 22:54 ` [PATCH 1/3] xfsprogs: include headers to fix sparse warnings about statics Eric Sandeen
2019-12-18 22:55 ` [PATCH 2/3] xfsprogs: make a couple of structures static Eric Sandeen
@ 2019-12-18 22:56 ` Eric Sandeen
2019-12-18 23:08 ` Darrick J. Wong
2 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2019-12-18 22:56 UTC (permalink / raw)
To: linux-xfs
From: Eric Sandeen <sandeen@redhat.com>
There's no need for the extra inner-scope ret variable in this
function, so remove it. The shadow was harmless though.
Fixes: f31b5e12 ("libfrog: refactor open-coded bulkstat calls")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 77a10a1d..32282126 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -988,7 +988,6 @@ fsr_setup_attr_fork(
do {
struct xfs_bulkstat tbstat;
char name[64];
- int ret;
/*
* bulkstat the temp inode to see what the forkoff is. Use
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] fsr: remove shadow variable in fsr_setup_attr_fork
2019-12-18 22:56 ` [PATCH 3/3] fsr: remove shadow variable in fsr_setup_attr_fork Eric Sandeen
@ 2019-12-18 23:08 ` Darrick J. Wong
0 siblings, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2019-12-18 23:08 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
On Wed, Dec 18, 2019 at 04:56:20PM -0600, Eric Sandeen wrote:
> From: Eric Sandeen <sandeen@redhat.com>
>
> There's no need for the extra inner-scope ret variable in this
> function, so remove it. The shadow was harmless though.
>
> Fixes: f31b5e12 ("libfrog: refactor open-coded bulkstat calls")
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
>
> diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
> index 77a10a1d..32282126 100644
> --- a/fsr/xfs_fsr.c
> +++ b/fsr/xfs_fsr.c
> @@ -988,7 +988,6 @@ fsr_setup_attr_fork(
> do {
> struct xfs_bulkstat tbstat;
> char name[64];
> - int ret;
>
> /*
> * bulkstat the temp inode to see what the forkoff is. Use
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] xfsprogs: make a couple of structures static
2019-12-18 22:55 ` [PATCH 2/3] xfsprogs: make a couple of structures static Eric Sandeen
@ 2019-12-18 23:09 ` Darrick J. Wong
0 siblings, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2019-12-18 23:09 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
On Wed, Dec 18, 2019 at 04:55:38PM -0600, Eric Sandeen wrote:
> From: Eric Sandeen <sandeen@redhat.com>
>
> Eliminates 2 sparse warnings.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> diff --git a/db/btheight.c b/db/btheight.c
> index 8aa17c89..fdb19a6d 100644
> --- a/db/btheight.c
> +++ b/db/btheight.c
> @@ -22,7 +22,7 @@ static int rmap_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
> return libxfs_rmapbt_maxrecs(blocklen, leaf);
> }
>
> -struct btmap {
> +static struct btmap {
Maybe these both should be static const?
--D
> const char *tag;
> int (*maxrecs)(struct xfs_mount *mp, int blocklen,
> int leaf);
> diff --git a/io/bulkstat.c b/io/bulkstat.c
> index 201470b2..05a3d6d6 100644
> --- a/io/bulkstat.c
> +++ b/io/bulkstat.c
> @@ -230,7 +230,7 @@ struct single_map {
> uint64_t code;
> };
>
> -struct single_map tags[] = {
> +static struct single_map tags[] = {
> {"root", XFS_BULK_IREQ_SPECIAL_ROOT},
> {NULL, 0},
> };
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] xfsprogs: include headers to fix sparse warnings about statics
2019-12-18 22:54 ` [PATCH 1/3] xfsprogs: include headers to fix sparse warnings about statics Eric Sandeen
@ 2019-12-18 23:10 ` Darrick J. Wong
0 siblings, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2019-12-18 23:10 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
On Wed, Dec 18, 2019 at 04:54:46PM -0600, Eric Sandeen wrote:
> From: Eric Sandeen <sandeen@redhat.com>
>
> Addresses many "foo was not declared. Should it be static?"
> warnings from sparse.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> diff --git a/libfrog/linux.c b/libfrog/linux.c
> index 79bd79eb..d7264108 100644
> --- a/libfrog/linux.c
> +++ b/libfrog/linux.c
> @@ -9,6 +9,7 @@
> #include <sys/ioctl.h>
> #include <sys/sysinfo.h>
>
> +#include "libfrog/platform.h"
> #include "libxfs_priv.h"
libfrog code shouldn't depend on anything in libxfs/ but I'll send my
own patch to fix that.
Looks ok otherwise
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> #include "xfs_fs.h"
> #include "init.h"
> diff --git a/libxfs/util.c b/libxfs/util.c
> index 885dd42b..cd303341 100644
> --- a/libxfs/util.c
> +++ b/libxfs/util.c
> @@ -28,6 +28,7 @@
> #include "xfs_da_format.h"
> #include "xfs_da_btree.h"
> #include "xfs_dir2_priv.h"
> +#include "xfs_health.h"
>
> /*
> * Calculate the worst case log unit reservation for a given superblock
> diff --git a/libxfs/xfs_ag_resv.c b/libxfs/xfs_ag_resv.c
> index 1328e5de..1fe13bf4 100644
> --- a/libxfs/xfs_ag_resv.c
> +++ b/libxfs/xfs_ag_resv.c
> @@ -15,6 +15,8 @@
> #include "xfs_btree.h"
> #include "xfs_refcount_btree.h"
> #include "xfs_ialloc_btree.h"
> +#include "xfs_sb.h"
> +#include "xfs_ag_resv.h"
>
> /*
> * Per-AG Block Reservations
> diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c
> index 7234f86c..1ce6359a 100644
> --- a/libxfs/xfs_attr_remote.c
> +++ b/libxfs/xfs_attr_remote.c
> @@ -18,6 +18,7 @@
> #include "xfs_inode.h"
> #include "xfs_trans.h"
> #include "xfs_bmap.h"
> +#include "xfs_attr_remote.h"
> #include "xfs_trace.h"
>
> #define ATTR_RMTVALUE_MAPSIZE 1 /* # of map entries at once */
> diff --git a/libxfs/xfs_bit.c b/libxfs/xfs_bit.c
> index 6a76a5ad..3f97fa3e 100644
> --- a/libxfs/xfs_bit.c
> +++ b/libxfs/xfs_bit.c
> @@ -5,6 +5,7 @@
> */
> #include "libxfs_priv.h"
> #include "xfs_log_format.h"
> +#include "xfs_bit.h"
>
> /*
> * XFS bit manipulation routines, used in non-realtime code.
> diff --git a/libxfs/xfs_dir2_data.c b/libxfs/xfs_dir2_data.c
> index 68da426e..044f1272 100644
> --- a/libxfs/xfs_dir2_data.c
> +++ b/libxfs/xfs_dir2_data.c
> @@ -13,6 +13,7 @@
> #include "xfs_mount.h"
> #include "xfs_inode.h"
> #include "xfs_dir2.h"
> +#include "xfs_dir2_priv.h"
> #include "xfs_trans.h"
>
> static xfs_failaddr_t xfs_dir2_data_freefind_verify(
> diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
> index 583d29aa..4f750d19 100644
> --- a/libxfs/xfs_sb.c
> +++ b/libxfs/xfs_sb.c
> @@ -10,6 +10,7 @@
> #include "xfs_log_format.h"
> #include "xfs_trans_resv.h"
> #include "xfs_bit.h"
> +#include "xfs_sb.h"
> #include "xfs_mount.h"
> #include "xfs_ialloc.h"
> #include "xfs_alloc.h"
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-12-18 23:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 22:53 [PATCH 0/3] xfsprogs: trivial sparse tidyups Eric Sandeen
2019-12-18 22:54 ` [PATCH 1/3] xfsprogs: include headers to fix sparse warnings about statics Eric Sandeen
2019-12-18 23:10 ` Darrick J. Wong
2019-12-18 22:55 ` [PATCH 2/3] xfsprogs: make a couple of structures static Eric Sandeen
2019-12-18 23:09 ` Darrick J. Wong
2019-12-18 22:56 ` [PATCH 3/3] fsr: remove shadow variable in fsr_setup_attr_fork Eric Sandeen
2019-12-18 23:08 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).