]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: lustre: lov: Pull assignments out of function call
authorBhumika Goyal <bhumirks@gmail.com>
Tue, 16 Feb 2016 19:31:58 +0000 (01:01 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 22:38:33 +0000 (14:38 -0800)
Assignments in function call arguments are undesirable. So pull such
assignments out before function call.
Made a coccinelle script to detect such cases:
@@
expression fn,b,d;
@@
* fn(...,d=b,...);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lov/lov_merge.c

index 97115bec7ccab89174115e1ef23d4621c68f0db8..029cd4d627961ac3da30f9f7c6082cbf1483876c 100644 (file)
@@ -129,7 +129,8 @@ int lov_adjust_kms(struct obd_export *exp, struct lov_stripe_md *lsm,
                               "stripe %d KMS %sing %llu->%llu\n",
                               stripe, kms > loi->loi_kms ? "increase":"shrink",
                               loi->loi_kms, kms);
-                       loi_kms_set(loi, loi->loi_lvb.lvb_size = kms);
+                       loi->loi_lvb.lvb_size = kms;
+                       loi_kms_set(loi, loi->loi_lvb.lvb_size);
                }
                return 0;
        }