diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-09-16 15:11:54 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-09-16 15:11:54 -0400 |
commit | 2d6e4ecc87d20299bcb249dd62efbd73496744c3 (patch) | |
tree | 943c2a81e5a7996129978169c2f431b3b0c9f282 | |
parent | 084dac53adcfb910792a66bc0bae720cdde971de (diff) |
md/raid6: eliminate BUG_ON with side effect
As pointed out by Neil it should be possible to build a driver with all
BUG_ON statements deleted. It's bad form to have a BUG_ON with a side
effect.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/md/raid5.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 9b00a229015a..0a5f03d93aef 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3214,8 +3214,10 @@ static bool handle_stripe6(struct stripe_head *sh) | |||
3214 | /* now count some things */ | 3214 | /* now count some things */ |
3215 | if (test_bit(R5_LOCKED, &dev->flags)) s.locked++; | 3215 | if (test_bit(R5_LOCKED, &dev->flags)) s.locked++; |
3216 | if (test_bit(R5_UPTODATE, &dev->flags)) s.uptodate++; | 3216 | if (test_bit(R5_UPTODATE, &dev->flags)) s.uptodate++; |
3217 | if (test_bit(R5_Wantcompute, &dev->flags)) | 3217 | if (test_bit(R5_Wantcompute, &dev->flags)) { |
3218 | BUG_ON(++s.compute > 2); | 3218 | s.compute++; |
3219 | BUG_ON(s.compute > 2); | ||
3220 | } | ||
3219 | 3221 | ||
3220 | if (test_bit(R5_Wantfill, &dev->flags)) { | 3222 | if (test_bit(R5_Wantfill, &dev->flags)) { |
3221 | s.to_fill++; | 3223 | s.to_fill++; |