Skip to content

Commit

Permalink
md/raid6: eliminate BUG_ON with side effect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Williams committed Sep 16, 2009
1 parent 084dac5 commit 2d6e4ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -3214,8 +3214,10 @@ static bool handle_stripe6(struct stripe_head *sh)
/* now count some things */
if (test_bit(R5_LOCKED, &dev->flags)) s.locked++;
if (test_bit(R5_UPTODATE, &dev->flags)) s.uptodate++;
if (test_bit(R5_Wantcompute, &dev->flags))
BUG_ON(++s.compute > 2);
if (test_bit(R5_Wantcompute, &dev->flags)) {
s.compute++;
BUG_ON(s.compute > 2);
}

if (test_bit(R5_Wantfill, &dev->flags)) {
s.to_fill++;
Expand Down

0 comments on commit 2d6e4ec

Please sign in to comment.