Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1889844pxk; Sat, 3 Oct 2020 01:08:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgeYFabFRkSe48BGgShF1QCC0YA/FCfytLlLgPqIstJIKdJ5ZR40Ap2izgau0aZbDQXSxd X-Received: by 2002:a17:906:3e48:: with SMTP id t8mr5583784eji.104.1601712484935; Sat, 03 Oct 2020 01:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601712484; cv=none; d=google.com; s=arc-20160816; b=QzjDpn3Z0cLL/R2HOL/Hp5WlU4jtzG2HQrldeeSntqM9q6zYUElWmJNYAWFvAd7JRY sCsC59guAEUo7fbpDIRcafmpHjGIaiQ9G850vF2HDazxOe1eLpXN0mxS8ctxFsxTNI+0 1kV671BLDztJng01ohhn6kkvz2KSmDfozN3ric6DH6ycEWGjsV5mEgFWFfQeLQYWBJQ/ GDvizyAUvKo6vGb25KIUiqGcXqO9649i6ITGLp//UdaJ1oyvZD7KPMJ3CnTxx7a8kbjr K9hbh1mKOahUeKbF6dzSBW+DRIjA4eA2Tin+nIBLh9uFIueiXRfHQ0YE+BxQ/s2ysl42 5LsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:dkim-signature; bh=Sf4LuO79pJtn1h8GcldPVEayw9DaZgt5IWpkc17EoAI=; b=Eygtf4DHm83CZS8DskOANDO0HEsuhqD3Xrh8CoSwviBWJTk/u0pRTTm8yhcZ8c71sB 7w7sq/LzLHWJtVvZ3m9BEicbc/7ex3bDpH7brG/6XPzjbM28gyexo0JDUnhksAcRPqbt KwJ11c+Yc7NpzJkNpwW0qZ7QU9ybhIDNHrcAFBWFl7Z7WHPLREU0DUv08ToRsBWNddLC 7RkUFOYU9ljXemaKRejmHcoa7b28UWIErwqQJntBKxjnvN0BzJmyC7rA1Gh2sC46SwHV vpItZzOFaQxyMB+XkN0Cj8jQOE358jZpnc+Rp8dyrGkEv9Wfv2LAtrXy3LkDhRDMi/zL APNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ApHVckZk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si2938543edk.57.2020.10.03.01.07.41; Sat, 03 Oct 2020 01:08:04 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b=ApHVckZk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725768AbgJCIEe (ORCPT + 99 others); Sat, 3 Oct 2020 04:04:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:39810 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgJCIEe (ORCPT ); Sat, 3 Oct 2020 04:04:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1601712272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Sf4LuO79pJtn1h8GcldPVEayw9DaZgt5IWpkc17EoAI=; b=ApHVckZk+6W7nGlUuD18Bzex5yiJL10vcRoz1kk0UyVJg6lx+jo5dpjWJOs5Lhry43Nz9D UowFTX0hgqBd12z3bBP/sAbwEWHVDXX/0iJoqA/ClRoh72kT385cZYUADXIkaldN54Q72b b0/6LMErFaxjRFYCDKbQtWDRhKYnVRU= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E6C26AC8B; Sat, 3 Oct 2020 08:04:31 +0000 (UTC) Subject: Re: [PATCH] fs: tree-checker: fix missing brace warning for old compilers To: Pujin Shi , Chris Mason , Josef Bacik , David Sterba Cc: Qu Wenruo , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, hankinsea@gmail.com References: <20201003001151.1306-1-shipujin.t@gmail.com> From: Nikolay Borisov Autocrypt: addr=nborisov@suse.com; prefer-encrypt=mutual; keydata= xsFNBFiKBz4BEADNHZmqwhuN6EAzXj9SpPpH/nSSP8YgfwoOqwrP+JR4pIqRK0AWWeWCSwmZ T7g+RbfPFlmQp+EwFWOtABXlKC54zgSf+uulGwx5JAUFVUIRBmnHOYi/lUiE0yhpnb1KCA7f u/W+DkwGerXqhhe9TvQoGwgCKNfzFPZoM+gZrm+kWv03QLUCr210n4cwaCPJ0Nr9Z3c582xc bCUVbsjt7BN0CFa2BByulrx5xD9sDAYIqfLCcZetAqsTRGxM7LD0kh5WlKzOeAXj5r8DOrU2 GdZS33uKZI/kZJZVytSmZpswDsKhnGzRN1BANGP8sC+WD4eRXajOmNh2HL4P+meO1TlM3GLl EQd2shHFY0qjEo7wxKZI1RyZZ5AgJnSmehrPCyuIyVY210CbMaIKHUIsTqRgY5GaNME24w7h TyyVCy2qAM8fLJ4Vw5bycM/u5xfWm7gyTb9V1TkZ3o1MTrEsrcqFiRrBY94Rs0oQkZvunqia c+NprYSaOG1Cta14o94eMH271Kka/reEwSZkC7T+o9hZ4zi2CcLcY0DXj0qdId7vUKSJjEep c++s8ncFekh1MPhkOgNj8pk17OA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Wr9zRl06waOCkgrQbTPp631hToxo+4rA1jiQF2M80HAet65ytBVR2pFGZF zGYYLqiG+mpUZ+FPjxk9kpkRYz61mTLSY7tuFljExfJWMGfgSg1OxfLV631jV1TcdUnx+h3l Sqs2vMhAVt14zT8mpIuu2VNxcontxgVr1kzYA/tQg32fVRbGr449j1gw57BV9i0vww== Message-ID: Date: Sat, 3 Oct 2020 11:04:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201003001151.1306-1-shipujin.t@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3.10.20 г. 3:11 ч., Pujin Shi wrote: > For older versions of gcc, the array = {0}; will cause warnings: > > fs/btrfs/tree-checker.c: In function 'check_root_item': > fs/btrfs/tree-checker.c:1038:9: warning: missing braces around initializer [-Wmissing-braces] > struct btrfs_root_item ri = { 0 }; > ^ > fs/btrfs/tree-checker.c:1038:9: warning: (near initialization for 'ri.inode') [-Wmissing-braces] > > 1 warnings generated > > Fixes: 443b313c7ff8 ("btrfs: tree-checker: fix false alert caused by legacy btrfs root item") > Signed-off-by: Pujin Shi This is a compiler artifact, please see: http://www.ex-parrot.com/~chris/random/initialise.html ALso having an empty initialization list like = {} while valid for gcc is actually invalid according to the official standard. Check ISO C Standard section 6.7.9 for the correct syntax of initializer-list. IOW - NAK. > --- > fs/btrfs/tree-checker.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c > index f0ffd5ee77bd..5028b3af308c 100644 > --- a/fs/btrfs/tree-checker.c > +++ b/fs/btrfs/tree-checker.c > @@ -1035,7 +1035,7 @@ static int check_root_item(struct extent_buffer *leaf, struct btrfs_key *key, > int slot) > { > struct btrfs_fs_info *fs_info = leaf->fs_info; > - struct btrfs_root_item ri = { 0 }; > + struct btrfs_root_item ri = {}; > const u64 valid_root_flags = BTRFS_ROOT_SUBVOL_RDONLY | > BTRFS_ROOT_SUBVOL_DEAD; > int ret; >