Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp592593ybz; Wed, 15 Apr 2020 14:44:18 -0700 (PDT) X-Google-Smtp-Source: APiQypIaYhRt2nQ/OMP/pd23bs/opj4M9cUO0SWlRwy0v6X+w78Kxl2qO0Ii9vu9nD1rF3zrThle X-Received: by 2002:a17:906:4003:: with SMTP id v3mr6904177ejj.144.1586987058702; Wed, 15 Apr 2020 14:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586987058; cv=none; d=google.com; s=arc-20160816; b=ZdHjZ7/L6rNJ/WafDFFHJM8jDNlv0hbCTFl9k8g5R0ePH5KRYJPOnFH6OENYZ4P2+E kXsJqlH06pFlBE0Mai2qphLGZe+SDAtZ1bUNtMuTKt46XkvEI4k8Sb8WZtc/MMKZNl4y Znl/sJeZD1yi1puApprAGWpKqeysr+jqqwgwnRQIwrpfyRgS0UpVPDdzZnDAzJ1sSVZM u1WP+A1D+JxUZDBGNG5ABNp9cAyrJ34SdzUcmZvIcaEIaZnFKMAApzHt9gy1wDmUMqqL qNn1hCP5WqsLmZWqyK9WK9XqYDDF8N7ZNfFc+TLhtLf2CbBvGbQwfmeJ+X/KsLjStsde G4BA== 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:cc:to:from :date; bh=tyh8OOrc1iCY7Jqc55HGpQGg3tdKAwpaZ8NjEpIZePk=; b=zFz/30u1MqPuhq2azoNqdxj/uLHJSFEqFm8oMPFpdkHrGPZV51Ifiaz8GVMhDkrlJJ COTqyvV0fkNWZUY6q+uNtYg0MRoLK2uvwsCNKQEFLl73wl1AOgj+hcWgahJC3ofWsoYC 0DtVbnGt1jafDek2YxzlgIdDiUZ3hnFlV2L3nvQ0veSjOuXBfnLSiuXtPe0V/VsRXX9t xVrbLemkv055zFmitGwFJgtcNzVjp9x9p5RLweoG0iNLm2KbUXrdfM0IuY2tFiK2TeaE kSTJjfteEWsGIqiY7ZQyF3QfbWZgSvznXgAS05ZNsM0HxZwUH7WlDyLufGodR7WyNYIx eXWQ== 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 v14si8407884edb.37.2020.04.15.14.43.54; Wed, 15 Apr 2020 14:44:18 -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 S2407429AbgDNPUq (ORCPT + 99 others); Tue, 14 Apr 2020 11:20:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:46424 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438742AbgDNPUN (ORCPT ); Tue, 14 Apr 2020 11:20:13 -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 73C92AC26; Tue, 14 Apr 2020 15:20:10 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 83F15DA823; Tue, 14 Apr 2020 17:19:31 +0200 (CEST) Date: Tue, 14 Apr 2020 17:19:31 +0200 From: David Sterba To: Tang Bin Cc: 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: <20200414151931.GU5920@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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200411154915.9408-1-tangbin@cmss.chinamobile.com> 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 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.