diff options
author | NeilBrown <neilb@suse.com> | 2018-02-21 07:42:20 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-22 15:06:36 +0100 |
commit | 9ee15880018008194c6187d0fda99dc059c41d51 (patch) | |
tree | 7e8c8e71d91e9a0cb4fd967840c477a74ddbd14c /drivers/staging/lustre/lustre/mdc/mdc_request.c | |
parent | d0efa68ae779c4dcc62cd03937b09c4d9d460314 (diff) | |
download | op-kernel-dev-9ee15880018008194c6187d0fda99dc059c41d51.zip op-kernel-dev-9ee15880018008194c6187d0fda99dc059c41d51.tar.gz |
staging: lustre: fix assorted checkpatch errors
Possibly the most interesting is the for-loop with no body.
Rearranging and initializing end_dirent on each iteration of
the outer while, makes the intent clearer.
Reviewed-by: "Eremin, Dmitry" <dmitry.eremin@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/mdc/mdc_request.c')
-rw-r--r-- | drivers/staging/lustre/lustre/mdc/mdc_request.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index ab48746..3b1c8e5 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -1055,13 +1055,14 @@ static void mdc_adjust_dirpages(struct page **pages, int cfs_pgs, int lu_pgs) __u64 hash_end = le64_to_cpu(dp->ldp_hash_end); __u32 flags = le32_to_cpu(dp->ldp_flags); struct lu_dirpage *first = dp; - struct lu_dirent *end_dirent = NULL; - struct lu_dirent *ent; while (--lu_pgs > 0) { - ent = lu_dirent_start(dp); - for (end_dirent = ent; ent; - end_dirent = ent, ent = lu_dirent_next(ent)); + struct lu_dirent *end_dirent = NULL; + struct lu_dirent *ent; + + for (ent = lu_dirent_start(dp); ent; + ent = lu_dirent_next(ent)) + end_dirent = ent; /* Advance dp to next lu_dirpage. */ dp = (struct lu_dirpage *)((char *)dp + LU_PAGE_SIZE); |