From patchwork Mon Sep 4 01:17:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 9936669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A717860237 for ; Mon, 4 Sep 2017 01:19:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97C22286BF for ; Mon, 4 Sep 2017 01:19:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C6B0286C0; Mon, 4 Sep 2017 01:19:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 382B9286C7 for ; Mon, 4 Sep 2017 01:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753193AbdIDBSH (ORCPT ); Sun, 3 Sep 2017 21:18:07 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:39844 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120AbdIDBSG (ORCPT ); Sun, 3 Sep 2017 21:18:06 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v841I21Q012347 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Sep 2017 01:18:02 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v841I1Bw028084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Sep 2017 01:18:02 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v841I0Bc031844; Mon, 4 Sep 2017 01:18:01 GMT Received: from localhost (/73.25.142.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 03 Sep 2017 18:17:59 -0700 Date: Sun, 3 Sep 2017 18:17:57 -0700 From: "Darrick J. Wong" To: Eric Sandeen Cc: xfs Subject: [PATCH 1/2] misc: fix more stupid compiler warnings Message-ID: <20170904011757.GC4671@magnolia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix more compiler warnings about pointless checks, unchecked return values, brace problems, and missing parentheses. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen --- db/check.c | 2 -- libxfs/libxfs_priv.h | 4 ++-- libxfs/xfs_bmap.c | 2 +- repair/phase6.c | 4 ---- repair/rmap.c | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/db/check.c b/db/check.c index 12a0aed..6076540 100644 --- a/db/check.c +++ b/db/check.c @@ -3220,9 +3220,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 19bdbdb..94804fe 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -504,8 +504,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 31a631a..ab5853d 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 b051a44..8fdf8e5 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -3082,8 +3082,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; @@ -3095,8 +3093,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) { diff --git a/repair/rmap.c b/repair/rmap.c index 9710565..07d1ba8 100644 --- a/repair/rmap.c +++ b/repair/rmap.c @@ -1542,7 +1542,7 @@ rmap_populate_realtime_rmapbt( imap.br_startoff = rm_rec->rm_offset; imap.br_startblock = rm_rec->rm_startblock; imap.br_blockcount = rm_rec->rm_blockcount; - imap.br_state = (rm_rec->rm_flags & XFS_RMAP_UNWRITTEN ? + imap.br_state = ((rm_rec->rm_flags & XFS_RMAP_UNWRITTEN) ? XFS_EXT_UNWRITTEN : XFS_EXT_NORM); fakei.i_ino = rm_rec->rm_owner; error = -libxfs_rmap_map_extent(mp, &dfops, &fakei,