From patchwork Thu May 11 15:04:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9721977 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 CE91160364 for ; Thu, 11 May 2017 15:05:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C136928679 for ; Thu, 11 May 2017 15:05:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5EF928684; Thu, 11 May 2017 15:05:23 +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 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 9E90928679 for ; Thu, 11 May 2017 15:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932961AbdEKPFI (ORCPT ); Thu, 11 May 2017 11:05:08 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:60594 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932427AbdEKPFG (ORCPT ); Thu, 11 May 2017 11:05:06 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0LouWl-1dglcO3HA3-00grYx; Thu, 11 May 2017 17:04:51 +0200 From: Arnd Bergmann To: "Darrick J. Wong" , linux-xfs@vger.kernel.org Cc: Arnd Bergmann , Brian Foster , Eric Sandeen , linux-kernel@vger.kernel.org Subject: [PATCH v2] xfs: avoid harmless gcc-7 warnings Date: Thu, 11 May 2017 17:04:33 +0200 Message-Id: <20170511150450.2573345-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:xl5z3X0PsOKMPrhORu8le2Ttt4E6vTIpuDidZNIEkBSh6b4QQjS 5EBMgVLmrLl4TW9Z9jCgBK9cYhy/okBxYNjGXGkQ3Zbqr/JxoVM1IMvZe/2v1snWzks8yHa 0BmDXsSyL2zXDnHBJy316Yrn0JY/Z1+YHBmMJHGjYUoaYs1uSh0sHN45Zh0tdDCGuS9aA6l rxWpHPszLmjApVesH8oMw== X-UI-Out-Filterresults: notjunk:1; V01:K0:0VPJHqI4dYk=:8AANz6cOWUU0kySURosSq/ mBOPjlI3FnkP7pW1qfkOPYGU65Bjsi+oDMRhlSN2BoR8g+qElA48aD2nXsT6DCMgaDrMPnRtB MLmh/df/kz/IthZQvm9cYLSWBJxEcV/tGolniNmNO5KBzFCWYVbya8T7sp81EaTlmbaJ8TGEG r+CX6e2L11xwvAKtqac8JBSZpbYCbHdCeRA9gm+rKm/SIleTYYSbjq9X9Kww4u4Xn21i+vP+o sxYswbZBQAfaXzSUtljnHZzkr0CKDNRhoB8YLVYntO+Q0SWZH40fe8d5kjJvHsuk2OBluaE/2 4xGw4y1EoEB61xSsejbx3akd5OjpaigSFBmfHQIFkorA+3rN+d89ACtYO6X1QEmOUB/mnkdUA N30vkiTPJjjyv4qf3sf/s4+3ItfKC2KNLxFJeE4iDowkBgsLisNRBlm1l6pATtKKONGl0HFQZ ve9sJRwEv5mBj2ttlh5vuSTd6qJ1USqyIeV4ZoU0tWZetNbS4KvVM2JrhIhqLn3RjKlz9t2VY L9p5RSECdQGlDbUFi5mhRw9AJEVT13Ozm14qSpL4VC9bM1GqnWlV3D1u7gNn2OHNyFobX3uBS nvWFXvOP9gjFa4ioIH4+pqHW0U9dy+5GM1EoSppiFMj1uQOTO30lR0HtVEImvLjJjNeHJPgxx V9Db222BuO35ECADOivjtTZi2zBCSOTgzz/RDgtSXBOlFkYG7C67OYvO2x/eZRVPOncw= 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 gcc-7 flags the use of integer math inside of a condition as a potential bug: fs/xfs/xfs_bmap_util.c: In function 'xfs_swap_extents_check_format': fs/xfs/xfs_bmap_util.c:1619:8: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context] fs/xfs/xfs_bmap_util.c:1629:8: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context] There is already a helper function for testing the di_forkoff field for zero, so let's use that instead to shut up the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_bmap_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 2b954308a1d6..da4867567647 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1613,7 +1613,7 @@ xfs_swap_extents_check_format( * extent format... */ if (tip->i_d.di_format == XFS_DINODE_FMT_BTREE) { - if (XFS_IFORK_BOFF(ip) && + if (XFS_IFORK_Q(ip) && XFS_BMAP_BMDR_SPACE(tip->i_df.if_broot) > XFS_IFORK_BOFF(ip)) return -EINVAL; if (XFS_IFORK_NEXTENTS(tip, XFS_DATA_FORK) <= @@ -1623,7 +1623,7 @@ xfs_swap_extents_check_format( /* Reciprocal target->temp btree format checks */ if (ip->i_d.di_format == XFS_DINODE_FMT_BTREE) { - if (XFS_IFORK_BOFF(tip) && + if (XFS_IFORK_Q(tip) && XFS_BMAP_BMDR_SPACE(ip->i_df.if_broot) > XFS_IFORK_BOFF(tip)) return -EINVAL; if (XFS_IFORK_NEXTENTS(ip, XFS_DATA_FORK) <=