Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: lustre: Move assignments out of function calls.

Assignments inside of function calls confuse the reader and should be
avoided, so it was moved out before the call.

Found with Coccinelle, semantic patch:
@@
identifier f;
expression e1, e2;
assignment operator a;
@@

+ e1 a e2;
f(...,
- (e1 a e2)
+ e1
,...);

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Elise Lennion and committed by
Greg Kroah-Hartman
a6ec5bb8 f99e73a5

+2 -1
+2 -1
drivers/staging/lustre/lustre/llite/vvp_io.c
··· 450 450 struct vvp_io *vio = cl2vvp_io(env, ios); 451 451 CLOBINVRNT(env, obj, vvp_object_invariant(obj)); 452 452 453 - iov_iter_reexpand(vio->vui_iter, vio->vui_tot_count -= nob); 453 + vio->vui_tot_count -= nob; 454 + iov_iter_reexpand(vio->vui_iter, vio->vui_tot_count); 454 455 } 455 456 456 457 static void vvp_io_update_iov(const struct lu_env *env,