From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757520AbdELOSx (ORCPT ); Fri, 12 May 2017 10:18:53 -0400 Received: from smtprelay0159.hostedemail.com ([216.40.44.159]:47882 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756083AbdELOSw (ORCPT ); Fri, 12 May 2017 10:18:52 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3873:4321:4605:5007:10004:10400:10848:11026:11232:11473:11658:11914:12043:12438:12740:12760:12895:13069:13153:13228:13311:13357:13439:14659:14721:21080:21433:21451:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: color78_6a0db7ce70b3e X-Filterd-Recvd-Size: 2303 Message-ID: <1494598724.2028.19.camel@perches.com> Subject: Re: [PATCH] xfs: avoid harmless gcc-7 warnings From: Joe Perches To: Arnd Bergmann , "Darrick J. Wong" , linux-xfs@vger.kernel.org Cc: Dave Chinner , Brian Foster , Eric Sandeen , Calvin Owens , linux-kernel@vger.kernel.org Date: Fri, 12 May 2017 07:18:44 -0700 In-Reply-To: <20170511124932.226016-1-arnd@arndb.de> References: <20170511124932.226016-1-arnd@arndb.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-05-11 at 14:49 +0200, Arnd Bergmann wrote: > 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. [] > diff --git 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) && As far as I can tell, this suggestion makes no sense. $ git grep -E "define\s+XFS_IFORK_BOFF" fs/xfs/libxfs/xfs_inode_fork.h:#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) $ git grep -w di_forkoff|grep -P "\w+\s+di_forkoff\s*;" fs/xfs/libxfs/xfs_format.h: __u8 di_forkoff; /* attr fork offs, <<3 for 64b align */ fs/xfs/libxfs/xfs_inode_buf.h: __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ fs/xfs/libxfs/xfs_log_format.h: __uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */