Staging: lustre: lov: Pull assignments out of function call
PATCH 1/1 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,...);
--- drivers/staging/lustre/lustre/lov/lov_merge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/lustre/lustre/lov/lov_merge.c +2 -1
@@ -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 ; }
Signature · 1 line
1.9.1
Quoted 7 lines · Bhumika Goyal
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,...);
The script looks fine now.
julia
Quoted 30 lines
Signed-off-by Bhumika Goyal <[email protected]>--- drivers/staging/lustre/lustre/lov/lov_merge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/lustre/lustre/lov/lov_merge.c +2
-2@@ -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 ; } --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1455651118-18615-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 10 lines · Julia Lawall
Quoted 7 lines · Bhumika Goyal
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,...);
Quoted 4 lines
The script looks fine now.
julia
Thanks for the input Julia.
Bhumika
Quoted 30 lines
Quoted 30 lines
Signed-off-by Bhumika Goyal <[email protected]>--- drivers/staging/lustre/lustre/lov/lov_merge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/lustre/lustre/lov/lov_merge.c +2
-2@@ -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 ; } --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1455651118-18615-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.