diff options
author | Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com> | 2013-10-31 01:00:08 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 22:11:53 -0500 |
commit | fae7f21cece9a4c181a8d8131870c7247e153f65 (patch) | |
tree | d2c8052ead139f3e4bb4cb13c44dd59f32184d63 /fs/btrfs/check-integrity.c | |
parent | b19e684393752ec129a36924e6c270daf79676d6 (diff) |
btrfs: Use WARN_ON()'s return value in place of WARN_ON(1)
Use WARN_ON()'s return value in place of WARN_ON(1) for cleaner source
code that outputs a more descriptive warnings. Also fix the styling
warning of redundant braces that came up as a result of this fix.
Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
Reviewed-by: Zach Brown <zab@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/check-integrity.c')
-rw-r--r-- | fs/btrfs/check-integrity.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 656b07637e39..e0aab4456974 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c | |||
@@ -2464,10 +2464,8 @@ static int btrfsic_process_written_superblock( | |||
2464 | } | 2464 | } |
2465 | } | 2465 | } |
2466 | 2466 | ||
2467 | if (-1 == btrfsic_check_all_ref_blocks(state, superblock, 0)) { | 2467 | if (WARN_ON(-1 == btrfsic_check_all_ref_blocks(state, superblock, 0))) |
2468 | WARN_ON(1); | ||
2469 | btrfsic_dump_tree(state); | 2468 | btrfsic_dump_tree(state); |
2470 | } | ||
2471 | 2469 | ||
2472 | return 0; | 2470 | return 0; |
2473 | } | 2471 | } |
@@ -2907,7 +2905,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state, | |||
2907 | btrfsic_release_block_ctx(&block_ctx); | 2905 | btrfsic_release_block_ctx(&block_ctx); |
2908 | } | 2906 | } |
2909 | 2907 | ||
2910 | if (!match) { | 2908 | if (WARN_ON(!match)) { |
2911 | printk(KERN_INFO "btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio," | 2909 | printk(KERN_INFO "btrfs: attempt to write M-block which contains logical bytenr that doesn't map to dev+physical bytenr of submit_bio," |
2912 | " buffer->log_bytenr=%llu, submit_bio(bdev=%s," | 2910 | " buffer->log_bytenr=%llu, submit_bio(bdev=%s," |
2913 | " phys_bytenr=%llu)!\n", | 2911 | " phys_bytenr=%llu)!\n", |
@@ -2924,7 +2922,6 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state, | |||
2924 | bytenr, block_ctx.dev->name, | 2922 | bytenr, block_ctx.dev->name, |
2925 | block_ctx.dev_bytenr, mirror_num); | 2923 | block_ctx.dev_bytenr, mirror_num); |
2926 | } | 2924 | } |
2927 | WARN_ON(1); | ||
2928 | } | 2925 | } |
2929 | } | 2926 | } |
2930 | 2927 | ||