]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix gcc-4.8 build warning for struct initializer
authorArnd Bergmann <arnd@arndb.de>
Wed, 29 Apr 2020 13:27:32 +0000 (15:27 +0200)
committerDavid Sterba <dsterba@suse.com>
Thu, 30 Apr 2020 10:17:49 +0000 (12:17 +0200)
commit9c8ad87f78923b962b259aef2f50a48449b1b6f3
tree7c03bcb38bea0b59c54d89fe7976bc654ca895d4
parent4dcd66564e1d60f5a5b5e8a22754099954cd78d8
btrfs: fix gcc-4.8 build warning for struct initializer

Some older compilers like gcc-4.8 warn about mismatched curly braces in
a initializer:

fs/btrfs/backref.c: In function 'is_shared_data_backref':
fs/btrfs/backref.c:394:9: error: missing braces around
initializer [-Werror=missing-braces]
  struct prelim_ref target = {0};
         ^
fs/btrfs/backref.c:394:9: error: (near initialization for
'target.rbnode') [-Werror=missing-braces]

Use the GNU empty initializer extension to avoid this.

Fixes: 6bc741fe37a4 ("btrfs: backref, don't add refs from shared block when resolving normal backref")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/backref.c