md/raid6: eliminate BUG_ON with side effect
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / md / raid5.c
index 9b00a229015a2107c004bb4f0539b195a4dae535..0a5f03d93aef34fa066a71000152932962a9a6cb 100644 (file)
@@ -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++;