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/extent_io.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/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index a93bab452183..fb782ed62426 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -1739,10 +1739,8 @@ u64 count_range_bits(struct extent_io_tree *tree, | |||
1739 | u64 last = 0; | 1739 | u64 last = 0; |
1740 | int found = 0; | 1740 | int found = 0; |
1741 | 1741 | ||
1742 | if (search_end <= cur_start) { | 1742 | if (WARN_ON(search_end <= cur_start)) |
1743 | WARN_ON(1); | ||
1744 | return 0; | 1743 | return 0; |
1745 | } | ||
1746 | 1744 | ||
1747 | spin_lock(&tree->lock); | 1745 | spin_lock(&tree->lock); |
1748 | if (cur_start == 0 && bits == EXTENT_DIRTY) { | 1746 | if (cur_start == 0 && bits == EXTENT_DIRTY) { |
@@ -3568,9 +3566,8 @@ retry: | |||
3568 | * but no sense in crashing the users box for something | 3566 | * but no sense in crashing the users box for something |
3569 | * we can survive anyway. | 3567 | * we can survive anyway. |
3570 | */ | 3568 | */ |
3571 | if (!eb) { | 3569 | if (WARN_ON(!eb)) { |
3572 | spin_unlock(&mapping->private_lock); | 3570 | spin_unlock(&mapping->private_lock); |
3573 | WARN_ON(1); | ||
3574 | continue; | 3571 | continue; |
3575 | } | 3572 | } |
3576 | 3573 | ||