Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1726754pxk; Fri, 2 Oct 2020 18:13:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNsS+iRfsybMAcxuXw9VRMYWYdx9chY7QeLR2KDKJiB4mG+yhv8w0BL4Yy/mltJ9aZQabb X-Received: by 2002:a17:906:649a:: with SMTP id e26mr4930908ejm.415.1601687604074; Fri, 02 Oct 2020 18:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601687604; cv=none; d=google.com; s=arc-20160816; b=sBflBCnIKN3o9rYNI0Sod+ZMpsZb6l+FfFxxsBIfTirQca1ut4d8PZXAYL9GdVqBnS diybwcmWuDuV7mRUla6hjAwgOwvsQWOO/hd2JPziTm85nm8ksUT3PCfp6twArjbMFrAj ZfI3d1c8590cI/y7SzNktc8AKi9PknfofSp1rcn+FwdsbPbCepgcFId6tkYjzqsZWtn3 gf89+Sgjqq3KhAcZosMX0kzG3YpUS8XxO5wxkvJxmEsVxUmfdfeXYa06Fz/iFGmkqJD2 oGYllYqaHabWr9KfuwZyG3DcPxqKk5dSjkClqKsiS94oqre0yAYiq2SJ67Z+1U8yo9Vi dDQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:date:message-id:in-reply-to:subject :cc:to:from:user-agent:references:dkim-signature; bh=tbbZytiu7naNND6MjHPGRcOXuaeWZhKhG7e6x8013sU=; b=NEqRtxpxRqDXM5rHwI6cDV5WvlYS001BT3yq7HhbnzpmgH2/9/belW6QFsCykJXoRF KCK8GnEtQ+kpJ5bLY48gpkefS6W7HbywpFBlNjoM9A8gaQUlyrCuw3IkAWQS504Mo3vS 6O4znKM6yFOYPYWbr8o/6dCF3zHrVVqGutn2YQpfsFdrP9D3Vpn2KjM8yXPodvZ8c8Ep GDOuLeh2MZHsOyW5hZ3St1cm/TmyrtKksbrwfsqQR4mp1K1E9FOdm2De3VSo/mkj+dp5 9jXfw+wq8FupXigGtMJ4JHfA9WzXb9E6cEN59IkQQHpRGoT/HSA8EgTgbi8hYvucCwv4 lT9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inbox.eu header.s=20140211 header.b=lKHqTME3; 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 ay1si2338732edb.3.2020.10.02.18.12.58; Fri, 02 Oct 2020 18:13:24 -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=@inbox.eu header.s=20140211 header.b=lKHqTME3; 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 S1725601AbgJCBLY (ORCPT + 99 others); Fri, 2 Oct 2020 21:11:24 -0400 Received: from eu-shark1.inbox.eu ([195.216.236.81]:42142 "EHLO eu-shark1.inbox.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725379AbgJCBLY (ORCPT ); Fri, 2 Oct 2020 21:11:24 -0400 X-Greylist: delayed 395 seconds by postgrey-1.27 at vger.kernel.org; Fri, 02 Oct 2020 21:11:23 EDT Received: from eu-shark1.inbox.eu (localhost [127.0.0.1]) by eu-shark1-out.inbox.eu (Postfix) with ESMTP id 1274F6C00736; Sat, 3 Oct 2020 04:04:47 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=inbox.eu; s=20140211; t=1601687087; bh=rP1SpII8IfYLyn/Duc/a2Uv9a8cxe5kZgqutMyfoNp4=; h=References:From:To:Cc:Subject:In-reply-to:Date; b=lKHqTME3BKFdahpEWa9pHuudtFTOkciYRzgTKZPCThpMTMGxidgUt687HYEZHeO3N Z9MIOmSYChUOJitm1C6WWDlbK1FFJ1QHe7E0eOGwT38ePlFQzgS0UeDb5HK0XiHNQZ WCqVwd1BdaUIV8DIprCxJYtqcXJ2D5QHG5CuhCzQ= Received: from localhost (localhost [127.0.0.1]) by eu-shark1-in.inbox.eu (Postfix) with ESMTP id 00CB26C0071E; Sat, 3 Oct 2020 04:04:47 +0300 (EEST) Received: from eu-shark1.inbox.eu ([127.0.0.1]) by localhost (eu-shark1.inbox.eu [127.0.0.1]) (spamfilter, port 35) with ESMTP id dsh-QdpKNSkL; Sat, 3 Oct 2020 04:04:46 +0300 (EEST) Received: from mail.inbox.eu (eu-pop1 [127.0.0.1]) by eu-shark1-in.inbox.eu (Postfix) with ESMTP id 6826A6C0071B; Sat, 3 Oct 2020 04:04:46 +0300 (EEST) Received: from nas (unknown [103.116.47.50]) (Authenticated sender: l@damenly.su) by mail.inbox.eu (Postfix) with ESMTPA id 929CF1BE00ED; Sat, 3 Oct 2020 04:04:43 +0300 (EEST) References: <20201003001151.1306-1-shipujin.t@gmail.com> User-agent: mu4e 1.4.13; emacs 27.1 From: Su Yue To: Pujin Shi Cc: Chris Mason , Josef Bacik , David Sterba , Qu Wenruo , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, hankinsea@gmail.com Subject: Re: [PATCH] fs: tree-checker: fix missing brace warning for old compilers In-reply-to: <20201003001151.1306-1-shipujin.t@gmail.com> Message-ID: Date: Sat, 03 Oct 2020 09:04:36 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Virus-Scanned: OK X-ESPOL: 6NpmlYxOGzysiV+lRWetdgtKxjYrL+Dt55TE3V0G3GeDUSOFfksTURGxg2hxU3m4og== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 03 Oct 2020 at 08:11, Pujin Shi wrote: > For older versions of gcc, the array = {0}; will cause warnings: > So what's the version number of the gcc? "struct foo = { 0 }" should be correct. May be the compiler issue[1] related? 1: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 > 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 > --- > 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;