From: David Sterba <dsterba@suse.cz>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix initialiser warning in fs/btrfs/tree-checker.c
Date: Mon, 20 Sep 2021 10:12:47 +0200 [thread overview]
Message-ID: <20210920081246.GX9286@twin.jikos.cz> (raw)
In-Reply-To: <E1mS5UF-002wsg-0c@rmk-PC.armlinux.org.uk>
On Sun, Sep 19, 2021 at 11:40:39PM +0100, Russell King (Oracle) wrote:
> Debian gcc 10.2.1 complains thusly:
>
> fs/btrfs/tree-checker.c:1071:9: warning: missing braces
> around initializer [-Wmissing-braces]
> struct btrfs_root_item ri = { 0 };
> ^
> fs/btrfs/tree-checker.c:1071:9: warning: (near initialization for 'ri.inode') [-Wmissing-braces]
>
> Fix it by removing the unnecessary '0' initialiser, leaving the
> braces.
>
> Fixes: 1465af12e254 ("btrfs: tree-checker: fix false alert caused by legacy btrfs root item")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> 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 a8b2e0d2c025..1737b62756a6 100644
> --- a/fs/btrfs/tree-checker.c
> +++ b/fs/btrfs/tree-checker.c
> @@ -1068,7 +1068,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 = { };
Kees Cook does a tree wide unification to { } because there are some
oddities with partial initialization and { 0 } so this will get fixed
eventually. But again the minimum gcc version is now 5.1 so it won't
matter for 4.9 anyway.
next prev parent reply other threads:[~2021-09-20 8:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-19 22:40 [PATCH] btrfs: fix initialiser warning in fs/btrfs/tree-checker.c Russell King (Oracle)
2021-09-19 22:44 ` Qu Wenruo
2021-09-19 22:46 ` Russell King (Oracle)
2021-09-19 22:50 ` Russell King (Oracle)
2021-09-19 22:57 ` Qu Wenruo
2021-09-20 8:12 ` David Sterba [this message]
2021-09-20 8:25 ` Qu Wenruo
2021-09-20 8:31 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210920081246.GX9286@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox