aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2017-09-15 08:34:10 -0500
committerEric Sandeen <sandeen@redhat.com>2017-09-15 08:34:10 -0500
commit9587a34cd665dd65457d67698c85a3b20159e383 (patch)
tree3bc7e457b8348f1b1dcc42f544c5f86cea4d5437
parent5d52e7a5799c9843aef325e926a794638c48ad43 (diff)
downloadxfsprogs-dev-9587a34cd665dd65457d67698c85a3b20159e383.tar.gz
misc: fix more stupid compiler warnings
Fix more compiler warnings about pointless checks, unchecked return values, brace problems, and missing parentheses. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--db/check.c2
-rw-r--r--libxfs/libxfs_priv.h4
-rw-r--r--libxfs/xfs_bmap.c2
-rw-r--r--repair/phase6.c4
4 files changed, 3 insertions, 9 deletions
diff --git a/db/check.c b/db/check.c
index 81ba63a67e..f7d0ba7b58 100644
--- a/db/check.c
+++ b/db/check.c
@@ -3192,9 +3192,7 @@ process_leaf_node_dir_v2_free(
return;
}
if (be32_to_cpu(free->hdr.nvalid) > maxent ||
- be32_to_cpu(free->hdr.nvalid) < 0 ||
be32_to_cpu(free->hdr.nused) > maxent ||
- be32_to_cpu(free->hdr.nused) < 0 ||
be32_to_cpu(free->hdr.nused) >
be32_to_cpu(free->hdr.nvalid)) {
if (!sflag || v)
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index d525b667c5..c051eaaf2b 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -496,8 +496,8 @@ int libxfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t);
/* xfs_icache.c */
-#define xfs_inode_set_cowblocks_tag(ip)
-#define xfs_inode_set_eofblocks_tag(ip)
+#define xfs_inode_set_cowblocks_tag(ip) do { } while (0)
+#define xfs_inode_set_eofblocks_tag(ip) do { } while (0)
/* xfs_stats.h */
#define XFS_STATS_CALC_INDEX(member) 0
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index e26bd239c4..74fd7a0219 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -570,7 +570,7 @@ xfs_bmap_validate_ret(
#else
#define xfs_bmap_check_leaf_extents(cur, ip, whichfork) do { } while (0)
-#define xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap)
+#define xfs_bmap_validate_ret(bno,len,flags,mval,onmap,nmap) do { } while (0)
#endif /* DEBUG */
/*
diff --git a/repair/phase6.c b/repair/phase6.c
index 373b1a5b6a..19e29808f6 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -3025,8 +3025,6 @@ mark_standalone_inodes(xfs_mount_t *mp)
irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rbmino),
XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rbmino));
- ASSERT(irec != NULL);
-
offset = XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rbmino) -
irec->ino_startnum;
@@ -3038,8 +3036,6 @@ mark_standalone_inodes(xfs_mount_t *mp)
offset = XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rsumino) -
irec->ino_startnum;
- ASSERT(irec != NULL);
-
add_inode_reached(irec, offset);
if (fs_quotas) {