linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pujin Shi <shipujin.t@gmail.com>
To: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>
Cc: Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	hankinsea@gmail.com, Pujin Shi <shipujin.t@gmail.com>
Subject: [PATCH] fs: tree-checker: fix missing brace warning for old compilers
Date: Sat,  3 Oct 2020 08:11:51 +0800	[thread overview]
Message-ID: <20201003001151.1306-1-shipujin.t@gmail.com> (raw)

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 <shipujin.t@gmail.com>
---
 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;
-- 
2.18.1


             reply	other threads:[~2020-10-03  0:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03  0:11 Pujin Shi [this message]
2020-10-03  1:04 ` [PATCH] fs: tree-checker: fix missing brace warning for old compilers Su Yue
2020-10-03  8:04 ` Nikolay Borisov

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=20201003001151.1306-1-shipujin.t@gmail.com \
    --to=shipujin.t@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hankinsea@gmail.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).