Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5666241rwl; Wed, 22 Mar 2023 00:04:24 -0700 (PDT) X-Google-Smtp-Source: AK7set/w0Q1YDc4s7dSMEYR9Hqlirqz1HjEIdIAZelf9vIl8WnOzvnT1lXnbiMCh5ksAncRW+3xB X-Received: by 2002:a17:902:d4cb:b0:19b:dbf7:f9ca with SMTP id o11-20020a170902d4cb00b0019bdbf7f9camr2661862plg.0.1679468664567; Wed, 22 Mar 2023 00:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679468664; cv=none; d=google.com; s=arc-20160816; b=oxcaqLTq2rIAVcM+3mLwGTE813AMf082MQnY+ThEE+d5aDnfRqdH3h1VJeyDJ1ROgM pxmXHoIRbkjuRIO5FhX7joJiGk4Kj5K/+Ljdhyoeh5V7yChRd18BR+iXc1TTzQ3Qgdn7 K7geuinK41mhqEN78zYVyCCvJvmnjQir3cH3mqgSb8SxVcf08Zy7Bi4LWwgaZgqYftiJ +FHWZPs2uB1snCI1N+5A8jXHyWeLldhuEp/90yWnEBS7HLD0CPoBSmDNozxEHe0nA8VN SM/An0jg1GAOERinb93ekH0sB03ig7QD5CUy3lDCVUY+OcxC42abIdPK+zKuA5mqliL9 YVWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=EqC10z/Y95ijy46I+dvbfIqS+O1pQDzMdijs2y9Bbt4=; b=xtIgEmW2m/gDKbpCHyc40uC9/7lMMeqH9OsEh4GCiNFOuVCV7ktcwAKCCL7o0LJ/lz YIWv+TnI6W93/Y+RkpC39o6fdo5Rz3NAD+wUkZBbpPOgoGfnlogXLz7cxbAqgDIT9Bfl VvpkFHGTpa5R+Bjb0+IZLYBfwruC63qx4/wgpL4M7xMm495vDztb2Pr8P0aXhKvfvufZ 3N3piIRHg5P9DSYeUkM87iflKJ00I58pT1bniZFtfTJ1UAUCSYyOwRVyjjhiF4kFgFXV 5gJf4h+XNmy7N0m0F/u8qVbd+bXwaKvNkfbXv9C4GU8q7tcWXRP1aamlGhhFwNtesm/6 rQHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc3-20020a170902930300b001a190baea78si14772498plb.185.2023.03.22.00.04.11; Wed, 22 Mar 2023 00:04:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbjCVHAD (ORCPT + 99 others); Wed, 22 Mar 2023 03:00:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjCVHAC (ORCPT ); Wed, 22 Mar 2023 03:00:02 -0400 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1795018B1B; Tue, 21 Mar 2023 23:59:59 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R321e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VePpt3A_1679468391; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VePpt3A_1679468391) by smtp.aliyun-inc.com; Wed, 22 Mar 2023 14:59:57 +0800 From: Jiapeng Chong To: viro@zeniv.linux.org.uk Cc: brauner@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] fs/buffer: Remove redundant assignment to err Date: Wed, 22 Mar 2023 14:59:49 +0800 Message-Id: <20230322065949.29223-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.0 required=5.0 tests=ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Variable 'err' set but not used. fs/buffer.c:2613:2: warning: Value stored to 'err' is never read. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4589 Signed-off-by: Jiapeng Chong --- fs/buffer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index d759b105c1e7..c844b5b93a89 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2580,7 +2580,7 @@ int block_truncate_page(struct address_space *mapping, struct inode *inode = mapping->host; struct page *page; struct buffer_head *bh; - int err; + int err = 0; blocksize = i_blocksize(inode); length = offset & (blocksize - 1); @@ -2593,9 +2593,8 @@ int block_truncate_page(struct address_space *mapping, iblock = (sector_t)index << (PAGE_SHIFT - inode->i_blkbits); page = grab_cache_page(mapping, index); - err = -ENOMEM; if (!page) - goto out; + return -ENOMEM; if (!page_has_buffers(page)) create_empty_buffers(page, blocksize, 0); @@ -2609,7 +2608,6 @@ int block_truncate_page(struct address_space *mapping, pos += blocksize; } - err = 0; if (!buffer_mapped(bh)) { WARN_ON(bh->b_size != blocksize); err = get_block(inode, iblock, bh, 0); @@ -2633,7 +2631,6 @@ int block_truncate_page(struct address_space *mapping, zero_user(page, offset, length); mark_buffer_dirty(bh); - err = 0; unlock: unlock_page(page); -- 2.20.1.7.g153144c