Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp593688ybz; Wed, 15 Apr 2020 14:45:39 -0700 (PDT) X-Google-Smtp-Source: APiQypLc0nyG9MS8KfFbtzceBLQUSPcyEOMMoBjK2IZ36uwMsgroNfazLYw0644osk059ntOXSlI X-Received: by 2002:aa7:c40b:: with SMTP id j11mr11603512edq.17.1586987139212; Wed, 15 Apr 2020 14:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586987139; cv=none; d=google.com; s=arc-20160816; b=DCR/sElTFKSKbVKbFNZFvTFZsz8T3BuMpeGylSi/UNc2HwVPewcY235qDPTR4TK21J EcTxfBi3lVb9E0xNRxORjLuYk6Dm9aXVDa6toNpunIQ032Td2xzmovLFQ9Ndu0CDo+IN 4u8HCWZQUoUanYs+MVk9lcshqTrlSNt/v/9TUwW635GZZ+S2vaTp/JLJd4c7SxfOWlg1 gmu04deUs0rF04g1PRJiYSdVP4vkKuyyW3aSPdKDjFedg/6B1/mvDKZ6NLu49VKMhbD1 nAjWMFaI1VT+TLOT2jC+7DHJpdRVXa8RTe0i+Dmwucczrann//F2/STryiEn7qiulu+g Fxjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:reply-to:message-id:subject:to:from :date; bh=OvFLa9LLj7oQxOjsWR2K8ZafETGKRv+GRqTH36lAYww=; b=e+ZBnU34bjtLAIDfwh6rUfVhYAGSmoBZhwIbcSd8Jg4Nsp6YqNDjsP5sB6/6BVLZFN b+XcM8ShhDsedkKp+2zA+j3eDrWh7I/ZEMAtPacOwpp0Eh0lfG1d9aew+/Lzqmpn5Axz JBcRANYGTsTI+lB5xwvlvwnRoGEVdy/vqonsV0M4CbHibur4XeyDul4Ry7XmM0bPTGQm e2KSQo4zZhnvsTtYNjBUHn1eZop/JRjCk54VwjjfLbN3CHaN2jvIsq/t78jhqwPelUlC Y41vc7deE409fNne9r1A4pIz4K/uZ05NgJoSW/AMH/H0UCRdyKAnXN91d6t2itfSo7i9 4lIQ== 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 v5si10899325ejh.81.2020.04.15.14.45.15; Wed, 15 Apr 2020 14:45:39 -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 S2439428AbgDNPXo (ORCPT + 99 others); Tue, 14 Apr 2020 11:23:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:49086 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390831AbgDNPXP (ORCPT ); Tue, 14 Apr 2020 11:23:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4D89AAC26; Tue, 14 Apr 2020 15:23:12 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id A41C0DA823; Tue, 14 Apr 2020 17:22:33 +0200 (CEST) Date: Tue, 14 Apr 2020 17:22:33 +0200 From: David Sterba To: dsterba@suse.cz, Tang Bin , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Shengju Zhang Subject: Re: [PATCH] btrfs: Fix backref.c selftest compilation warning Message-ID: <20200414152233.GV5920@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Tang Bin , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Shengju Zhang References: <20200411154915.9408-1-tangbin@cmss.chinamobile.com> <20200414151931.GU5920@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200414151931.GU5920@twin.jikos.cz> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 05:19:31PM +0200, David Sterba wrote: > On Sat, Apr 11, 2020 at 11:49:15PM +0800, Tang Bin wrote: > > Fix missing braces compilation warning in the ARM > > compiler environment: > > fs/btrfs/backref.c: In function ‘is_shared_data_backref’: > > fs/btrfs/backref.c:394:9: warning: missing braces around initializer [-Wmissing-braces] > > struct prelim_ref target = {0}; > > fs/btrfs/backref.c:394:9: warning: (near initialization for ‘target.rbnode’) [-Wmissing-braces] > > > > Signed-off-by: Tang Bin > > Signed-off-by: Shengju Zhang > > --- > > fs/btrfs/backref.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c > > index 9c380e7..0cc0257 100644 > > --- a/fs/btrfs/backref.c > > +++ b/fs/btrfs/backref.c > > @@ -391,7 +391,7 @@ static int is_shared_data_backref(struct preftrees *preftrees, u64 bytenr) > > struct rb_node **p = &preftrees->direct.root.rb_root.rb_node; > > struct rb_node *parent = NULL; > > struct prelim_ref *ref = NULL; > > - struct prelim_ref target = {0}; > > + struct prelim_ref target = {}; > > I wonder why this initialization is a problem while there are about 20 > other uses of "{0}". The warning is about the embedded rbnode, but why > does a more recent compiler not warn about that? Is this a missing fix > from the one you use? > > I don't mind fixing compiler warnings as long as it bothers enough > people, eg. we have fixes reported by gcc 7 but I'm hesitant to fix > anything older without a good reason. This seems to be the bug report https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 "Bug 53119 - -Wmissing-braces wrongly warns about universal zero initializer {0} "