Linux Kernels

Staging: lustre: lov: Pull assignments out of function call

This change “Staging: lustre: lov: Pull assignments out of function call” (commit 496baea) in Linux kernel is authored by Bhumika Goyal <bhumirks [at] gmail.com> on Wed Feb 17 01:01:58 2016 +0530.

Description of "Staging: lustre: lov: Pull assignments out of function call"

The change “Staging: lustre: lov: Pull assignments out of function call” introduces changes as follows.

Staging: lustre: lov: Pull assignments out of function call

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>

Linux kernel releases containing commit 496baea

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "Staging: lustre: lov: Pull assignments out of function call"

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/staging/lustre/lustre/lov/lov_merge.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
 
diff --git a/drivers/staging/lustre/lustre/lov/lov_merge.c b/drivers/staging/lustre/lustre/lov/lov_merge.c
index 97115bec7cca..029cd4d62796 100644
--- a/drivers/staging/lustre/lustre/lov/lov_merge.c
+++ b/drivers/staging/lustre/lustre/lov/lov_merge.c
@@ -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;
 	}

The commit for this change in Linux stable tree is 496baea (patch).

Last modified: 2020/01/11 09:41