summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-09-16 12:11:54 -0700
committerDan Williams <dan.j.williams@intel.com>2009-09-16 12:11:54 -0700
commit2d6e4ecc87d20299bcb249dd62efbd73496744c3 (patch)
tree943c2a81e5a7996129978169c2f431b3b0c9f282 /drivers/md
parent084dac53adcfb910792a66bc0bae720cdde971de (diff)
downloadlinux-2d6e4ecc87d20299bcb249dd62efbd73496744c3.tar.bz2
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c6
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)
/* 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++;