Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3579524pxb; Mon, 24 Jan 2022 12:42:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnTOmahLHvjEwJWzJSI+PhrDKsgj/geRTJT0LwRmKaFTqV/8bTrZUwtkgQWXn+Ewab+8cn X-Received: by 2002:a63:6ac1:: with SMTP id f184mr8670460pgc.20.1643056926587; Mon, 24 Jan 2022 12:42:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056926; cv=none; d=google.com; s=arc-20160816; b=Ushx5zUCKs1Vds+tVSJkgDXdflNQGUdocnt1sErGpdQIYtML2k4ML6QEoCj2ugkhRr GkYR4nRAiL2jN5Yp0i0tGj/sEfG+iE8ajBjC4vug69qbBemRCn4PZz1P1vK2JMQMdgK0 1p8JoJySsKUjvrx2nwrtEuY00jeK7OfkqAGI/zmyCEPcPGWHTxE3yiz9LNVJR/5nK6V4 hiIBZ/sqQnmagnYhuZzMqzVYzSqB8wjitsOb7SmAhYPx6zjXx+hVYrtdAY8Lm6rKFf7i JtQSCXEAYtj021GOpyYGZSJ46R+plzKeep3G8n/o0uT4tXT87AgJjiwNdGPN7V95TKG+ xbUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=PALzt4viqppnbCTEd5JnoddSy6Y386bU+yI0jFXb2Xs=; b=lspBXJJ+6Vb7XK/zgqqBm0lm63xOM4Qpf5B8NkNURnwNKmOTR3Ped3qZ687RkXmnby 0/h0qxoOxe9GiWmTlFu2w8LPEiY3Uenn04KetoovyP7ROP3AFCprVt2lPTlQ+wljLXuC +O4vXaSBqOnL3pjWWT88+Ml+OuS23WtGbhws3VS5652x4RkFP8cdyaSGjEjWBGmN0abe pQQrHELYUB8blHkpvkB6mg9cxfbiLO00Df4KGyNsMz5HteG0xHUehjduqLlEl0wDBeoO QFLnAY/HnY+0vxR80vp/P1gxh89+N2mkdX0cvevjD265rWikae8vhy1kKKNTS2FC179W alFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=IcseyuDi; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si13850949pgl.773.2022.01.24.12.41.50; Mon, 24 Jan 2022 12:42:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=IcseyuDi; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358948AbiAXT4E (ORCPT + 99 others); Mon, 24 Jan 2022 14:56:04 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:58142 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348231AbiAXTol (ORCPT ); Mon, 24 Jan 2022 14:44:41 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 5F1992113A; Mon, 24 Jan 2022 19:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1643053479; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PALzt4viqppnbCTEd5JnoddSy6Y386bU+yI0jFXb2Xs=; b=IcseyuDiG7EozSQCnSlNaIu0C8m1RyI7OuFmUHsOAWJWLqp41pauanI+rysneFWcm5CLBR n7LPQF4ilqHydWcwaG6eVa1Qy64FHY/FhoTpzfBHzyn1QaqN5MDgMHpI4cGzjbyXkxCyDH 9MrEYU4J3b/joldDU/jitBydSALwLZo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1643053479; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PALzt4viqppnbCTEd5JnoddSy6Y386bU+yI0jFXb2Xs=; b=fzuSFXyQjPmOXWqT/rGkeCcHwkWfuZUI8J6+pgGu3olwRTUa2sshOKH52RYgaMjfPNFRXV 3/b0X7L9No9PlVCA== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 51D7EA3B81; Mon, 24 Jan 2022 19:44:39 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 54796DA7A3; Mon, 24 Jan 2022 20:43:59 +0100 (CET) Date: Mon, 24 Jan 2022 20:43:59 +0100 From: David Sterba To: Jiapeng Chong Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Abaci Robot Subject: Re: [PATCH] btrfs: scrub: Remove redundant initialization of increment Message-ID: <20220124194359.GE14046@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Jiapeng Chong , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Abaci Robot References: <20220121114224.92247-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220121114224.92247-1-jiapeng.chong@linux.alibaba.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 21, 2022 at 07:42:24PM +0800, Jiapeng Chong wrote: > increment is being initialized to map->stripe_len but this is never > read as increment is overwritten later on. Remove the redundant > initialization. > > Cleans up the following clang-analyzer warning: > > fs/btrfs/scrub.c:3193:6: warning: Value stored to 'increment' during its > initialization is never read [clang-analyzer-deadcode.DeadStores]. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong > --- > fs/btrfs/scrub.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c > index 2e9a322773f2..38f5666eff14 100644 > --- a/fs/btrfs/scrub.c > +++ b/fs/btrfs/scrub.c > @@ -3209,7 +3209,6 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, > offset = 0; > nstripes = div64_u64(dev_extent_len, map->stripe_len); > mirror_num = 1; > - increment = map->stripe_len; I'd rather remove the initialization at the declarataion, the other values are initialized here so it's all in one place. As is's a minor change I'll do that at commit time, no need to resend. Thanks.