btrfs-progs: image: fix compiler warning
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>
Wed, 5 Oct 2016 08:07:48 +0000 (17:07 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Oct 2016 12:58:19 +0000 (14:58 +0200)
In v4.8-rc1, gcc 5.3.1 gives following warning. Fixed it.

    [CC]     btrfs-image.o
btrfs-image.c: In function 'flush_pending':
btrfs-image.c:708:17: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
  header->bytenr = cpu_to_le64(start);
                 ^
btrfs-image.c:927:6: note: 'start' was declared here
  u64 start;
      ^

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-image.c

index 8781b9e..0b915c6 100644 (file)
@@ -924,7 +924,7 @@ static int flush_pending(struct metadump_struct *md, int done)
        struct async_work *async = NULL;
        struct extent_buffer *eb;
        u64 blocksize = md->root->nodesize;
-       u64 start;
+       u64 start = 0;
        u64 size;
        size_t offset;
        int ret = 0;