linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] Lustre: Multiple assignments removal.
@ 2016-06-10  2:35 Oleg Drokin
  2016-06-10  2:35 ` [PATCH 1/8] staging/lustre/osc: Fix Multiple Assignment Warnings Oleg Drokin
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List, Oleg Drokin

These patches remove multiple assignments in Lustre, that makes
checkpatch (somewhat understandably) unhappy.

Nathaniel Clark (8):
  staging/lustre/osc: Fix Multiple Assignment Warnings
  staging/lustre/fid: Fix Multiple Assignments
  staging/lustre/ldlm: Fix Multiple Assignments
  staging/lustre/llite: Fix Multiple Assignments
  staging/lustre/lov: Fix Multiple Assignments
  staging/lustre/obdclass: Fix Multiple Assignments
  staging/lustre/ptlrpc: Fix Multiple Assignments
  staging/lustre/lmv: Fix Multiple Assignments

 drivers/staging/lustre/lustre/fid/fid_request.c     |  6 ++++--
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c       |  3 ++-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c     |  8 +++++---
 drivers/staging/lustre/lustre/llite/llite_lib.c     |  3 ++-
 drivers/staging/lustre/lustre/llite/namei.c         |  3 ++-
 drivers/staging/lustre/lustre/llite/vvp_io.c        |  3 ++-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c         |  3 +--
 drivers/staging/lustre/lustre/lov/lov_obd.c         |  9 ++++-----
 drivers/staging/lustre/lustre/obdclass/llog.c       |  6 ++++--
 drivers/staging/lustre/lustre/osc/osc_cache.c       |  6 ++++--
 drivers/staging/lustre/lustre/osc/osc_io.c          | 12 ++++++++----
 drivers/staging/lustre/lustre/osc/osc_lock.c        |  3 ++-
 drivers/staging/lustre/lustre/osc/osc_request.c     |  6 ++++--
 drivers/staging/lustre/lustre/ptlrpc/client.c       |  6 ++++--
 drivers/staging/lustre/lustre/ptlrpc/import.c       |  3 ++-
 drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c |  3 ++-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c       |  3 ++-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c     |  3 ++-
 18 files changed, 56 insertions(+), 33 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/8] staging/lustre/osc: Fix Multiple Assignment Warnings
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
@ 2016-06-10  2:35 ` Oleg Drokin
  2016-06-10  2:35 ` [PATCH 2/8] staging/lustre/fid: Fix Multiple Assignments Oleg Drokin
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List,
	Nathaniel Clark, Oleg Drokin

From: Nathaniel Clark <nathaniel.l.clark@intel.com>

Fix all multiple assignments on lustre/osc directory.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/osc/osc_cache.c   |  6 ++++--
 drivers/staging/lustre/lustre/osc/osc_io.c      | 12 ++++++++----
 drivers/staging/lustre/lustre/osc/osc_lock.c    |  3 ++-
 drivers/staging/lustre/lustre/osc/osc_request.c |  6 ++++--
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 5a14bea..2ca5045 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -2773,7 +2773,8 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
 	ext->oe_sync = 1;
 	ext->oe_urgent = 1;
 	ext->oe_start = start;
-	ext->oe_end = ext->oe_max_end = end;
+	ext->oe_end = end;
+	ext->oe_max_end = end;
 	ext->oe_obj = obj;
 	ext->oe_srvlock = !!(brw_flags & OBD_BRW_SRVLOCK);
 	ext->oe_nr_pages = page_count;
@@ -3308,7 +3309,8 @@ int osc_lock_discard_pages(const struct lu_env *env, struct osc_object *osc,
 		goto out;
 
 	cb = mode == CLM_READ ? check_and_discard_cb : discard_cb;
-	info->oti_fn_index = info->oti_next_index = start;
+	info->oti_fn_index = start;
+	info->oti_next_index = start;
 	do {
 		res = osc_page_gang_lookup(env, io, osc,
 					   info->oti_next_index, end, cb, osc);
diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c
index d534b0e..d3bce45 100644
--- a/drivers/staging/lustre/lustre/osc/osc_io.c
+++ b/drivers/staging/lustre/lustre/osc/osc_io.c
@@ -221,7 +221,8 @@ static void osc_page_touch_at(const struct lu_env *env,
 	       kms > loi->loi_kms ? "" : "not ", loi->loi_kms, kms,
 	       loi->loi_lvb.lvb_size);
 
-	attr->cat_mtime = attr->cat_ctime = LTIME_S(CURRENT_TIME);
+	attr->cat_ctime = LTIME_S(CURRENT_TIME);
+	attr->cat_mtime = attr->cat_ctime;
 	valid = CAT_MTIME | CAT_CTIME;
 	if (kms > loi->loi_kms) {
 		attr->cat_kms = kms;
@@ -458,7 +459,8 @@ static int osc_io_setattr_start(const struct lu_env *env,
 			unsigned int cl_valid = 0;
 
 			if (ia_valid & ATTR_SIZE) {
-				attr->cat_size = attr->cat_kms = size;
+				attr->cat_size = size;
+				attr->cat_kms = size;
 				cl_valid = CAT_SIZE | CAT_KMS;
 			}
 			if (ia_valid & ATTR_MTIME_SET) {
@@ -526,7 +528,8 @@ static void osc_io_setattr_end(const struct lu_env *env,
 
 	if (cbargs->opc_rpc_sent) {
 		wait_for_completion(&cbargs->opc_sync);
-		result = io->ci_result = cbargs->opc_rc;
+		result = cbargs->opc_rc;
+		io->ci_result = cbargs->opc_rc;
 	}
 	if (result == 0) {
 		if (oio->oi_lockless) {
@@ -575,7 +578,8 @@ static int osc_io_write_start(const struct lu_env *env,
 
 	OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1);
 	cl_object_attr_lock(obj);
-	attr->cat_mtime = attr->cat_ctime = ktime_get_real_seconds();
+	attr->cat_ctime = ktime_get_real_seconds();
+	attr->cat_mtime = attr->cat_ctime;
 	rc = cl_object_attr_set(env, obj, attr, CAT_MTIME | CAT_CTIME);
 	cl_object_attr_unlock(obj);
 
diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c
index 16f9cd9..d30ed2f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_lock.c
+++ b/drivers/staging/lustre/lustre/osc/osc_lock.c
@@ -1120,7 +1120,8 @@ static void osc_lock_set_writer(const struct lu_env *env,
 		}
 	} else {
 		LASSERT(cl_io_is_mkwrite(io));
-		io_start = io_end = io->u.ci_fault.ft_index;
+		io_start = io->u.ci_fault.ft_index;
+		io_end = io->u.ci_fault.ft_index;
 	}
 
 	if (descr->cld_mode >= CLM_WRITE &&
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c
index 47417f8..7b1fc7e 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -474,7 +474,8 @@ static int osc_real_create(struct obd_export *exp, struct obdo *oa,
 		DEBUG_REQ(D_HA, req,
 			  "delorphan from OST integration");
 		/* Don't resend the delorphan req */
-		req->rq_no_resend = req->rq_no_delay = 1;
+		req->rq_no_resend = 1;
+		req->rq_no_delay = 1;
 	}
 
 	rc = ptlrpc_queue_wait(req);
@@ -2775,7 +2776,8 @@ static int osc_get_info(const struct lu_env *env, struct obd_export *exp,
 		tmp = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY);
 		memcpy(tmp, key, keylen);
 
-		req->rq_no_delay = req->rq_no_resend = 1;
+		req->rq_no_delay = 1;
+		req->rq_no_resend = 1;
 		ptlrpc_request_set_replen(req);
 		rc = ptlrpc_queue_wait(req);
 		if (rc)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/8] staging/lustre/fid: Fix Multiple Assignments
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
  2016-06-10  2:35 ` [PATCH 1/8] staging/lustre/osc: Fix Multiple Assignment Warnings Oleg Drokin
@ 2016-06-10  2:35 ` Oleg Drokin
  2016-06-10  2:35 ` [PATCH 3/8] staging/lustre/ldlm: " Oleg Drokin
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List,
	Nathaniel Clark, Oleg Drokin

From: Nathaniel Clark <nathaniel.l.clark@intel.com>

Fix all multiple assignments on lustre/fid directory.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/fid/fid_request.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c
index 3a4df62..9db21ba 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -98,8 +98,10 @@ static int seq_client_rpc(struct lu_client_seq *seq,
 		 * request here, otherwise if MDT0 is failed(umounted),
 		 * it can not release the export of MDT0
 		 */
-		if (seq->lcs_type == LUSTRE_SEQ_DATA)
-			req->rq_no_delay = req->rq_no_resend = 1;
+		if (seq->lcs_type == LUSTRE_SEQ_DATA) {
+			req->rq_no_delay = 1;
+			req->rq_no_resend = 1;
+		}
 		debug_mask = D_CONSOLE;
 	} else {
 		if (seq->lcs_type == LUSTRE_SEQ_METADATA) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/8] staging/lustre/ldlm: Fix Multiple Assignments
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
  2016-06-10  2:35 ` [PATCH 1/8] staging/lustre/osc: Fix Multiple Assignment Warnings Oleg Drokin
  2016-06-10  2:35 ` [PATCH 2/8] staging/lustre/fid: Fix Multiple Assignments Oleg Drokin
@ 2016-06-10  2:35 ` Oleg Drokin
  2016-06-10  2:35 ` [PATCH 4/8] staging/lustre/llite: " Oleg Drokin
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List,
	Nathaniel Clark, Oleg Drokin

From: Nathaniel Clark <nathaniel.l.clark@intel.com>

Fix all multiple assignments on lustre/ldlm directory.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c   | 3 ++-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index b4ffbe2..b6a90b0 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -345,7 +345,8 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
 	 * Set cl_chksum* to CRC32 for now to avoid returning screwed info
 	 * through procfs.
 	 */
-	cli->cl_cksum_type = cli->cl_supp_cksum_types = OBD_CKSUM_CRC32;
+	cli->cl_cksum_type = OBD_CKSUM_CRC32;
+	cli->cl_supp_cksum_types = OBD_CKSUM_CRC32;
 	atomic_set(&cli->cl_resends, OSC_DEFAULT_RESENDS);
 
 	/* This value may be reduced at connect time in
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index ab739f0..3303ffa 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -1011,9 +1011,11 @@ static int ldlm_setup(void)
 		blp->blp_min_threads = LDLM_NTHRS_INIT;
 		blp->blp_max_threads = LDLM_NTHRS_MAX;
 	} else {
-		blp->blp_min_threads = blp->blp_max_threads =
-			min_t(int, LDLM_NTHRS_MAX, max_t(int, LDLM_NTHRS_INIT,
-							 ldlm_num_threads));
+		blp->blp_min_threads = min_t(int, LDLM_NTHRS_MAX,
+					     max_t(int, LDLM_NTHRS_INIT,
+						   ldlm_num_threads));
+
+		blp->blp_max_threads = blp->blp_min_threads;
 	}
 
 	for (i = 0; i < blp->blp_min_threads; i++) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/8] staging/lustre/llite: Fix Multiple Assignments
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
                   ` (2 preceding siblings ...)
  2016-06-10  2:35 ` [PATCH 3/8] staging/lustre/ldlm: " Oleg Drokin
@ 2016-06-10  2:35 ` Oleg Drokin
  2016-06-10  2:35 ` [PATCH 5/8] staging/lustre/lov: " Oleg Drokin
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List,
	Nathaniel Clark, Oleg Drokin

From: Nathaniel Clark <nathaniel.l.clark@intel.com>

Fix all multiple assignments on lustre/llite directory.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 3 ++-
 drivers/staging/lustre/lustre/llite/namei.c     | 3 ++-
 drivers/staging/lustre/lustre/llite/vvp_io.c    | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 96c7e9f..b260f60 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -864,7 +864,8 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
 	try_module_get(THIS_MODULE);
 
 	/* client additional sb info */
-	lsi->lsi_llsbi = sbi = ll_init_sbi(sb);
+	sbi = ll_init_sbi(sb);
+	lsi->lsi_llsbi = sbi;
 	if (!sbi) {
 		module_put(THIS_MODULE);
 		kfree(cfg);
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
index 5eba0eb..95643bc 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -318,7 +318,8 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
 	if (hlist_empty(&inode->i_dentry))
 		return NULL;
 
-	discon_alias = invalid_alias = NULL;
+	discon_alias = NULL;
+	invalid_alias = NULL;
 
 	ll_lock_dcache(inode);
 	hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c
index e26e0f8..763d336 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_io.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_io.c
@@ -954,7 +954,8 @@ static int vvp_io_write_start(const struct lu_env *env,
 		 * out-of-order writes.
 		 */
 		ll_merge_attr(env, inode);
-		pos = io->u.ci_wr.wr.crw_pos = i_size_read(inode);
+		pos = i_size_read(inode);
+		io->u.ci_wr.wr.crw_pos = pos;
 		vio->vui_iocb->ki_pos = pos;
 	} else {
 		LASSERT(vio->vui_iocb->ki_pos == pos);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/8] staging/lustre/lov: Fix Multiple Assignments
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
                   ` (3 preceding siblings ...)
  2016-06-10  2:35 ` [PATCH 4/8] staging/lustre/llite: " Oleg Drokin
@ 2016-06-10  2:35 ` Oleg Drokin
  2016-06-10  2:35 ` [PATCH 6/8] staging/lustre/obdclass: " Oleg Drokin
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List,
	Nathaniel Clark, Oleg Drokin

From: Nathaniel Clark <nathaniel.l.clark@intel.com>

Fix all multiple assignments on lustre/lov directory.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/lov/lov_obd.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c
index e15ef2e..c179b31 100644
--- a/drivers/staging/lustre/lustre/lov/lov_obd.c
+++ b/drivers/staging/lustre/lustre/lov/lov_obd.c
@@ -1772,7 +1772,8 @@ static int lov_fiemap(struct lov_obd *lov, __u32 keylen, void *key,
 	fm_start = fiemap->fm_start;
 	fm_length = fiemap->fm_length;
 	/* Calculate start stripe, last stripe and length of mapping */
-	actual_start_stripe = start_stripe = lov_stripe_number(lsm, fm_start);
+	start_stripe = lov_stripe_number(lsm, fm_start);
+	actual_start_stripe = start_stripe;
 	fm_end = (fm_length == ~0ULL ? fm_key->oa.o_size :
 						fm_start + fm_length - 1);
 	/* If fm_length != ~0ULL but fm_start+fm_length-1 exceeds file size */
@@ -2095,11 +2096,9 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp,
 	u32 count;
 	int i, rc = 0, err;
 	struct lov_tgt_desc *tgt;
-	unsigned incr, check_uuid,
-		 do_inactive, no_set;
-	unsigned next_id = 0,  mds_con = 0;
+	unsigned int incr = 0, check_uuid = 0, do_inactive = 0, no_set = 0;
+	unsigned int next_id = 0, mds_con = 0;
 
-	incr = check_uuid = do_inactive = no_set = 0;
 	if (!set) {
 		no_set = 1;
 		set = ptlrpc_prep_set();
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/8] staging/lustre/obdclass: Fix Multiple Assignments
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
                   ` (4 preceding siblings ...)
  2016-06-10  2:35 ` [PATCH 5/8] staging/lustre/lov: " Oleg Drokin
@ 2016-06-10  2:35 ` Oleg Drokin
  2016-06-10  2:35 ` [PATCH 7/8] staging/lustre/ptlrpc: " Oleg Drokin
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List,
	Nathaniel Clark, Oleg Drokin

From: Nathaniel Clark <nathaniel.l.clark@intel.com>

Fix all multiple assignments on lustre/obdclass directory.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/obdclass/llog.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c
index 79194d8..55a9755 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog.c
@@ -123,8 +123,10 @@ static int llog_read_header(const struct lu_env *env,
 		handle->lgh_last_idx = 0; /* header is record with index 0 */
 		llh->llh_count = 1;	 /* for the header record */
 		llh->llh_hdr.lrh_type = LLOG_HDR_MAGIC;
-		llh->llh_hdr.lrh_len = llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE;
-		llh->llh_hdr.lrh_index = llh->llh_tail.lrt_index = 0;
+		llh->llh_hdr.lrh_len = LLOG_CHUNK_SIZE;
+		llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE;
+		llh->llh_hdr.lrh_index = 0;
+		llh->llh_tail.lrt_index = 0;
 		llh->llh_timestamp = ktime_get_real_seconds();
 		if (uuid)
 			memcpy(&llh->llh_tgtuuid, uuid,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/8] staging/lustre/ptlrpc: Fix Multiple Assignments
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
                   ` (5 preceding siblings ...)
  2016-06-10  2:35 ` [PATCH 6/8] staging/lustre/obdclass: " Oleg Drokin
@ 2016-06-10  2:35 ` Oleg Drokin
  2016-06-10  2:35 ` [PATCH 8/8] staging/lustre/lmv: " Oleg Drokin
  2016-06-15 20:15 ` [PATCH 0/8] Lustre: Multiple assignments removal Luis de Bethencourt
  8 siblings, 0 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List,
	Nathaniel Clark, Oleg Drokin

From: Nathaniel Clark <nathaniel.l.clark@intel.com>

Fix all multiple assignments on lustre/ptlrpc directory.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/ptlrpc/client.c       | 6 ++++--
 drivers/staging/lustre/lustre/ptlrpc/import.c       | 3 ++-
 drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 3 ++-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c       | 3 ++-
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c     | 3 ++-
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 4b7912a..8336ed1 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -3024,8 +3024,10 @@ void *ptlrpcd_alloc_work(struct obd_import *imp,
 	req->rq_interpret_reply = work_interpreter;
 	/* don't want reply */
 	req->rq_receiving_reply = 0;
-	req->rq_req_unlink = req->rq_reply_unlink = 0;
-	req->rq_no_delay = req->rq_no_resend = 1;
+	req->rq_req_unlink = 0;
+	req->rq_reply_unlink = 0;
+	req->rq_no_delay = 1;
+	req->rq_no_resend = 1;
 	req->rq_pill.rc_fmt = (void *)&worker_format;
 
 	spin_lock_init(&req->rq_lock);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c
index a4f7544..a236e38 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/import.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/import.c
@@ -698,7 +698,8 @@ int ptlrpc_connect_import(struct obd_import *imp)
 
 	lustre_msg_add_op_flags(request->rq_reqmsg, MSG_CONNECT_NEXT_VER);
 
-	request->rq_no_resend = request->rq_no_delay = 1;
+	request->rq_no_resend = 1;
+	request->rq_no_delay = 1;
 	request->rq_send_state = LUSTRE_IMP_CONNECTING;
 	/* Allow a slightly larger reply for future growth compatibility */
 	req_capsule_set_size(&request->rq_pill, &RMF_CONNECT_DATA, RCL_SERVER,
diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
index 64c0f1e..ff40be2 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
@@ -872,7 +872,8 @@ ptlrpc_lprocfs_svc_req_history_next(struct seq_file *s,
 
 		if (i > srhi->srhi_idx) { /* reset iterator for a new CPT */
 			srhi->srhi_req = NULL;
-			seq = srhi->srhi_seq = 0;
+			seq = 0;
+			srhi->srhi_seq = 0;
 		} else { /* the next sequence */
 			seq = srhi->srhi_seq + (1 << svc->srv_cpt_bits);
 		}
diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
index 8a86931..d9d4ca2 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
@@ -57,7 +57,8 @@ ptlrpc_prep_ping(struct obd_import *imp)
 					LUSTRE_OBD_VERSION, OBD_PING);
 	if (req) {
 		ptlrpc_request_set_replen(req);
-		req->rq_no_resend = req->rq_no_delay = 1;
+		req->rq_no_resend = 1;
+		req->rq_no_delay = 1;
 	}
 	return req;
 }
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c
index 40e5349..af92e9e 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c
@@ -265,7 +265,8 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,
 		memcpy(newbuf, req->rq_reqbuf, req->rq_reqlen);
 
 		kvfree(req->rq_reqbuf);
-		req->rq_reqbuf = req->rq_reqmsg = newbuf;
+		req->rq_reqbuf = newbuf;
+		req->rq_reqmsg = newbuf;
 		req->rq_reqbuf_len = alloc_size;
 
 		if (req->rq_import)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/8] staging/lustre/lmv: Fix Multiple Assignments
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
                   ` (6 preceding siblings ...)
  2016-06-10  2:35 ` [PATCH 7/8] staging/lustre/ptlrpc: " Oleg Drokin
@ 2016-06-10  2:35 ` Oleg Drokin
  2016-06-15 20:15 ` [PATCH 0/8] Lustre: Multiple assignments removal Luis de Bethencourt
  8 siblings, 0 replies; 10+ messages in thread
From: Oleg Drokin @ 2016-06-10  2:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List,
	Nathaniel Clark, Oleg Drokin

From: Nathaniel Clark <nathaniel.l.clark@intel.com>

Fix all multiple assignments on lustre/lmv directory.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 9e31f6b..1d9875e 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -2686,7 +2686,7 @@ static int lmv_quotactl(struct obd_device *unused, struct obd_export *exp,
 	struct lmv_obd      *lmv = &obd->u.lmv;
 	struct lmv_tgt_desc *tgt = lmv->tgts[0];
 	int		  rc = 0, i;
-	__u64		curspace, curinodes;
+	__u64 curspace = 0, curinodes = 0;
 
 	if (!tgt || !tgt->ltd_exp || !tgt->ltd_active ||
 	    !lmv->desc.ld_tgt_count) {
@@ -2699,7 +2699,6 @@ static int lmv_quotactl(struct obd_device *unused, struct obd_export *exp,
 		return rc;
 	}
 
-	curspace = curinodes = 0;
 	for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
 		int err;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/8] Lustre: Multiple assignments removal.
  2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
                   ` (7 preceding siblings ...)
  2016-06-10  2:35 ` [PATCH 8/8] staging/lustre/lmv: " Oleg Drokin
@ 2016-06-15 20:15 ` Luis de Bethencourt
  8 siblings, 0 replies; 10+ messages in thread
From: Luis de Bethencourt @ 2016-06-15 20:15 UTC (permalink / raw)
  To: Oleg Drokin, Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List

On 10/06/16 03:35, Oleg Drokin wrote:
> These patches remove multiple assignments in Lustre, that makes
> checkpatch (somewhat understandably) unhappy.
> 
> Nathaniel Clark (8):
>   staging/lustre/osc: Fix Multiple Assignment Warnings
>   staging/lustre/fid: Fix Multiple Assignments
>   staging/lustre/ldlm: Fix Multiple Assignments
>   staging/lustre/llite: Fix Multiple Assignments
>   staging/lustre/lov: Fix Multiple Assignments
>   staging/lustre/obdclass: Fix Multiple Assignments
>   staging/lustre/ptlrpc: Fix Multiple Assignments
>   staging/lustre/lmv: Fix Multiple Assignments
> 
>  drivers/staging/lustre/lustre/fid/fid_request.c     |  6 ++++--
>  drivers/staging/lustre/lustre/ldlm/ldlm_lib.c       |  3 ++-
>  drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c     |  8 +++++---
>  drivers/staging/lustre/lustre/llite/llite_lib.c     |  3 ++-
>  drivers/staging/lustre/lustre/llite/namei.c         |  3 ++-
>  drivers/staging/lustre/lustre/llite/vvp_io.c        |  3 ++-
>  drivers/staging/lustre/lustre/lmv/lmv_obd.c         |  3 +--
>  drivers/staging/lustre/lustre/lov/lov_obd.c         |  9 ++++-----
>  drivers/staging/lustre/lustre/obdclass/llog.c       |  6 ++++--
>  drivers/staging/lustre/lustre/osc/osc_cache.c       |  6 ++++--
>  drivers/staging/lustre/lustre/osc/osc_io.c          | 12 ++++++++----
>  drivers/staging/lustre/lustre/osc/osc_lock.c        |  3 ++-
>  drivers/staging/lustre/lustre/osc/osc_request.c     |  6 ++++--
>  drivers/staging/lustre/lustre/ptlrpc/client.c       |  6 ++++--
>  drivers/staging/lustre/lustre/ptlrpc/import.c       |  3 ++-
>  drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c |  3 ++-
>  drivers/staging/lustre/lustre/ptlrpc/pinger.c       |  3 ++-
>  drivers/staging/lustre/lustre/ptlrpc/sec_null.c     |  3 ++-
>  18 files changed, 56 insertions(+), 33 deletions(-)
> 

Hi,

Documentation/CodingStyle says (in line 65):
"Don't put multiple assignments on a single line either.  Kernel coding style
is super simple.  Avoid tricky expressions."

This patch set looks good.
Luis

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-06-15 20:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10  2:35 [PATCH 0/8] Lustre: Multiple assignments removal Oleg Drokin
2016-06-10  2:35 ` [PATCH 1/8] staging/lustre/osc: Fix Multiple Assignment Warnings Oleg Drokin
2016-06-10  2:35 ` [PATCH 2/8] staging/lustre/fid: Fix Multiple Assignments Oleg Drokin
2016-06-10  2:35 ` [PATCH 3/8] staging/lustre/ldlm: " Oleg Drokin
2016-06-10  2:35 ` [PATCH 4/8] staging/lustre/llite: " Oleg Drokin
2016-06-10  2:35 ` [PATCH 5/8] staging/lustre/lov: " Oleg Drokin
2016-06-10  2:35 ` [PATCH 6/8] staging/lustre/obdclass: " Oleg Drokin
2016-06-10  2:35 ` [PATCH 7/8] staging/lustre/ptlrpc: " Oleg Drokin
2016-06-10  2:35 ` [PATCH 8/8] staging/lustre/lmv: " Oleg Drokin
2016-06-15 20:15 ` [PATCH 0/8] Lustre: Multiple assignments removal Luis de Bethencourt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).