Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp156828ybl; Thu, 29 Aug 2019 20:39:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbyMEJyzPywPjCUkqvlYP15D5CHin8Ybz3w9BZ1H326sz1+Q1VpPYXSU04k7bM56DhYCIr X-Received: by 2002:a17:902:d:: with SMTP id 13mr6856567pla.36.1567136340685; Thu, 29 Aug 2019 20:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567136340; cv=none; d=google.com; s=arc-20160816; b=Ipg1SLucdWnr91uqfI3pxlxTsBt3msz9uQDtPIN6c8NhE1JEgAAV9H6Y+WGPO4/yN0 Z83RLxlOn2MDBfD5/RrNi1iJNkgJOYlCSDw6XMbcqhmBwbkWqdKrWwfcw2NUopvFoGXN 1JXjObHUzRGewk5inyTJXtenkvk2sCZor8rHfQnRRjnEXJImgjLOKLnMUkn8vBUQBb/I dm0U9jkdWaDCq2vc8evF1nq/yB2Ou4VGBeNMkO2ipNWU2uG1q7hSWlBZMhcONvCrI3Zh /qRUMaERxk4NdjAbsShfDD0FAfjD9HZ3/ORhXjyJJTHwqF2sohutb+xkkHrtl76iWmoB k/Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=8DUHKCfHNzHjtygj/mViISrltHzn6U7KmlQ4GCO17uw=; b=0i8/QLNxUSGSpEvwQhJRD9BcRz9Z1gsdPGsTRh0UwgOdQTANFs8L++YpwSavgtoO5N wDs1962AGH2OaJybibvS5ERtGIiJVsyOI2DQOaLrzaOAO5sOwfYeaejL7BEYNxCquI7b IihxaPsVy9h4iVLqFqI05niJD2G6kM891r674BhCdYJjp+vManF1NAOhBQPT1M7336MY Oxw8OYc29uc9eAMrEbdfTJ8OkW7Lv3jT64ibaWRBQMcfEB4XdDNsdeq5FLv0Xxqx63uB nJYTgY9naebbhMMpSsCt4EaVGioENIu5S5+haxa9e5vTMftGlPqm72DEQ94CvJ8Ux9Bp Vz3Q== 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 2si3566244plb.372.2019.08.29.20.38.45; Thu, 29 Aug 2019 20:39:00 -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 S1727985AbfH3Dht (ORCPT + 99 others); Thu, 29 Aug 2019 23:37:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5248 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727916AbfH3Dhr (ORCPT ); Thu, 29 Aug 2019 23:37:47 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1FBADF2F7157C1932886; Fri, 30 Aug 2019 11:37:45 +0800 (CST) Received: from architecture4.huawei.com (10.140.130.215) by smtp.huawei.com (10.3.19.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 30 Aug 2019 11:37:37 +0800 From: Gao Xiang To: Chao Yu , Dan Carpenter , Christoph Hellwig , Joe Perches , "Greg Kroah-Hartman" , CC: LKML , , "Chao Yu" , Miao Xie , , Fang Wei , Gao Xiang Subject: [PATCH v3 7/7] erofs: redundant assignment in __erofs_get_meta_page() Date: Fri, 30 Aug 2019 11:36:43 +0800 Message-ID: <20190830033643.51019-7-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190830033643.51019-1-gaoxiang25@huawei.com> References: <20190830032006.GA20217@architecture4> <20190830033643.51019-1-gaoxiang25@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.140.130.215] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As Joe Perches suggested [1], err = bio_add_page(bio, page, PAGE_SIZE, 0); - if (unlikely(err != PAGE_SIZE)) { + if (err != PAGE_SIZE) { err = -EFAULT; goto err_out; } The initial assignment to err is odd as it's not actually an error value -E but a int size from a unsigned int len. Here the return is either 0 or PAGE_SIZE. This would be more legible to me as: if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) { err = -EFAULT; goto err_out; } [1] https://lore.kernel.org/r/74c4784319b40deabfbaea92468f7e3ef44f1c96.camel@perches.com/ Reported-by: Joe Perches Signed-off-by: Gao Xiang --- v3: fix a typo in subject line. fs/erofs/data.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 0f2f1a839372..0983807737fd 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -69,8 +69,7 @@ struct page *__erofs_get_meta_page(struct super_block *sb, goto err_out; } - err = bio_add_page(bio, page, PAGE_SIZE, 0); - if (err != PAGE_SIZE) { + if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) { err = -EFAULT; goto err_out; } -- 2.17.1