All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis
@ 2014-08-06 17:12 Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 02/12] staging: lustre: remove spaces from start of line Srikrishan Malik
                   ` (11 more replies)
  0 siblings, 12 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes following checkpatch warning:

WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_internal.h |  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_lib.c      |  4 ++--
 drivers/staging/lustre/lustre/mdc/mdc_locks.c    |  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c  | 14 +++++++-------
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_internal.h b/drivers/staging/lustre/lustre/mdc/mdc_internal.h
index e8235559e27f..f4da8f3523d2 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_internal.h
+++ b/drivers/staging/lustre/lustre/mdc/mdc_internal.h
@@ -40,7 +40,7 @@
 #include "../include/lustre_mdc.h"
 #include "../include/lustre_mds.h"
 
-#if defined (CONFIG_PROC_FS)
+#if defined CONFIG_PROC_FS
 void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars);
 #else
 static inline void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index f54dd90c7e50..60217ba440aa 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -42,7 +42,7 @@
 
 static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid)
 {
-	LASSERT (b != NULL);
+	LASSERT(b != NULL);
 
 	b->suppgid = suppgid;
 	b->uid = from_kuid(&init_user_ns, current_uid());
@@ -409,7 +409,7 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
 
 	CLASSERT(sizeof(struct mdt_rec_reint) == sizeof(struct mdt_rec_link));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
-	LASSERT (rec != NULL);
+	LASSERT(rec != NULL);
 
 	rec->lk_opcode   = REINT_LINK;
 	rec->lk_fsuid    = op_data->op_fsuid;//current->fsuid;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index 71219b90e22b..88b43823c632 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -633,7 +633,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 
 		body = req_capsule_server_get(pill, &RMF_MDT_BODY);
 		if (body == NULL) {
-			CERROR ("Can't swab mdt_body\n");
+			CERROR("Can't swab mdt_body\n");
 			return -EPROTO;
 		}
 
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 4a1cc4eb73d5..0b517e550477 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -1702,7 +1702,7 @@ static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,
 		if (oqc) {
 			*oqctl = *oqc;
 		} else if (!rc) {
-			CERROR ("Can't unpack obd_quotactl\n");
+			CERROR("Can't unpack obd_quotactl\n");
 			rc = -EPROTO;
 		}
 	} else if (!rc) {
@@ -2426,14 +2426,14 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
 	struct lprocfs_static_vars lvars = { NULL };
 	int rc;
 
-	OBD_ALLOC(cli->cl_rpc_lock, sizeof (*cli->cl_rpc_lock));
+	OBD_ALLOC(cli->cl_rpc_lock, sizeof(*cli->cl_rpc_lock));
 	if (!cli->cl_rpc_lock)
 		return -ENOMEM;
 	mdc_init_rpc_lock(cli->cl_rpc_lock);
 
 	ptlrpcd_addref();
 
-	OBD_ALLOC(cli->cl_close_lock, sizeof (*cli->cl_close_lock));
+	OBD_ALLOC(cli->cl_close_lock, sizeof(*cli->cl_close_lock));
 	if (!cli->cl_close_lock)
 		GOTO(err_rpc_lock, rc = -ENOMEM);
 	mdc_init_rpc_lock(cli->cl_close_lock);
@@ -2459,9 +2459,9 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
 	return rc;
 
 err_close_lock:
-	OBD_FREE(cli->cl_close_lock, sizeof (*cli->cl_close_lock));
+	OBD_FREE(cli->cl_close_lock, sizeof(*cli->cl_close_lock));
 err_rpc_lock:
-	OBD_FREE(cli->cl_rpc_lock, sizeof (*cli->cl_rpc_lock));
+	OBD_FREE(cli->cl_rpc_lock, sizeof(*cli->cl_rpc_lock));
 	ptlrpcd_decref();
 	return rc;
 }
@@ -2523,8 +2523,8 @@ static int mdc_cleanup(struct obd_device *obd)
 {
 	struct client_obd *cli = &obd->u.cli;
 
-	OBD_FREE(cli->cl_rpc_lock, sizeof (*cli->cl_rpc_lock));
-	OBD_FREE(cli->cl_close_lock, sizeof (*cli->cl_close_lock));
+	OBD_FREE(cli->cl_rpc_lock, sizeof(*cli->cl_rpc_lock));
+	OBD_FREE(cli->cl_close_lock, sizeof(*cli->cl_close_lock));
 
 	ptlrpcd_decref();
 
-- 
1.9.3


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

* [PATCH 02/12] staging: lustre: remove spaces from start of line
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
@ 2014-08-06 17:12 ` Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 03/12] staging: lustre: move open brace to next line after functions Srikrishan Malik
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following checkpatch warning:

WARNING: please, no spaces at the start of a line

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index d1d891b91663..f883d9c28f20 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -209,6 +209,6 @@ static struct lprocfs_vars lprocfs_mdc_module_vars[] = {
 
 void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
 {
-    lvars->module_vars  = lprocfs_mdc_module_vars;
-    lvars->obd_vars     = lprocfs_mdc_obd_vars;
+	lvars->module_vars  = lprocfs_mdc_module_vars;
+	lvars->obd_vars     = lprocfs_mdc_obd_vars;
 }
-- 
1.9.3


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

* [PATCH 03/12] staging: lustre: move open brace to next line after functions
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 02/12] staging: lustre: remove spaces from start of line Srikrishan Malik
@ 2014-08-06 17:12 ` Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 04/12] staging: lustre: fix lines over 80 chars Srikrishan Malik
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following checkpatch error:

ERROR: open brace '{' following function declarations go on the next line

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c     | 3 ++-
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index 60217ba440aa..daaa7422c03f 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -256,7 +256,8 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 	set_mrc_cr_flags(rec, cr_flags);
 }
 
-static inline __u64 attr_pack(unsigned int ia_valid) {
+static inline __u64 attr_pack(unsigned int ia_valid)
+{
 	__u64 sa_valid = 0;
 
 	if (ia_valid & ATTR_MODE)
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 0b517e550477..0bcf624620ce 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -2384,7 +2384,8 @@ int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
 	return seq_client_alloc_fid(NULL, seq, fid);
 }
 
-struct obd_uuid *mdc_get_uuid(struct obd_export *exp) {
+struct obd_uuid *mdc_get_uuid(struct obd_export *exp)
+{
 	struct client_obd *cli = &exp->exp_obd->u.cli;
 	return &cli->cl_target_uuid;
 }
-- 
1.9.3


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

* [PATCH 04/12] staging: lustre: fix lines over 80 chars
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 02/12] staging: lustre: remove spaces from start of line Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 03/12] staging: lustre: move open brace to next line after functions Srikrishan Malik
@ 2014-08-06 17:12 ` Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces Srikrishan Malik
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following  checkpatch warning:

WARNING: line over 80 characters

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c   | 6 ++++--
 drivers/staging/lustre/lustre/mdc/mdc_lib.c     | 9 ++++++---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c   | 7 ++++---
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 6 ++++--
 4 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index f883d9c28f20..16341c818358 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -56,7 +56,8 @@ static ssize_t mdc_max_rpcs_in_flight_seq_write(struct file *file,
 						size_t count,
 						loff_t *off)
 {
-	struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
+	struct obd_device *dev =
+			((struct seq_file *)file->private_data)->private;
 	struct client_obd *cli = &dev->u.cli;
 	int val, rc;
 
@@ -84,7 +85,8 @@ static int mdc_kuc_open(struct inode *inode, struct file *file)
 static ssize_t mdc_kuc_write(struct file *file, const char *buffer,
 			     size_t count, loff_t *off)
 {
-	struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
+	struct obd_device *obd =
+			((struct seq_file *)file->private_data)->private;
 	struct kuc_hdr		*lh;
 	struct hsm_action_list	*hal;
 	struct hsm_action_item	*hai;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index daaa7422c03f..16e2e0b611d1 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -52,7 +52,8 @@ static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid)
 	b->capability = cfs_curproc_cap_pack();
 }
 
-void mdc_pack_capa(struct ptlrpc_request *req, const struct req_msg_field *field,
+void mdc_pack_capa(struct ptlrpc_request *req,
+		   const struct req_msg_field *field,
 		   struct obd_capa *oc)
 {
 	struct req_capsule *pill = &req->rq_pill;
@@ -317,7 +318,8 @@ static void mdc_setattr_pack_rec(struct mdt_rec_setattr *rec,
 	rec->sa_atime  = LTIME_S(op_data->op_attr.ia_atime);
 	rec->sa_mtime  = LTIME_S(op_data->op_attr.ia_mtime);
 	rec->sa_ctime  = LTIME_S(op_data->op_attr.ia_ctime);
-	rec->sa_attr_flags = ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags;
+	rec->sa_attr_flags =
+			((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags;
 	if ((op_data->op_attr.ia_valid & ATTR_GID) &&
 	    in_group_p(op_data->op_attr.ia_gid))
 		rec->sa_suppgid =
@@ -552,7 +554,8 @@ int mdc_enter_request(struct client_obd *cli)
 		list_add_tail(&mcw.mcw_entry, &cli->cl_cache_waiters);
 		init_waitqueue_head(&mcw.mcw_waitq);
 		client_obd_list_unlock(&cli->cl_loi_list_lock);
-		rc = l_wait_event(mcw.mcw_waitq, mdc_req_avail(cli, &mcw), &lwi);
+		rc = l_wait_event(mcw.mcw_waitq, mdc_req_avail(cli, &mcw),
+				  &lwi);
 		if (rc) {
 			client_obd_list_lock(&cli->cl_loi_list_lock);
 			if (list_empty(&mcw.mcw_entry))
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index 88b43823c632..5de9e8862393 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -450,8 +450,8 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
 }
 
 static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
-						      struct lookup_intent *it,
-						      struct md_op_data *op_data)
+						    struct lookup_intent *it,
+						    struct md_op_data *op_data)
 {
 	struct ptlrpc_request *req;
 	struct obd_device     *obddev = class_exp2obd(exp);
@@ -1039,7 +1039,8 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
 
 		memcpy(&old_lock, lockh, sizeof(*lockh));
 		if (ldlm_lock_match(NULL, LDLM_FL_BLOCK_GRANTED, NULL,
-				    LDLM_IBITS, &policy, LCK_NL, &old_lock, 0)) {
+				    LDLM_IBITS, &policy, LCK_NL,
+				    &old_lock, 0)) {
 			ldlm_lock_decref_and_cancel(lockh,
 						    it->d.lustre.it_lock_mode);
 			memcpy(lockh, &old_lock, sizeof(old_lock));
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 0bcf624620ce..5126262aa73d 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -897,7 +897,8 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
 		mod->mod_open_req->rq_replay = 0;
 		spin_unlock(&mod->mod_open_req->rq_lock);
 	} else {
-		 CDEBUG(D_HA, "couldn't find open req; expecting close error\n");
+		 CDEBUG(D_HA,
+			"couldn't find open req; expecting close error\n");
 	}
 
 	mdc_close_pack(req, op_data);
@@ -1084,7 +1085,8 @@ restart_bulk:
 			CERROR("too many resend retries, returning error\n");
 			return -EIO;
 		}
-		lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends), NULL, NULL, NULL);
+		lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends),
+				       NULL, NULL, NULL);
 		l_wait_event(waitq, 0, &lwi);
 
 		goto restart_bulk;
-- 
1.9.3


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

* [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces.
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (2 preceding siblings ...)
  2014-08-06 17:12 ` [PATCH 04/12] staging: lustre: fix lines over 80 chars Srikrishan Malik
@ 2014-08-06 17:12 ` Srikrishan Malik
  2014-08-06 20:13   ` Dan Carpenter
  2014-08-06 17:12 ` [PATCH 06/12] staging: lustre: replace c99 style comments with C89 Srikrishan Malik
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following checkpatch errors:

ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that close brace '}'

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c     | 25 +++++++++++++------------
 drivers/staging/lustre/lustre/mdc/mdc_locks.c   |  5 +++--
 drivers/staging/lustre/lustre/mdc/mdc_reint.c   |  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c |  7 ++++---
 4 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index 16e2e0b611d1..35ce2fdf696c 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -345,7 +345,8 @@ void mdc_setattr_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 	struct mdt_ioepoch *epoch;
 	struct lov_user_md *lum = NULL;
 
-	CLASSERT(sizeof(struct mdt_rec_reint) ==sizeof(struct mdt_rec_setattr));
+	CLASSERT(sizeof(struct mdt_rec_reint) ==
+					sizeof(struct mdt_rec_setattr));
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 	mdc_setattr_pack_rec(rec, op_data);
 
@@ -385,18 +386,18 @@ void mdc_unlink_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
 	rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT);
 	LASSERT(rec != NULL);
 
-	rec->ul_opcode  = op_data->op_cli_flags & CLI_RM_ENTRY ?
+	rec->ul_opcode   = op_data->op_cli_flags & CLI_RM_ENTRY ?
 					REINT_RMENTRY : REINT_UNLINK;
-	rec->ul_fsuid   = op_data->op_fsuid;
-	rec->ul_fsgid   = op_data->op_fsgid;
-	rec->ul_cap     = op_data->op_cap;
-	rec->ul_mode    = op_data->op_mode;
-	rec->ul_suppgid1= op_data->op_suppgids[0];
-	rec->ul_suppgid2= -1;
-	rec->ul_fid1    = op_data->op_fid1;
-	rec->ul_fid2    = op_data->op_fid2;
-	rec->ul_time    = op_data->op_mod_time;
-	rec->ul_bias    = op_data->op_bias;
+	rec->ul_fsuid    = op_data->op_fsuid;
+	rec->ul_fsgid    = op_data->op_fsgid;
+	rec->ul_cap      = op_data->op_cap;
+	rec->ul_mode     = op_data->op_mode;
+	rec->ul_suppgid1 = op_data->op_suppgids[0];
+	rec->ul_suppgid2 = -1;
+	rec->ul_fid1     = op_data->op_fid1;
+	rec->ul_fid2     = op_data->op_fid2;
+	rec->ul_time     = op_data->op_mod_time;
+	rec->ul_bias     = op_data->op_bias;
 
 	mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
 
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index 5de9e8862393..a5a2597616e9 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -621,7 +621,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 	 * function without doing so, and try to replay a failed create
 	 * (bug 3440) */
 	if (it->it_op & IT_OPEN && req->rq_replay &&
-	    (!it_disposition(it, DISP_OPEN_OPEN) ||intent->it_status != 0))
+	    (!it_disposition(it, DISP_OPEN_OPEN) || intent->it_status != 0))
 		mdc_clear_replay_flag(req, intent->it_status);
 
 	DEBUG_REQ(D_RPCTRACE, req, "op: %d disposition: %x, status: %d",
@@ -1047,7 +1047,8 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
 			it->d.lustre.it_lock_handle = lockh->cookie;
 		}
 	}
-	CDEBUG(D_DENTRY,"D_IT dentry %.*s intent: %s status %d disp %x rc %d\n",
+	CDEBUG(D_DENTRY,
+	       "D_IT dentry %.*s intent: %s status %d disp %x rc %d\n",
 	       op_data->op_namelen, op_data->op_name, ldlm_it2str(it->it_op),
 	       it->d.lustre.it_status, it->d.lustre.it_disposition, rc);
 	return rc;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
index c5420a42bc33..c40304bf0b62 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
@@ -71,7 +71,7 @@ int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
 			    __u64 bits)
 {
 	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
-	ldlm_policy_data_t policy = {{0}};
+	ldlm_policy_data_t policy = {{0} };
 	struct ldlm_res_id res_id;
 	struct ldlm_resource *res;
 	int count;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 5126262aa73d..6def92133227 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -326,7 +326,8 @@ static int mdc_is_subdir(struct obd_export *exp,
 	return rc;
 }
 
-static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
+static int mdc_xattr_common(struct obd_export *exp,
+			    const struct req_format *fmt,
 			    const struct lu_fid *fid,
 			    struct obd_capa *oc, int opcode, obd_valid valid,
 			    const char *xattr_name, const char *input,
@@ -544,7 +545,7 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
 		int lmvsize;
 		struct lov_mds_md *lmv;
 
-		if(!S_ISDIR(md->body->mode)) {
+		if (!S_ISDIR(md->body->mode)) {
 			CDEBUG(D_INFO, "OBD_MD_FLDIREA set, should be a "
 			       "directory, but is not\n");
 			GOTO(out, rc = -EPROTO);
@@ -1536,7 +1537,7 @@ static int changelog_kkuc_cb(const struct lu_env *env, struct llog_handle *llh,
 	memcpy(lh + 1, &rec->cr, len - sizeof(*lh));
 
 	rc = libcfs_kkuc_msg_put(cs->cs_fp, lh);
-	CDEBUG(D_CHANGELOG, "kucmsg fp %p len %d rc %d\n", cs->cs_fp, len,rc);
+	CDEBUG(D_CHANGELOG, "kucmsg fp %p len %d rc %d\n", cs->cs_fp, len, rc);
 
 	return rc;
 }
-- 
1.9.3


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

* [PATCH 06/12] staging: lustre: replace c99 style comments with C89
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (3 preceding siblings ...)
  2014-08-06 17:12 ` [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces Srikrishan Malik
@ 2014-08-06 17:12 ` Srikrishan Malik
  2014-08-06 20:15   ` Dan Carpenter
  2014-08-06 17:12 ` [PATCH 07/12] staging: lustre: add blank lines after declarations Srikrishan Malik
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following checkpatch error:

ERROR: do not use C99 // comments

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index 35ce2fdf696c..7f9b6eb51860 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -416,9 +416,9 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
 	LASSERT(rec != NULL);
 
 	rec->lk_opcode   = REINT_LINK;
-	rec->lk_fsuid    = op_data->op_fsuid;//current->fsuid;
-	rec->lk_fsgid    = op_data->op_fsgid;//current->fsgid;
-	rec->lk_cap      = op_data->op_cap;//current->cap_effective;
+	rec->lk_fsuid    = op_data->op_fsuid; /* current->fsuid; */
+	rec->lk_fsgid    = op_data->op_fsgid; /*current->fsgid; */
+	rec->lk_cap      = op_data->op_cap;   /*current->cap_effective; */
 	rec->lk_suppgid1 = op_data->op_suppgids[0];
 	rec->lk_suppgid2 = op_data->op_suppgids[1];
 	rec->lk_fid1     = op_data->op_fid1;
-- 
1.9.3


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

* [PATCH 07/12] staging: lustre: add blank lines after declarations
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (4 preceding siblings ...)
  2014-08-06 17:12 ` [PATCH 06/12] staging: lustre: replace c99 style comments with C89 Srikrishan Malik
@ 2014-08-06 17:12 ` Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 08/12] staging: lustre: fix multi line strings Srikrishan Malik
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following checkpatch warning:

WARNING: Missing a blank line after declarations

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c     | 1 +
 drivers/staging/lustre/lustre/mdc/mdc_locks.c   | 3 +++
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 5 +++++
 3 files changed, 9 insertions(+)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index 7f9b6eb51860..95fe62da26e2 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -490,6 +490,7 @@ void mdc_getattr_pack(struct ptlrpc_request *req, __u64 valid, int flags,
 
 	if (op_data->op_name) {
 		char *tmp = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
+
 		LOGL0(op_data->op_name, op_data->op_namelen, tmp);
 
 	}
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index a5a2597616e9..4d837d61be65 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -134,6 +134,7 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
 	if (lock->l_resource->lr_lvb_inode &&
 	    lock->l_resource->lr_lvb_inode != data) {
 		struct inode *old_inode = lock->l_resource->lr_lvb_inode;
+
 		LASSERTF(old_inode->i_state & I_FREEING,
 			 "Found existing inode %p/%lu/%u state %lu in lock: "
 			 "setting data to %p/%lu/%u\n", old_inode,
@@ -678,6 +679,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
 			 */
 			if ((it->it_op & IT_OPEN) && req->rq_replay) {
 				void *lmm;
+
 				if (req_capsule_get_size(pill, &RMF_EADATA,
 							 RCL_CLIENT) <
 				    body->eadatasize)
@@ -1029,6 +1031,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
 	lock = ldlm_handle2lock(lockh);
 	if (lock) {
 		ldlm_policy_data_t policy = lock->l_policy_data;
+
 		LDLM_DEBUG(lock, "matching against this");
 
 		LASSERTF(fid_res_name_eq(&mdt_body->fid1,
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 6def92133227..57d903156917 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -203,6 +203,7 @@ static int mdc_getattr_common(struct obd_export *exp,
 
 	if (body->valid & OBD_MD_FLMDSCAPA) {
 		struct lustre_capa *capa;
+
 		capa = req_capsule_server_get(pill, &RMF_CAPA1);
 		if (capa == NULL)
 			return -EPROTO;
@@ -283,6 +284,7 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,
 
 	if (op_data->op_name) {
 		char *name = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
+
 		LASSERT(strnlen(op_data->op_name, op_data->op_namelen) ==
 				op_data->op_namelen);
 		memcpy(name, op_data->op_name, op_data->op_namelen);
@@ -696,6 +698,7 @@ void mdc_replay_open(struct ptlrpc_request *req)
 void mdc_commit_open(struct ptlrpc_request *req)
 {
 	struct md_open_data *mod = req->rq_cb_data;
+
 	if (mod == NULL)
 		return;
 
@@ -2390,6 +2393,7 @@ int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
 struct obd_uuid *mdc_get_uuid(struct obd_export *exp)
 {
 	struct client_obd *cli = &exp->exp_obd->u.cli;
+
 	return &cli->cl_target_uuid;
 }
 
@@ -2742,6 +2746,7 @@ int __init mdc_init(void)
 {
 	int rc;
 	struct lprocfs_static_vars lvars = { NULL };
+
 	lprocfs_mdc_init_vars(&lvars);
 
 	rc = class_register_type(&mdc_obd_ops, &mdc_md_ops, lvars.module_vars,
-- 
1.9.3


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

* [PATCH 08/12] staging: lustre: fix multi line strings
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (5 preceding siblings ...)
  2014-08-06 17:12 ` [PATCH 07/12] staging: lustre: add blank lines after declarations Srikrishan Malik
@ 2014-08-06 17:12 ` Srikrishan Malik
  2014-08-06 17:12 ` [PATCH 09/12] staging: lustre: Added space between type name and * Srikrishan Malik
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following checkpatch warning:

WARNING: quoted string split across lines

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c   |  9 +++----
 drivers/staging/lustre/lustre/mdc/mdc_reint.c   |  3 +--
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 36 ++++++++++++-------------
 3 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index 4d837d61be65..7f724e3c3f06 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -136,11 +136,10 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
 		struct inode *old_inode = lock->l_resource->lr_lvb_inode;
 
 		LASSERTF(old_inode->i_state & I_FREEING,
-			 "Found existing inode %p/%lu/%u state %lu in lock: "
-			 "setting data to %p/%lu/%u\n", old_inode,
-			 old_inode->i_ino, old_inode->i_generation,
-			 old_inode->i_state,
-			 new_inode, new_inode->i_ino, new_inode->i_generation);
+			 "Found existing inode %p/%lu/%u state %lu in lock: setting data to %p/%lu/%u\n",
+			 old_inode, old_inode->i_ino, old_inode->i_generation,
+			 old_inode->i_state, new_inode, new_inode->i_ino,
+			 new_inode->i_generation);
 	}
 	lock->l_resource->lr_lvb_inode = new_inode;
 	if (bits)
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
index c40304bf0b62..6f78bffa9294 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
@@ -158,8 +158,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
 
 		*mod = obd_mod_alloc();
 		if (*mod == NULL) {
-			DEBUG_REQ(D_ERROR, req, "Can't allocate "
-				  "md_open_data");
+			DEBUG_REQ(D_ERROR, req, "Can't allocate md_open_data");
 		} else {
 			req->rq_replay = 1;
 			req->rq_cb_data = *mod;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 57d903156917..6c691a4763b5 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -517,14 +517,14 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
 		struct lov_mds_md *lmm;
 
 		if (!S_ISREG(md->body->mode)) {
-			CDEBUG(D_INFO, "OBD_MD_FLEASIZE set, should be a "
-			       "regular file, but is not\n");
+			CDEBUG(D_INFO,
+			       "OBD_MD_FLEASIZE set, should be a regular file, but is not\n");
 			GOTO(out, rc = -EPROTO);
 		}
 
 		if (md->body->eadatasize == 0) {
-			CDEBUG(D_INFO, "OBD_MD_FLEASIZE set, "
-			       "but eadatasize 0\n");
+			CDEBUG(D_INFO,
+			       "OBD_MD_FLEASIZE set, but eadatasize 0\n");
 			GOTO(out, rc = -EPROTO);
 		}
 		lmmsize = md->body->eadatasize;
@@ -537,8 +537,8 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
 			GOTO(out, rc);
 
 		if (rc < sizeof(*md->lsm)) {
-			CDEBUG(D_INFO, "lsm size too small: "
-			       "rc < sizeof (*md->lsm) (%d < %d)\n",
+			CDEBUG(D_INFO,
+			       "lsm size too small: rc < sizeof (*md->lsm) (%d < %d)\n",
 			       rc, (int)sizeof(*md->lsm));
 			GOTO(out, rc = -EPROTO);
 		}
@@ -548,14 +548,14 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
 		struct lov_mds_md *lmv;
 
 		if (!S_ISDIR(md->body->mode)) {
-			CDEBUG(D_INFO, "OBD_MD_FLDIREA set, should be a "
-			       "directory, but is not\n");
+			CDEBUG(D_INFO,
+			       "OBD_MD_FLDIREA set, should be a directory, but is not\n");
 			GOTO(out, rc = -EPROTO);
 		}
 
 		if (md->body->eadatasize == 0) {
-			CDEBUG(D_INFO, "OBD_MD_FLDIREA is set, "
-			       "but eadatasize 0\n");
+			CDEBUG(D_INFO,
+			       "OBD_MD_FLDIREA is set, but eadatasize 0\n");
 			return -EPROTO;
 		}
 		if (md->body->valid & OBD_MD_MEA) {
@@ -571,8 +571,8 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
 				GOTO(out, rc);
 
 			if (rc < sizeof(*md->mea)) {
-				CDEBUG(D_INFO, "size too small:  "
-				       "rc < sizeof(*md->mea) (%d < %d)\n",
+				CDEBUG(D_INFO,
+				       "size too small: rc < sizeof(*md->mea) (%d < %d)\n",
 					rc, (int)sizeof(*md->mea));
 				GOTO(out, rc = -EPROTO);
 			}
@@ -778,8 +778,8 @@ int mdc_set_open_replay_data(struct obd_export *exp,
 	rec->cr_old_handle.cookie = body->handle.cookie;
 	open_req->rq_replay_cb = mdc_replay_open;
 	if (!fid_is_sane(&body->fid1)) {
-		DEBUG_REQ(D_ERROR, open_req, "Saving replay request with "
-			  "insane fid");
+		DEBUG_REQ(D_ERROR, open_req,
+			  "Saving replay request with insane fid");
 		LBUG();
 	}
 
@@ -928,8 +928,8 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
 
 		rc = lustre_msg_get_status(req->rq_repmsg);
 		if (lustre_msg_get_type(req->rq_repmsg) == PTL_RPC_MSG_ERR) {
-			DEBUG_REQ(D_ERROR, req, "type == PTL_RPC_MSG_ERR, err "
-				  "= %d", rc);
+			DEBUG_REQ(D_ERROR, req,
+				  "type == PTL_RPC_MSG_ERR, err = %d", rc);
 			if (rc > 0)
 				rc = -rc;
 		}
@@ -2055,8 +2055,8 @@ static int mdc_hsm_copytool_send(int len, void *val)
 		return -EPROTO;
 	}
 
-	CDEBUG(D_HSM, " Received message mg=%x t=%d m=%d l=%d actions=%d "
-	       "on %s\n",
+	CDEBUG(D_HSM,
+	       " Received message mg=%x t=%d m=%d l=%d actions=%d on %s\n",
 	       lh->kuc_magic, lh->kuc_transport, lh->kuc_msgtype,
 	       lh->kuc_msglen, hal->hal_count, hal->hal_fsname);
 
-- 
1.9.3


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

* [PATCH 09/12] staging: lustre: Added space between type name and *
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (6 preceding siblings ...)
  2014-08-06 17:12 ` [PATCH 08/12] staging: lustre: fix multi line strings Srikrishan Malik
@ 2014-08-06 17:12 ` Srikrishan Malik
  2014-08-06 17:13 ` [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings Srikrishan Malik
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:12 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following checkpatch error:

ERROR: "(foo*)" should be "(foo *)"

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index 7f724e3c3f06..c03d77c9c5b8 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -218,7 +218,7 @@ int mdc_find_cbdata(struct obd_export *exp,
 	struct ldlm_res_id res_id;
 	int rc = 0;
 
-	fid_build_reg_res_name((struct lu_fid*)fid, &res_id);
+	fid_build_reg_res_name((struct lu_fid *)fid, &res_id);
 	rc = ldlm_resource_iterate(class_exp2obd(exp)->obd_namespace, &res_id,
 				   it, data);
 	if (rc == LDLM_ITER_STOP)
-- 
1.9.3


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

* [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (7 preceding siblings ...)
  2014-08-06 17:12 ` [PATCH 09/12] staging: lustre: Added space between type name and * Srikrishan Malik
@ 2014-08-06 17:13 ` Srikrishan Malik
  2014-08-06 20:18   ` Dan Carpenter
  2014-08-06 17:13 ` [PATCH 11/12] staging: lustre: move else on the same line as closing brace Srikrishan Malik
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:13 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fixes the following checkpatch error:

ERROR: that open brace { should be on the previous line

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c   | 12 ++++++------
 drivers/staging/lustre/lustre/mdc/mdc_reint.c   |  3 +--
 drivers/staging/lustre/lustre/mdc/mdc_request.c |  4 ++--
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index c03d77c9c5b8..09209171b50c 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -785,12 +785,12 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
 	__u64		  flags, saved_flags = extra_lock_flags;
 	int		    rc;
 	struct ldlm_res_id res_id;
-	static const ldlm_policy_data_t lookup_policy =
-			    { .l_inodebits = { MDS_INODELOCK_LOOKUP } };
-	static const ldlm_policy_data_t update_policy =
-			    { .l_inodebits = { MDS_INODELOCK_UPDATE } };
-	static const ldlm_policy_data_t layout_policy =
-			    { .l_inodebits = { MDS_INODELOCK_LAYOUT } };
+	static const ldlm_policy_data_t lookup_policy = {
+				.l_inodebits = { MDS_INODELOCK_LOOKUP } };
+	static const ldlm_policy_data_t update_policy = {
+				.l_inodebits = { MDS_INODELOCK_UPDATE } };
+	static const ldlm_policy_data_t layout_policy = {
+				.l_inodebits = { MDS_INODELOCK_LAYOUT } };
 	static const ldlm_policy_data_t getxattr_policy = {
 			      .l_inodebits = { MDS_INODELOCK_XATTR } };
 	ldlm_policy_data_t const *policy = &lookup_policy;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
index 6f78bffa9294..c551d3b843ab 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
@@ -152,8 +152,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
 
 	ptlrpc_request_set_replen(req);
 	if (mod && (op_data->op_flags & MF_EPOCH_OPEN) &&
-	    req->rq_import->imp_replayable)
-	{
+	    req->rq_import->imp_replayable) {
 		LASSERT(*mod == NULL);
 
 		*mod = obd_mod_alloc();
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 6c691a4763b5..205eeade9fdd 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -1794,8 +1794,8 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 		GOTO(out, rc);
 	case OBD_IOC_CHANGELOG_CLEAR: {
 		struct ioc_changelog *icc = karg;
-		struct changelog_setinfo cs =
-			{.cs_recno = icc->icc_recno, .cs_id = icc->icc_id};
+		struct changelog_setinfo cs = {
+			.cs_recno = icc->icc_recno, .cs_id = icc->icc_id};
 		rc = obd_set_info_async(NULL, exp, strlen(KEY_CHANGELOG_CLEAR),
 					KEY_CHANGELOG_CLEAR, sizeof(cs), &cs,
 					NULL);
-- 
1.9.3


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

* [PATCH 11/12] staging: lustre: move else on the same line as closing brace
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (8 preceding siblings ...)
  2014-08-06 17:13 ` [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings Srikrishan Malik
@ 2014-08-06 17:13 ` Srikrishan Malik
  2014-08-06 17:13 ` [PATCH 12/12] staging: lustre: remove parentheses usage with return Srikrishan Malik
  2014-08-10  4:32 ` [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Greg KH
  11 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:13 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fix the following checkpatch error:

ERROR: else should follow close brace '}'

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 205eeade9fdd..7ccee06fd447 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -587,8 +587,7 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,
 						lustre_swab_mdt_remote_perm);
 		if (!md->remote_perm)
 			GOTO(out, rc = -EPROTO);
-	}
-	else if (md->body->valid & OBD_MD_FLACL) {
+	} else if (md->body->valid & OBD_MD_FLACL) {
 		/* for ACL, it's possible that FLACL is set but aclsize is zero.
 		 * only when aclsize != 0 there's an actual segment for ACL
 		 * in reply buffer.
-- 
1.9.3


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

* [PATCH 12/12] staging: lustre: remove parentheses usage with return
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (9 preceding siblings ...)
  2014-08-06 17:13 ` [PATCH 11/12] staging: lustre: move else on the same line as closing brace Srikrishan Malik
@ 2014-08-06 17:13 ` Srikrishan Malik
  2014-08-10  4:32 ` [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Greg KH
  11 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-06 17:13 UTC (permalink / raw)
  To: greg, andreas.dilger, oleg.drokin; +Cc: devel, linux-kernel, Srikrishan Malik

Fix the following checkpatch error:

ERROR: return is not a function, parentheses are not required

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 7ccee06fd447..b67574218b69 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -2585,7 +2585,7 @@ static int mdc_process_config(struct obd_device *obd, obd_count len, void *buf)
 			rc = 0;
 		break;
 	}
-	return(rc);
+	return rc;
 }
 
 
-- 
1.9.3


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

* Re: [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces.
  2014-08-06 17:12 ` [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces Srikrishan Malik
@ 2014-08-06 20:13   ` Dan Carpenter
  2014-08-06 20:31     ` Joe Perches
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Carpenter @ 2014-08-06 20:13 UTC (permalink / raw)
  To: Srikrishan Malik
  Cc: greg, andreas.dilger, oleg.drokin, devel, linux-kernel, Joe Perches

On Wed, Aug 06, 2014 at 10:42:55PM +0530, Srikrishan Malik wrote:
> diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
> index c5420a42bc33..c40304bf0b62 100644
> --- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c
> +++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
> @@ -71,7 +71,7 @@ int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
>  			    __u64 bits)
>  {
>  	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
> -	ldlm_policy_data_t policy = {{0}};
> +	ldlm_policy_data_t policy = {{0} };

That's odd.  Since when is a space required here?  Anyway, put one at
the start too if you're goind to do that.  Or you could do it like:

	ldlm_policy_data_t policy = {};

?

regards,
dan carpenter


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

* Re: [PATCH 06/12] staging: lustre: replace c99 style comments with C89
  2014-08-06 17:12 ` [PATCH 06/12] staging: lustre: replace c99 style comments with C89 Srikrishan Malik
@ 2014-08-06 20:15   ` Dan Carpenter
  0 siblings, 0 replies; 27+ messages in thread
From: Dan Carpenter @ 2014-08-06 20:15 UTC (permalink / raw)
  To: Srikrishan Malik; +Cc: greg, andreas.dilger, oleg.drokin, devel, linux-kernel

On Wed, Aug 06, 2014 at 10:42:56PM +0530, Srikrishan Malik wrote:
> diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
> index 35ce2fdf696c..7f9b6eb51860 100644
> --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
> +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
> @@ -416,9 +416,9 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data)
>  	LASSERT(rec != NULL);
>  
>  	rec->lk_opcode   = REINT_LINK;
> -	rec->lk_fsuid    = op_data->op_fsuid;//current->fsuid;
> -	rec->lk_fsgid    = op_data->op_fsgid;//current->fsgid;
> -	rec->lk_cap      = op_data->op_cap;//current->cap_effective;
> +	rec->lk_fsuid    = op_data->op_fsuid; /* current->fsuid; */
> +	rec->lk_fsgid    = op_data->op_fsgid; /*current->fsgid; */
> +	rec->lk_cap      = op_data->op_cap;   /*current->cap_effective; */


Put a space after the '/*'.

regards,
dan carpenter



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

* Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-06 17:13 ` [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings Srikrishan Malik
@ 2014-08-06 20:18   ` Dan Carpenter
  2014-08-07 15:31     ` Srikrishan Malik
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Carpenter @ 2014-08-06 20:18 UTC (permalink / raw)
  To: Srikrishan Malik; +Cc: greg, andreas.dilger, oleg.drokin, devel, linux-kernel

On Wed, Aug 06, 2014 at 10:43:00PM +0530, Srikrishan Malik wrote:
> diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
> index c03d77c9c5b8..09209171b50c 100644
> --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
> +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
> @@ -785,12 +785,12 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
>  	__u64		  flags, saved_flags = extra_lock_flags;
>  	int		    rc;
>  	struct ldlm_res_id res_id;
> -	static const ldlm_policy_data_t lookup_policy =
> -			    { .l_inodebits = { MDS_INODELOCK_LOOKUP } };
> -	static const ldlm_policy_data_t update_policy =
> -			    { .l_inodebits = { MDS_INODELOCK_UPDATE } };
> -	static const ldlm_policy_data_t layout_policy =
> -			    { .l_inodebits = { MDS_INODELOCK_LAYOUT } };
> +	static const ldlm_policy_data_t lookup_policy = {
> +				.l_inodebits = { MDS_INODELOCK_LOOKUP } };
> +	static const ldlm_policy_data_t update_policy = {
> +				.l_inodebits = { MDS_INODELOCK_UPDATE } };
> +	static const ldlm_policy_data_t layout_policy = {
> +				.l_inodebits = { MDS_INODELOCK_LAYOUT } };
>  	static const ldlm_policy_data_t getxattr_policy = {
>  			      .l_inodebits = { MDS_INODELOCK_XATTR } };
>  	ldlm_policy_data_t const *policy = &lookup_policy;

That looks silly before and after.  Everything is indented in a funny
way.

regards,
dan carpenter


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

* Re: [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces.
  2014-08-06 20:13   ` Dan Carpenter
@ 2014-08-06 20:31     ` Joe Perches
  2014-08-06 20:45       ` Dan Carpenter
  0 siblings, 1 reply; 27+ messages in thread
From: Joe Perches @ 2014-08-06 20:31 UTC (permalink / raw)
  To: Dan Carpenter, Andy Whitcroft
  Cc: Srikrishan Malik, greg, andreas.dilger, oleg.drokin, devel, linux-kernel

On Wed, 2014-08-06 at 23:13 +0300, Dan Carpenter wrote:
> On Wed, Aug 06, 2014 at 10:42:55PM +0530, Srikrishan Malik wrote:
> > diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
[]
> > @@ -71,7 +71,7 @@ int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
> >  			    __u64 bits)
> >  {
> >  	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
> > -	ldlm_policy_data_t policy = {{0}};
> > +	ldlm_policy_data_t policy = {{0} };
> 
> That's odd.  Since when is a space required here?  Anyway, put one at
> the start too if you're goind to do that.  Or you could do it like:
> 
> 	ldlm_policy_data_t policy = {};
> 
> ?

It comes from a pretty old bit of checkpatch:

de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3706) # closing brace should have a space following it when it has anything
de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3707) # on the line
de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3708)                if ($line =~ /}(?!(?:,|;|\)))\S/) {

Maybe it should have an } added to the test like:

if ($line =~ /}(?!(?:,|;|\)|}))\S/) {



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

* Re: [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces.
  2014-08-06 20:31     ` Joe Perches
@ 2014-08-06 20:45       ` Dan Carpenter
  2014-08-06 21:26         ` Joe Perches
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Carpenter @ 2014-08-06 20:45 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andy Whitcroft, Srikrishan Malik, greg, andreas.dilger,
	oleg.drokin, devel, linux-kernel

On Wed, Aug 06, 2014 at 01:31:46PM -0700, Joe Perches wrote:
> On Wed, 2014-08-06 at 23:13 +0300, Dan Carpenter wrote:
> > On Wed, Aug 06, 2014 at 10:42:55PM +0530, Srikrishan Malik wrote:
> > > diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
> []
> > > @@ -71,7 +71,7 @@ int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
> > >  			    __u64 bits)
> > >  {
> > >  	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
> > > -	ldlm_policy_data_t policy = {{0}};
> > > +	ldlm_policy_data_t policy = {{0} };
> > 
> > That's odd.  Since when is a space required here?  Anyway, put one at
> > the start too if you're goind to do that.  Or you could do it like:
> > 
> > 	ldlm_policy_data_t policy = {};
> > 
> > ?
> 
> It comes from a pretty old bit of checkpatch:
> 
> de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3706) # closing brace should have a space following it when it has anything
> de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3707) # on the line
> de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3708)                if ($line =~ /}(?!(?:,|;|\)))\S/) {
> 
> Maybe it should have an } added to the test like:
> 
> if ($line =~ /}(?!(?:,|;|\)|}))\S/) {
>

Yes.  It feels like '}}' is common.

Also it should ignore \. because this used for:

ERROR: space required after that close brace '}'
#118: FILE: ./drivers/gpu/drm/nouveau/core/engine/disp/nva3.c:118:
+}.base.base;

Otherwise this test is legit and complains about bad typedefs and
'}else{' statements.

regards,
dan carpenter

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

* Re: [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces.
  2014-08-06 20:45       ` Dan Carpenter
@ 2014-08-06 21:26         ` Joe Perches
  0 siblings, 0 replies; 27+ messages in thread
From: Joe Perches @ 2014-08-06 21:26 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Andy Whitcroft, Srikrishan Malik, greg, andreas.dilger,
	oleg.drokin, devel, linux-kernel

On Wed, 2014-08-06 at 23:45 +0300, Dan Carpenter wrote:
> On Wed, Aug 06, 2014 at 01:31:46PM -0700, Joe Perches wrote:
> > On Wed, 2014-08-06 at 23:13 +0300, Dan Carpenter wrote:
> > > On Wed, Aug 06, 2014 at 10:42:55PM +0530, Srikrishan Malik wrote:
> > > > diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
> > []
> > > > @@ -71,7 +71,7 @@ int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
> > > >  			    __u64 bits)
> > > >  {
> > > >  	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
> > > > -	ldlm_policy_data_t policy = {{0}};
> > > > +	ldlm_policy_data_t policy = {{0} };
> > > 
> > > That's odd.  Since when is a space required here?  Anyway, put one at
> > > the start too if you're goind to do that.  Or you could do it like:
> > > 
> > > 	ldlm_policy_data_t policy = {};
> > > 
> > > ?
> > 
> > It comes from a pretty old bit of checkpatch:
> > 
> > de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3706) # closing brace should have a space following it when it has anything
> > de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3707) # on the line
> > de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3708)                if ($line =~ /}(?!(?:,|;|\)))\S/) {
> > 
> > Maybe it should have an } added to the test like:
> > 
> > if ($line =~ /}(?!(?:,|;|\)|}))\S/) {
> >
> 
> Yes.  It feels like '}}' is common.

I think so too.  Also, there isn't an equivalent
test for '{{' so warning on '}}' seems silly.

> Also it should ignore \. because this used for:
> 
> ERROR: space required after that close brace '}'
> #118: FILE: ./drivers/gpu/drm/nouveau/core/engine/disp/nva3.c:118:
> +}.base.base;
> 
> Otherwise this test is legit and complains about bad typedefs and
> '}else{' statements.

I don't think \. should be added myself.

Only nouveau uses that style.

I think all of those nouveau uses are not
very nice and they should be changed instead
or the warnings should just be ignored there.

Andy?


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

* Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-06 20:18   ` Dan Carpenter
@ 2014-08-07 15:31     ` Srikrishan Malik
  2014-08-07 16:01       ` Dan Carpenter
  0 siblings, 1 reply; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-07 15:31 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: greg, andreas.dilger, oleg.drokin, devel, linux-kernel

On Wed, Aug 06, 2014 at 11:18:13PM +0300, Dan Carpenter wrote:
> On Wed, Aug 06, 2014 at 10:43:00PM +0530, Srikrishan Malik wrote:
> > diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
> > index c03d77c9c5b8..09209171b50c 100644
> > --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
> > +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
> > @@ -785,12 +785,12 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
> >  	__u64		  flags, saved_flags = extra_lock_flags;
> >  	int		    rc;
> >  	struct ldlm_res_id res_id;
> > -	static const ldlm_policy_data_t lookup_policy =
> > -			    { .l_inodebits = { MDS_INODELOCK_LOOKUP } };
> > -	static const ldlm_policy_data_t update_policy =
> > -			    { .l_inodebits = { MDS_INODELOCK_UPDATE } };
> > -	static const ldlm_policy_data_t layout_policy =
> > -			    { .l_inodebits = { MDS_INODELOCK_LAYOUT } };
> > +	static const ldlm_policy_data_t lookup_policy = {
> > +				.l_inodebits = { MDS_INODELOCK_LOOKUP } };
> > +	static const ldlm_policy_data_t update_policy = {
> > +				.l_inodebits = { MDS_INODELOCK_UPDATE } };
> > +	static const ldlm_policy_data_t layout_policy = {
> > +				.l_inodebits = { MDS_INODELOCK_LAYOUT } };
> >  	static const ldlm_policy_data_t getxattr_policy = {
> >  			      .l_inodebits = { MDS_INODELOCK_XATTR } };
> >  	ldlm_policy_data_t const *policy = &lookup_policy;
> 
> That looks silly before and after.  Everything is indented in a funny
> way.

Is this better:

	static const ldlm_policy_data_t lookup_policy = {                       
				.l_inodebits = { MDS_INODELOCK_LOOKUP }         
	};

> 
> regards,
> dan carpenter

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

* Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-07 15:31     ` Srikrishan Malik
@ 2014-08-07 16:01       ` Dan Carpenter
  2014-08-07 16:35         ` Joe Perches
  0 siblings, 1 reply; 27+ messages in thread
From: Dan Carpenter @ 2014-08-07 16:01 UTC (permalink / raw)
  To: Srikrishan Malik, greg, andreas.dilger, oleg.drokin, devel, linux-kernel

On Thu, Aug 07, 2014 at 09:01:36PM +0530, Srikrishan Malik wrote:
> On Wed, Aug 06, 2014 at 11:18:13PM +0300, Dan Carpenter wrote:
> > That looks silly before and after.  Everything is indented in a funny
> > way.
> 
> Is this better:
> 
> 	static const ldlm_policy_data_t lookup_policy = {
> 				.l_inodebits = { MDS_INODELOCK_LOOKUP }
> 	};
> 

That is indented too far.

Honestly, I think it looks best on one line but in terms of real life we
can't ignore checkpatch warnings because eventually someone else will
try to "fix" it to not be on one line.

This function has the silly thing where the types are in one column and
the variables are in another.  But then over time inevitably we add more
variables and nothing is lined up any more.

I think it's best to move this const variable block to the very front of
the list.

req doesn't need to be initialized.

rc is normally the last variable declared.

lvb_type should be initialized to LVB_T_NONE instead of zero.

__u64 should be u64.

All those changes could be done as one patch titled, "cleanup variable
declarations in mdc_enqueue()".  There may be other cleanups you could
do as well.  Look hard.

regards,
dan carpenter


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

* Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-07 16:01       ` Dan Carpenter
@ 2014-08-07 16:35         ` Joe Perches
  2014-08-11 10:57           ` Srikrishan Malik
  0 siblings, 1 reply; 27+ messages in thread
From: Joe Perches @ 2014-08-07 16:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Srikrishan Malik, greg, andreas.dilger, oleg.drokin, devel, linux-kernel

On Thu, 2014-08-07 at 19:01 +0300, Dan Carpenter wrote:
> On Thu, Aug 07, 2014 at 09:01:36PM +0530, Srikrishan Malik wrote:
> > On Wed, Aug 06, 2014 at 11:18:13PM +0300, Dan Carpenter wrote:
> > > That looks silly before and after.  Everything is indented in a funny
> > > way.
> > 
> > Is this better:
> > 
> > 	static const ldlm_policy_data_t lookup_policy = {
> > 				.l_inodebits = { MDS_INODELOCK_LOOKUP }
> > 	};
> > 
> 
> That is indented too far.
> 
> Honestly, I think it looks best on one line but in terms of real life we
> can't ignore checkpatch warnings because eventually someone else will
> try to "fix" it to not be on one line.
> 
> This function has the silly thing where the types are in one column and
> the variables are in another.  But then over time inevitably we add more
> variables and nothing is lined up any more.
> 
> I think it's best to move this const variable block to the very front of
> the list.
> 
> req doesn't need to be initialized.
> 
> rc is normally the last variable declared.
> 
> lvb_type should be initialized to LVB_T_NONE instead of zero.
> 
> __u64 should be u64.
> 
> All those changes could be done as one patch titled, "cleanup variable
> declarations in mdc_enqueue()".  There may be other cleanups you could
> do as well.  Look hard.

I think it looks odd to mix named and unnamed
initializers for the typedef and its members.

ldlm_policy_data_t is a union and it could be
explicit instead of a typedef.

Perhaps:
	static const union ldlm_policy_data lookup_policy = {
		.l_inodebits = {
			.bits = MDS_INODELOCK_LOOKUP,
		},
	};

or maybe use another DECLARE_<foo> macro indirection.



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

* Re: [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis
  2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
                   ` (10 preceding siblings ...)
  2014-08-06 17:13 ` [PATCH 12/12] staging: lustre: remove parentheses usage with return Srikrishan Malik
@ 2014-08-10  4:32 ` Greg KH
  2014-08-10 14:43   ` Srikrishan Malik
  11 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2014-08-10  4:32 UTC (permalink / raw)
  To: Srikrishan Malik; +Cc: andreas.dilger, oleg.drokin, devel, linux-kernel

On Wed, Aug 06, 2014 at 10:42:51PM +0530, Srikrishan Malik wrote:
> Fixes following checkpatch warning:
> 
> WARNING: space prohibited between function name and open parenthesis '('
> 
> Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>

Can you redo this whole series, based on the comments you have recieved?

thanks,

greg k-h

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

* Re: [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis
  2014-08-10  4:32 ` [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Greg KH
@ 2014-08-10 14:43   ` Srikrishan Malik
  0 siblings, 0 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-10 14:43 UTC (permalink / raw)
  To: Greg KH; +Cc: andreas.dilger, oleg.drokin, devel, linux-kernel

On Sat, Aug 09, 2014 at 09:32:22PM -0700, Greg KH wrote:
> On Wed, Aug 06, 2014 at 10:42:51PM +0530, Srikrishan Malik wrote:
> > Fixes following checkpatch warning:
> > 
> > WARNING: space prohibited between function name and open parenthesis '('
> > 
> > Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
> 
> Can you redo this whole series, based on the comments you have recieved?

Have been busy due to festivals.
I am planning to re-submit soon. 

> 
> thanks,
> 
> greg k-h

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

* Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-07 16:35         ` Joe Perches
@ 2014-08-11 10:57           ` Srikrishan Malik
  2014-08-11 11:36             ` Joe Perches
  2014-08-11 12:54             ` Dan Carpenter
  0 siblings, 2 replies; 27+ messages in thread
From: Srikrishan Malik @ 2014-08-11 10:57 UTC (permalink / raw)
  To: Joe Perches
  Cc: Dan Carpenter, greg, andreas.dilger, oleg.drokin, devel, linux-kernel

On Thu, Aug 07, 2014 at 09:35:43AM -0700, Joe Perches wrote:
> On Thu, 2014-08-07 at 19:01 +0300, Dan Carpenter wrote:
> > On Thu, Aug 07, 2014 at 09:01:36PM +0530, Srikrishan Malik wrote:
> > > On Wed, Aug 06, 2014 at 11:18:13PM +0300, Dan Carpenter wrote:
> > > > That looks silly before and after.  Everything is indented in a funny
> > > > way.
> > > 
> > > Is this better:
> > > 
> > > 	static const ldlm_policy_data_t lookup_policy = {
> > > 				.l_inodebits = { MDS_INODELOCK_LOOKUP }
> > > 	};
> > > 
> > 
> > That is indented too far.
> > 
> > Honestly, I think it looks best on one line but in terms of real life we
> > can't ignore checkpatch warnings because eventually someone else will
> > try to "fix" it to not be on one line.
> > 
> > This function has the silly thing where the types are in one column and
> > the variables are in another.  But then over time inevitably we add more
> > variables and nothing is lined up any more.
> > 
> > I think it's best to move this const variable block to the very front of
> > the list.
> > 
> > req doesn't need to be initialized.
> > 
> > rc is normally the last variable declared.
> > 
> > lvb_type should be initialized to LVB_T_NONE instead of zero.
> > 
> > __u64 should be u64.
> > 
> > All those changes could be done as one patch titled, "cleanup variable
> > declarations in mdc_enqueue()".  There may be other cleanups you could
> > do as well.  Look hard.
> 
> I think it looks odd to mix named and unnamed
> initializers for the typedef and its members.
> 
> ldlm_policy_data_t is a union and it could be
> explicit instead of a typedef.
> 
> Perhaps:
> 	static const union ldlm_policy_data lookup_policy = {
> 		.l_inodebits = {
> 			.bits = MDS_INODELOCK_LOOKUP,
> 		},
> 	};
> 
> or maybe use another DECLARE_<foo> macro indirection.
>

This patch set is aimed at removing checkpatch issues from files in
lustre/lustre/mdc.

Is it ok if I just fix those in this set and post another patch set
to take care of other issues identified in review?

- removing typedef for ldlm_policy_data_t will touch many other
files/dirs which were not initially targeted for this patch set.
- There can be a separate patch to remove __u64.


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

* Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-11 10:57           ` Srikrishan Malik
@ 2014-08-11 11:36             ` Joe Perches
  2014-08-11 14:21               ` Julia Lawall
  2014-08-11 12:54             ` Dan Carpenter
  1 sibling, 1 reply; 27+ messages in thread
From: Joe Perches @ 2014-08-11 11:36 UTC (permalink / raw)
  To: Srikrishan Malik
  Cc: Dan Carpenter, greg, andreas.dilger, oleg.drokin, devel,
	linux-kernel, Julia Lawall, Himangi Saraogi

On Mon, 2014-08-11 at 16:27 +0530, Srikrishan Malik wrote:
> On Thu, Aug 07, 2014 at 09:35:43AM -0700, Joe Perches wrote:
> > On Thu, 2014-08-07 at 19:01 +0300, Dan Carpenter wrote:
> > > On Thu, Aug 07, 2014 at 09:01:36PM +0530, Srikrishan Malik wrote:
> > > > On Wed, Aug 06, 2014 at 11:18:13PM +0300, Dan Carpenter wrote:
> > > > > That looks silly before and after.  Everything is indented in a funny
> > > > > way.
> > > > 
> > > > Is this better:
> > > > 
> > > > 	static const ldlm_policy_data_t lookup_policy = {
> > > > 				.l_inodebits = { MDS_INODELOCK_LOOKUP }
> > > > 	};
> > > > 
> > > 
> > > That is indented too far.
> > > 
> > > Honestly, I think it looks best on one line but in terms of real life we
> > > can't ignore checkpatch warnings because eventually someone else will
> > > try to "fix" it to not be on one line.
[]
> > I think it looks odd to mix named and unnamed
> > initializers for the typedef and its members.
> > 
> > ldlm_policy_data_t is a union and it could be
> > explicit instead of a typedef.
> > 
> > Perhaps:
> > 	static const union ldlm_policy_data lookup_policy = {
> > 		.l_inodebits = {
> > 			.bits = MDS_INODELOCK_LOOKUP,
> > 		},
> > 	};
> > 
> > or maybe use another DECLARE_<foo> macro indirection.
> >
> 
> This patch set is aimed at removing checkpatch issues from files in
> lustre/lustre/mdc.

I think eliminating checkpatch identified issues should
not be the primary goal but a secondary one to the
overall goal of code style uniformity.

Julia Lawall and Himangi Saraogi from coccinelle fame
have created a "detypedef" script that is useful for
structs, perhaps you could extend it for unions and
run it over this lustre code.

For instance:
https://lkml.org/lkml/2014/8/9/104

> Is it ok if I just fix those in this set and post another patch set
> to take care of other issues identified in review?

Up to you.



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

* Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-11 10:57           ` Srikrishan Malik
  2014-08-11 11:36             ` Joe Perches
@ 2014-08-11 12:54             ` Dan Carpenter
  1 sibling, 0 replies; 27+ messages in thread
From: Dan Carpenter @ 2014-08-11 12:54 UTC (permalink / raw)
  To: Srikrishan Malik, Joe Perches, greg, andreas.dilger, oleg.drokin,
	devel, linux-kernel

On Mon, Aug 11, 2014 at 04:27:06PM +0530, Srikrishan Malik wrote:
> This patch set is aimed at removing checkpatch issues from files in
> lustre/lustre/mdc.
> 
> Is it ok if I just fix those in this set and post another patch set
> to take care of other issues identified in review?

checkpatch fixes are worthless if they don't make the code better for
human readers.

> 
> - removing typedef for ldlm_policy_data_t will touch many other
> files/dirs which were not initially targeted for this patch set.

Yeah.  You're right.  This should be done in a separate patch because
it doesn't completely fall under the "cleanup variable declarations in
mdc_enqueue()" header.

> - There can be a separate patch to remove __u64.

It's all part of the same thing "variable declarations in that
function."

regards,
dan carpenter

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

* Re: [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings
  2014-08-11 11:36             ` Joe Perches
@ 2014-08-11 14:21               ` Julia Lawall
  0 siblings, 0 replies; 27+ messages in thread
From: Julia Lawall @ 2014-08-11 14:21 UTC (permalink / raw)
  To: Joe Perches
  Cc: Srikrishan Malik, Dan Carpenter, greg, andreas.dilger,
	oleg.drokin, devel, linux-kernel, Julia Lawall, Himangi Saraogi



On Mon, 11 Aug 2014, Joe Perches wrote:

> On Mon, 2014-08-11 at 16:27 +0530, Srikrishan Malik wrote:
> > On Thu, Aug 07, 2014 at 09:35:43AM -0700, Joe Perches wrote:
> > > On Thu, 2014-08-07 at 19:01 +0300, Dan Carpenter wrote:
> > > > On Thu, Aug 07, 2014 at 09:01:36PM +0530, Srikrishan Malik wrote:
> > > > > On Wed, Aug 06, 2014 at 11:18:13PM +0300, Dan Carpenter wrote:
> > > > > > That looks silly before and after.  Everything is indented in a funny
> > > > > > way.
> > > > >
> > > > > Is this better:
> > > > >
> > > > > 	static const ldlm_policy_data_t lookup_policy = {
> > > > > 				.l_inodebits = { MDS_INODELOCK_LOOKUP }
> > > > > 	};
> > > > >
> > > >
> > > > That is indented too far.
> > > >
> > > > Honestly, I think it looks best on one line but in terms of real life we
> > > > can't ignore checkpatch warnings because eventually someone else will
> > > > try to "fix" it to not be on one line.
> []
> > > I think it looks odd to mix named and unnamed
> > > initializers for the typedef and its members.
> > >
> > > ldlm_policy_data_t is a union and it could be
> > > explicit instead of a typedef.
> > >
> > > Perhaps:
> > > 	static const union ldlm_policy_data lookup_policy = {
> > > 		.l_inodebits = {
> > > 			.bits = MDS_INODELOCK_LOOKUP,
> > > 		},
> > > 	};
> > >
> > > or maybe use another DECLARE_<foo> macro indirection.
> > >
> >
> > This patch set is aimed at removing checkpatch issues from files in
> > lustre/lustre/mdc.
>
> I think eliminating checkpatch identified issues should
> not be the primary goal but a secondary one to the
> overall goal of code style uniformity.
>
> Julia Lawall and Himangi Saraogi from coccinelle fame
> have created a "detypedef" script that is useful for
> structs, perhaps you could extend it for unions and
> run it over this lustre code.
>
> For instance:
> https://lkml.org/lkml/2014/8/9/104

The complete semantic patch is below.  It is in two parts: first for the
case where there is a name for the struct and the second for the case
where there is not.  The code could be extended to automatically drop the
_t's that are commonly put on typedefs.

julia

@tn@
identifier i;
type td;
@@

-typedef
 struct i { ... }
-td
 ;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

// ----------------------------------------------------------------------
// No name case

@tn1@
type td;
@@

typedef struct { ... } td;

@script:python tf@
td << tn1.td;
tdres;
@@

coccinelle.tdres = td

@@
type tn1.td;
identifier tf.tdres;
@@

-typedef
 struct
+  tdres
   { ... }
-td
 ;

@@
type tn1.td;
identifier tf.tdres;
@@

-td
+ struct tdres

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

end of thread, other threads:[~2014-08-11 14:21 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
2014-08-06 17:12 ` [PATCH 02/12] staging: lustre: remove spaces from start of line Srikrishan Malik
2014-08-06 17:12 ` [PATCH 03/12] staging: lustre: move open brace to next line after functions Srikrishan Malik
2014-08-06 17:12 ` [PATCH 04/12] staging: lustre: fix lines over 80 chars Srikrishan Malik
2014-08-06 17:12 ` [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces Srikrishan Malik
2014-08-06 20:13   ` Dan Carpenter
2014-08-06 20:31     ` Joe Perches
2014-08-06 20:45       ` Dan Carpenter
2014-08-06 21:26         ` Joe Perches
2014-08-06 17:12 ` [PATCH 06/12] staging: lustre: replace c99 style comments with C89 Srikrishan Malik
2014-08-06 20:15   ` Dan Carpenter
2014-08-06 17:12 ` [PATCH 07/12] staging: lustre: add blank lines after declarations Srikrishan Malik
2014-08-06 17:12 ` [PATCH 08/12] staging: lustre: fix multi line strings Srikrishan Malik
2014-08-06 17:12 ` [PATCH 09/12] staging: lustre: Added space between type name and * Srikrishan Malik
2014-08-06 17:13 ` [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings Srikrishan Malik
2014-08-06 20:18   ` Dan Carpenter
2014-08-07 15:31     ` Srikrishan Malik
2014-08-07 16:01       ` Dan Carpenter
2014-08-07 16:35         ` Joe Perches
2014-08-11 10:57           ` Srikrishan Malik
2014-08-11 11:36             ` Joe Perches
2014-08-11 14:21               ` Julia Lawall
2014-08-11 12:54             ` Dan Carpenter
2014-08-06 17:13 ` [PATCH 11/12] staging: lustre: move else on the same line as closing brace Srikrishan Malik
2014-08-06 17:13 ` [PATCH 12/12] staging: lustre: remove parentheses usage with return Srikrishan Malik
2014-08-10  4:32 ` [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Greg KH
2014-08-10 14:43   ` Srikrishan Malik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.