From patchwork Thu May 11 12:49:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9721393 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 6CB4760236 for ; Thu, 11 May 2017 12:49:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6179A28652 for ; Thu, 11 May 2017 12:49:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55BA02865C; Thu, 11 May 2017 12:49:51 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 EB70628652 for ; Thu, 11 May 2017 12:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932503AbdEKMtu (ORCPT ); Thu, 11 May 2017 08:49:50 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:60666 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932212AbdEKMtt (ORCPT ); Thu, 11 May 2017 08:49:49 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0Ldqqt-1drnCf1Mot-00j3Y7; Thu, 11 May 2017 14:49:34 +0200 From: Arnd Bergmann To: "Darrick J. Wong" , linux-xfs@vger.kernel.org Cc: Arnd Bergmann , Dave Chinner , Brian Foster , Eric Sandeen , Calvin Owens , linux-kernel@vger.kernel.org Subject: [PATCH] xfs: avoid harmless gcc-7 warnings Date: Thu, 11 May 2017 14:49:21 +0200 Message-Id: <20170511124932.226016-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:vBNqgu7Dwq4nsUyGgjca8+9/7RlbltmFdZKnUlD4CLw+7QGReU5 EYpXKTUMNw8ZSaXmYy5IarscHsq3s7yWBvD5W9NDtqs3WNxm7n/GuCPUwTIsSiisbtAN/gO e+sf44BdWvxTYbkjjzA+b1ypzsD9OHf7ImbwQlxqePu5iHk1YYp10UfULeKyy7DxvJW+a3Q QPe0szTA6QDRUmsXcqT1A== X-UI-Out-Filterresults: notjunk:1; V01:K0:IMl8BdeTDhY=:WxLGwaMXwY4yB5RGU/wVxT caU1kuJpp7dm9YQcjEI2VW2iyX1ExEyaEys4W0jI+yN5UoTLBR/O/oHruIDwnhF5HsH8ldBlo WocU3RosDix2gOwpx0njE9ErVBljtqeaN1jPzb9Zc3sZwH6xaxZ3Q3/mApiavHMGa9rUbhr9s yn0FmZgBGoakSaxyFpGjQD6In+cExCojBYAxsBN6UBV0p/xzMtiuqi7r9z8ewv/wYHdHy19wk hAkGWHh4BJMBQlopm6etZIpy0NnGsh7PBvIoMFqf3y9FD1dMzSi1bb5ftVH0nooIsxQBNEspy 1G62nMlWbG67HH4QQer5TyYHniwVFGolKbbD14OjbAe+z0DaYRvAczqnZXgX2jtYpipO/mzcp tSvHlNBSwgkNIoYu+Bq4wxgkaqamZ7G9bu7VMHX3T1UPiB9Frh+oIew958G6WmaatpZPli7lL roPuixwqOhZ5ZCoWEfprzqVteNoQ5vlzsquk82M11z/s48iJmSeZ8+PFUogYxqOUkPmJtBg8+ zrBAsMjsi+U5DmCW3kchhZQIO1DWZr4qr/C4qRP0meosyUrnBQS5B+RfLfUQeSyiigpvS3FAE CPAH8mKOzPvpXSpWf72jBTAvtGsXcYIhz/xg2GXbSD2MZezSPsd/JyfgX/U9D+/NVSgUx+6l4 9Hmd37rEc9bnTkztv2fuvIggmUEkZ/qOhu0L1DeN/LH71CcbgxFNqdvTmmdGc8RgXa88= 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] This one is clearly fine, and we can add a comparison to zero to shut up the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Eric Sandeen --- 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..cbd3ffe42f39 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_BOFF(ip) != 0) && 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_BOFF(tip) != 0) && XFS_BMAP_BMDR_SPACE(ip->i_df.if_broot) > XFS_IFORK_BOFF(tip)) return -EINVAL; if (XFS_IFORK_NEXTENTS(ip, XFS_DATA_FORK) <=