]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
misc: fix more stupid compiler warnings
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 15 Sep 2017 13:34:10 +0000 (08:34 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 15 Sep 2017 13:34:10 +0000 (08:34 -0500)
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>
db/check.c
libxfs/libxfs_priv.h
libxfs/xfs_bmap.c
repair/phase6.c

index 81ba63a67eb2adcc6b4010294bc2bc233f6ca323..f7d0ba7b5851eb34ed773dbc271c57c51bd0073b 100644 (file)
@@ -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)
index d525b667c5ed840b0d592288efb41454ad800ea9..c051eaaf2bd5d2765ed8e7836162cf059f298297 100644 (file)
@@ -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
index e26bd239c40781da9db913099be6703763d46d34..74fd7a0219f30715b2ea95b1a1a6569903bbdea2 100644 (file)
@@ -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 */
 
 /*
index 373b1a5b6a46603b1d62fd1cec49927e9a071c25..19e29808f67fdd4d202e9373122ce76ca583c9b8 100644 (file)
@@ -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)  {