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/volumes.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/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 716abee16a5b..3c16da51348f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2552,8 +2552,7 @@ again: | |||
2552 | failed = 0; | 2552 | failed = 0; |
2553 | retried = true; | 2553 | retried = true; |
2554 | goto again; | 2554 | goto again; |
2555 | } else if (failed && retried) { | 2555 | } else if (WARN_ON(failed && retried)) { |
2556 | WARN_ON(1); | ||
2557 | ret = -ENOSPC; | 2556 | ret = -ENOSPC; |
2558 | } | 2557 | } |
2559 | error: | 2558 | error: |
@@ -5402,10 +5401,8 @@ static int bio_size_ok(struct block_device *bdev, struct bio *bio, | |||
5402 | .bi_rw = bio->bi_rw, | 5401 | .bi_rw = bio->bi_rw, |
5403 | }; | 5402 | }; |
5404 | 5403 | ||
5405 | if (bio->bi_vcnt == 0) { | 5404 | if (WARN_ON(bio->bi_vcnt == 0)) |
5406 | WARN_ON(1); | ||
5407 | return 1; | 5405 | return 1; |
5408 | } | ||
5409 | 5406 | ||
5410 | prev = &bio->bi_io_vec[bio->bi_vcnt - 1]; | 5407 | prev = &bio->bi_io_vec[bio->bi_vcnt - 1]; |
5411 | if (bio_sectors(bio) > max_sectors) | 5408 | if (bio_sectors(bio) > max_sectors) |
@@ -5638,10 +5635,8 @@ struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info, | |||
5638 | struct btrfs_device *dev; | 5635 | struct btrfs_device *dev; |
5639 | u64 tmp; | 5636 | u64 tmp; |
5640 | 5637 | ||
5641 | if (!devid && !fs_info) { | 5638 | if (WARN_ON(!devid && !fs_info)) |
5642 | WARN_ON(1); | ||
5643 | return ERR_PTR(-EINVAL); | 5639 | return ERR_PTR(-EINVAL); |
5644 | } | ||
5645 | 5640 | ||
5646 | dev = __alloc_device(); | 5641 | dev = __alloc_device(); |
5647 | if (IS_ERR(dev)) | 5642 | if (IS_ERR(dev)) |