From patchwork Tue Oct 17 09:07:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 116046 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4637659qgn; Tue, 17 Oct 2017 02:07:58 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD3eGMJFan/hB07lxPhEl9FWo7poyaZhTnqXCcA4F3i8RGlv0bmjV80HZJh1VLsGwYlALk2 X-Received: by 10.98.74.23 with SMTP id x23mr11290554pfa.205.1508231278531; Tue, 17 Oct 2017 02:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508231278; cv=none; d=google.com; s=arc-20160816; b=t6zaB6EaMEg/6wNlZx+VjhRCRBd3Yf9O3XDo34aOzf3smgP4N8zN3A85ZS9TCqD0h2 KmjusbtbibyMSwbSKdDbE+sY2bfaO6MrJKZ3x1sY/xs+5CmrFicbjJkp25uHHF30fVTv DCaZAKkUy0YmnaJUe0FXLj+yHh5qcXUoT98wTG1YXTasLBd7WFPPhl0BQw/d4DmPWleT L7h7ay5MNH/vA4myU2Iv2tMzSCt12y36q2XSIRElV9qP4H6PH1iN71lRyhRcOTx7m+Xz mH6aizpd7Y2n5Cfjmid0ehEjpUshikv5X9WmsTEw8CTl0l79l06art9f5vwbCOJ8GE79 kZjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rThSjzEoF+nPk8LjgWckLYZyMsuhSVVo8ghEYWKncbg=; b=DUUJMWyRxpYzvPTb6EO+kx8+EVgZv4FYq/cnxAOmMHyThZHAd7jnGLHZ0rNOek3/Oi 0+qtiParz/oW/XbVKqW1gCiga1Qspd1KV9bxGiCCZIdYacbG19U4Y3kGaZbhTpPLhTzm E+s07qmryvBLN8hSwAIN+wLh3Nm9A7uVTY/D5YGhowoGeda9Dku7RpcUddfnGEX4mJ7H BBsLstK4l/lT5smLufL7PXIzOpTR5xxR09cUIdMPKmpfdxFps7GPLouwzITD6ulAIF/n JVPIXFV61MOv2s8dnho87jAlz9WTgeiWGaTd56X0eLJ4zIo6hGppBWl7t7Po6JMPF9Jr /muw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si5202632pge.222.2017.10.17.02.07.58; Tue, 17 Oct 2017 02:07:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760044AbdJQJHz (ORCPT + 27 others); Tue, 17 Oct 2017 05:07:55 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:63413 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758488AbdJQJHr (ORCPT ); Tue, 17 Oct 2017 05:07:47 -0400 Received: from wuerfel.lan ([46.223.139.202]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0MK9RN-1e30vu2dQj-001U1t; Tue, 17 Oct 2017 11:07:23 +0200 From: Arnd Bergmann To: Jan Kara , Andrew Morton Cc: Daniel Jordan , Chao Yu , Arnd Bergmann , Jaegeuk Kim , Kinglong Mee , Yunlei He , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: use extra parenthesis around assignment/condition Date: Tue, 17 Oct 2017 11:07:12 +0200 Message-Id: <20171017090721.1393677-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:Rh8vvDwqnBdLbOGh0e7LR+Hh9zxQH+l4oK+rqNnNLRFXK/ilRy9 nZgQbV1MAVa44sHImd0TTm8y9AqjuBWz2mJgm3vXLMcnIlRYU/J2ey03uAi0ZyJ8LNwHBjP K1+BdxkOxYRbKTDyFDf0/0BnInhJEiPDvU63OkAKKAYJkVgqcVHwv7D+YicHVUKahbkVjT9 XOur2DEDcJH7gUKnQiEdA== X-UI-Out-Filterresults: notjunk:1; V01:K0:TFDHFujkmrA=:4TnT4svEORZPGiqis5Yn+x htUl4nSTBfhMTDALVpWjSZXStOPpo623hByV8gr1iRPW4XwcD/djoR8kWVGl/v8KExW6vvLcz BcsdSiYmYJldyODEs3bfamfBZVA+K/qeftysJ20ORzBxqgvikEa2J95CNbu74o3N1w1/U+GYc vyqy6e7QETE+uB1CHfDtaKnUGV/u12z6FdwC+H9yQTyiT094uZNQQHNht6IWoehKI44xbRpOS myAg0oTWkiJEDZFaXr5niShPhNR5We5A8i3xEKnAil5q0VjjgE9P4k+hrERPO/mNLfD1PLLPc Kvu6YV4RvPa6KQZJLhjCdGY5lMiaOgmgc8Ggfrg4Lg4mjhrGuUpIiUNp4nZCLrAB0eV0OCZCv 9a491hsxZBesqG+laWCXaJg5jb1T7CiVskS8O9gPiYAMf1HRy/UVqCk7IX9+s2Iea11xuWV9f 0TwDnhKrTy7isHv0Stx6qSvx+cFvOhB5RpXFLUZ1+cg8fdcA3AGiXWZDC4Kznaqim6pPjl6Wn J9ImdzvQqdodVCsCvzQcmmYLPDtS6bXM8SQyzKdumr6r3+Z5StwwFjBkDZvIGnmoR7uIKj6ko 0d4Y9ySZGwuGdQja8ZrBNYJZsGWyw63FW+KuK8umZUuGb0HoaJHb+CgjyKI89eeBpnDxP0O8O /2ATRpqxainvhyXV1YpLPIZ7PoGQ+QtYB56QZVxwj44/e+hlcLGLMDTbamyFHYFWQIwBYRqjT nTzQqNuh/jE1BMDUh5OClmP0wuSrkALDm+ntbQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc warns that writing a while() loop with an assignment as the condition looks suspiciously like a comparison, and suggests a workaround: fs/f2fs/checkpoint.c: In function 'sync_meta_pages': fs/f2fs/checkpoint.c:321:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses] while (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, This seems reasonable, so let's do that. Fixes: 4aba7297f4a5 ("f2fs: simplify page iteration loops") Signed-off-by: Arnd Bergmann --- The warning is from mmotm. Andrew, please fold this fix into the patch that caused the warning, unless there are objections. --- fs/f2fs/checkpoint.c | 4 ++-- fs/f2fs/node.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) -- 2.9.0 Reviewed-by: Chao Yu diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 3ed9dcbf70ae..6124f8710dc3 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -318,8 +318,8 @@ long sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type, blk_start_plug(&plug); - while (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, - PAGECACHE_TAG_DIRTY)) { + while ((nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, + PAGECACHE_TAG_DIRTY))) { int i; for (i = 0; i < nr_pages; i++) { diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index d4ceb9ebfe92..d6e4df0bb622 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1285,8 +1285,8 @@ static struct page *last_fsync_dnode(struct f2fs_sb_info *sbi, nid_t ino) pagevec_init(&pvec, 0); index = 0; - while (nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, - PAGECACHE_TAG_DIRTY)) { + while ((nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, + PAGECACHE_TAG_DIRTY))) { int i; for (i = 0; i < nr_pages; i++) { @@ -1439,8 +1439,8 @@ int fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode, pagevec_init(&pvec, 0); index = 0; - while (nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, - PAGECACHE_TAG_DIRTY)) { + while ((nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, + PAGECACHE_TAG_DIRTY))) { int i; for (i = 0; i < nr_pages; i++) { @@ -1552,8 +1552,8 @@ int sync_node_pages(struct f2fs_sb_info *sbi, struct writeback_control *wbc, next_step: index = 0; - while (nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, - PAGECACHE_TAG_DIRTY)) { + while ((nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, + PAGECACHE_TAG_DIRTY))) { int i; for (i = 0; i < nr_pages; i++) { @@ -1650,8 +1650,8 @@ int wait_on_node_pages_writeback(struct f2fs_sb_info *sbi, nid_t ino) pagevec_init(&pvec, 0); - while (nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, - PAGECACHE_TAG_WRITEBACK)) { + while ((nr_pages = pagevec_lookup_tag(&pvec, NODE_MAPPING(sbi), &index, + PAGECACHE_TAG_WRITEBACK))) { int i; for (i = 0; i < nr_pages; i++) {