Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3932758pxy; Mon, 26 Apr 2021 13:24:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzp2pAr34W3fqEqjfP85lHY3QKnwCFT3bkN+FLUuigeL25/Te2sdAQY+J6SL5zxGxipHCXA X-Received: by 2002:a17:902:4d:b029:ec:94df:c9aa with SMTP id 71-20020a170902004db02900ec94dfc9aamr20570372pla.7.1619468685314; Mon, 26 Apr 2021 13:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619468685; cv=none; d=google.com; s=arc-20160816; b=RVVXrLprRAGW5WDUAGiAWUbMGSKWjnWbhpJmvljA7dLvpgxAXt+xTlCOelaCN8zaS9 koRYlEcEzx16SV2/4MY3uhwUyliczcGHQNqbbhduDK7AH1XXpvzuXbsZVzd84Ww/OCrj +zlSwPJcYs3u2VVfLKpKUiNIwxRsqo7Eu4yHa/Gxau/yRhXRQYqOeSvn3Qt60x09nCEN G5nyyiEqt1oiACe1QZC9d1c+Rcs0YfvIXXcD6Sux0ytN9KZoMeFZWNZRDyJxPHTAroAL 3CCtqa/JbhWCZwNWRYudQt9raKnoAN9lGGerAT2QnAo7SZ51gXxIVxLAZO3+lrER2INC DxJQ== 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; bh=b1rdurCcw/T+Kxg8idYiONQCs9BPXiiiZoS9iGO0DW4=; b=yBXpB5620MBk80TE2PpRvFE1VlEGOKvXEQ34jBK6NNlb8Y8KGlw1fq4bFVzTcoYJ1i ATm1w4rU4G39ox+yFy2G7jcDgOswst1RHjbSW9lJOfLf/hKhUmRRa9XelYrZsqhA8DQc d/0JC0NwV/++qkqKn/pjv/+1klRM3w/ha2ENBAJua44B7us4ePonYt2xpuOAtCtHw0Mf ysVXDS0DVqnZ2R1DFpVU8oVo91ag2zhZQhF3kD603NsPFquNI1DEKDVCuLvv2QATh+FY Rl6OrWh9ZFaRnkD1CcPJVN2uhJulNjzdq3Jp5YJJhHtzTsBqb4Kq1g1+W5sO11dxRsiL fu5A== ARC-Authentication-Results: i=1; mx.google.com; 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 s23si18875642pgl.464.2021.04.26.13.24.32; Mon, 26 Apr 2021 13:24:45 -0700 (PDT) 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; 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 S241728AbhDZUWg (ORCPT + 99 others); Mon, 26 Apr 2021 16:22:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:49682 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238112AbhDZUWf (ORCPT ); Mon, 26 Apr 2021 16:22:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C6A5AAEB6; Mon, 26 Apr 2021 20:21:51 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id B7D30DA7F9; Mon, 26 Apr 2021 22:19:29 +0200 (CEST) Date: Mon, 26 Apr 2021 22:19:29 +0200 From: David Sterba To: Khaled ROMDHANI Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH-next] fs/btrfs: Fix uninitialized variable Message-ID: <20210426201929.GI7604@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Khaled ROMDHANI , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20210423124201.11262-1-khaledromdhani216@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210423124201.11262-1-khaledromdhani216@gmail.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, Apr 23, 2021 at 01:42:01PM +0100, Khaled ROMDHANI wrote: > The variable 'zone' is uninitialized which > introduce some build warning. > > It is not always set or overwritten within > the function. So explicitly initialize it. > > Reported-by: kernel test robot > Signed-off-by: Khaled ROMDHANI > --- > fs/btrfs/zoned.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c > index 432509f4b3ac..42f99b25127f 100644 > --- a/fs/btrfs/zoned.c > +++ b/fs/btrfs/zoned.c > @@ -136,7 +136,7 @@ static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones, > */ > static inline u32 sb_zone_number(int shift, int mirror) > { > - u64 zone; > + u64 zone = 0; This is exactly same as v1 https://lore.kernel.org/linux-btrfs/20210413130604.11487-1-khaledromdhani216@gmail.com/ It does fix the build warning but does not make sense in the code because it would would silently let mirror == 4 pass. I think there was enough feedback under the previous posts how to fix that properly.