Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5742568rwl; Wed, 22 Mar 2023 01:25:59 -0700 (PDT) X-Google-Smtp-Source: AK7set89XcGl3NPymRCtH9jCczuPjJKHgCCdhXItIyuVX3rWg45soxAA/WM3XWtl/kP46A4ozc9v X-Received: by 2002:a17:906:80ca:b0:8b1:264d:6187 with SMTP id a10-20020a17090680ca00b008b1264d6187mr5705925ejx.46.1679473559595; Wed, 22 Mar 2023 01:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679473559; cv=none; d=google.com; s=arc-20160816; b=v5Ykypg+BjM+AGPn2DZALRedV/sDNdlvVkmF/C07U98cGA1FJm+GXb+f8f7KlrSW/w MdrknTtYPshkUTJ/ksbIrLRvjpKdFGskoFnsDwfrRXRyAj4mp5yXR4GEQRlGvEopq2gq G7xaAmVyz7O5hgMKcFfS2qhGJz2CPAPQBNVkCr6nGKvAP9yNtt/fo4v3+j5nqa9PNjsy yvp+xloVeBMvsd7Mat7SqAMhYZpVQd5ncS/vZbw8TfZuWT6trtR+Z76crz7kAv8qZ9et eZqPiVa+QyIM9mJlwNR2AayqFt+IrAU4Y1xySTre8PtqFJJk93HTak7CmZAuPQyMPxDJ ld6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h8gdZqlaDb3XOA4JeQ2y52q3qZy7cnmcUDvu+YFf1Xo=; b=l6VDmRW1AnauQlc/Oe4X1VFFz+xeoTuMrjamCGu7YdvMUhjcHb3Njzoe0tBLPMWFIX bugFJkbi8kDqQsrFIGQY0wBksoB62oSq6w3IHuYb51Tj4ia967+FMiqxoo3UjsmP8Gb3 No1RHpkaVnVuOcKsoWazSqLvPPWFvKUHfHci+f4duVUNxpte//+yxquZgaxy+dw7tvVX MPDsi8t6ZysAFmDz8qnWNdEkTCN3rqUyc+Iq4ZQU9BZAitJzoejJgUG2ZNdMQXYO20CO q0HBqgtjjnW3tpo7+2GRtA36Wf6xRGSCoOrR+0BLBlhDIY+9r8OwKIOqyMRIV5+nt7+b 1duA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XQtimfNR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju17-20020a17090798b100b0092feaa573ffsi14687358ejc.632.2023.03.22.01.25.35; Wed, 22 Mar 2023 01:25:59 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XQtimfNR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbjCVIUz (ORCPT + 99 others); Wed, 22 Mar 2023 04:20:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229672AbjCVIUw (ORCPT ); Wed, 22 Mar 2023 04:20:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DFF75941D; Wed, 22 Mar 2023 01:20:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E6787B81B5B; Wed, 22 Mar 2023 08:20:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21B5EC433EF; Wed, 22 Mar 2023 08:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679473248; bh=hclSpSAvHMC2NvRtZD9SW20kTIbHxZrtYZ1rX/4B/Pw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XQtimfNRBpQAgwCX2xh5yhh0iIFgMbqMnDBt81yGUOsTT69OJF1CNyZce90iSnLBV teRbPYVZ5mljc5wCa5cfPRlOCuMq9Og6mjj2XjDiC87z4ZAq5seI+ZA29ZcCM+5lBk +kh8f2hOk3jOk9PGCG+5UdQGGpZgxauHSl9xD6WCKdqxbX6tbpzNQeQ0sMbMHLGS/7 /sazMg6Q4LkJvGK3pRrZCNe5x/CcCTgqJo9fj4dYkFtIUUMNczgj8kbNO3bT7UqfgB NCBWt7XSfi5gpej+t8rDj+2vH1b0FXuhUxEZ/34OiveX9cA1ijRPUfSVi3CxTw2xtx usF5f8/AmKnWg== Date: Wed, 22 Mar 2023 09:20:43 +0100 From: Christian Brauner To: Jiapeng Chong Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Abaci Robot Subject: Re: [PATCH] fs/buffer: Remove redundant assignment to err Message-ID: <20230322082043.f3vcu4iucqe533hl@wittgenstein> References: <20230322065949.29223-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230322065949.29223-1-jiapeng.chong@linux.alibaba.com> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 On Wed, Mar 22, 2023 at 02:59:49PM +0800, Jiapeng Chong wrote: > 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; This change makes the out: label unused.