Skip to contentSkip to conversation

staging: lustre: Fix multiple checkpatch warnings

PATCH Superseded Rehas Sachdeva 3 participants 11 messages Sep 15, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover staging: lustre: Fix multiple checkpatch warnings

Fixes multiple checkpatch.pl warnings in lustre.

Rehas Sachdeva (6):
staging: lustre: Add space b/w concatenated strings
staging: lustre: Fix block comment style
staging: lustre: Change 'unsigned' to 'unsigned int'
staging: lustre: Change 'seq_printf' to 'seq_puts'
staging: lustre: Remove unnecessary 'return'
staging: lustre: Fix indentation

 drivers/staging/lustre/lustre/fid/fid_request.c    | 8 ++++----
 drivers/staging/lustre/lustre/fid/lproc_fid.c      | 2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 6 ++++--
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 8 ++++----
 drivers/staging/lustre/lustre/llite/file.c         | 2 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  | 2 +-
 drivers/staging/lustre/lustre/llite/rw.c           | 4 +---
 7 files changed, 16 insertions(+), 16 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/6 staging: lustre: Add space b/w concatenated strings

Fixes checkpatch.pl warning:
CHECK: Concatenated strings should use spaces between elements

---
 drivers/staging/lustre/lustre/fid/fid_request.c | 8 ++++----
 drivers/staging/lustre/lustre/fid/lproc_fid.c   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/lustre/lustre/fid/fid_request.c +4 -4
index 454744d..edd72b9 100644
@@ -125,19 +125,19 @@ static int seq_client_rpc(struct lu_client_seq *seq,
 
 	if (!range_is_sane(output)) {
 		CERROR("%s: Invalid range received from server: "
-		       DRANGE"\n", seq->lcs_name, PRANGE(output));
+		       DRANGE "\n", seq->lcs_name, PRANGE(output));
 		rc = -EINVAL;
 		goto out_req;
 	}
 
 	if (range_is_exhausted(output)) {
 		CERROR("%s: Range received from server is exhausted: "
-		       DRANGE"]\n", seq->lcs_name, PRANGE(output));
+		       DRANGE "]\n", seq->lcs_name, PRANGE(output));
 		rc = -EINVAL;
 		goto out_req;
 	}
 
-	CDEBUG_LIMIT(debug_mask, "%s: Allocated %s-sequence "DRANGE"]\n",
+	CDEBUG_LIMIT(debug_mask, "%s: Allocated %s-sequence " DRANGE "]\n",
 		     seq->lcs_name, opcname, PRANGE(output));
 
 out_req:
@@ -179,7 +179,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
 			       seq->lcs_name, rc);
 			return rc;
 		}
-		CDEBUG(D_INFO, "%s: New range - "DRANGE"\n",
+		CDEBUG(D_INFO, "%s: New range - " DRANGE "\n",
 		       seq->lcs_name, PRANGE(&seq->lcs_space));
 	} else {
 		rc = 0;
drivers/staging/lustre/lustre/fid/lproc_fid.c +1 -1
index 81b7ca9..3ed32d7 100644
@@ -105,7 +105,7 @@ ldebugfs_fid_space_seq_write(struct file *file,
 	rc = ldebugfs_fid_write_common(buffer, count, &seq->lcs_space);
 
 	if (rc == 0) {
-		CDEBUG(D_INFO, "%s: Space: "DRANGE"\n",
+		CDEBUG(D_INFO, "%s: Space: " DRANGE "\n",
 		       seq->lcs_name, PRANGE(&seq->lcs_space));
 	}
 
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/6] staging: lustre: Add space b/w concatenated strings

Quoted 8 lines · Rehas Sachdeva

Fixes checkpatch.pl warning:
CHECK: Concatenated strings should use spaces between elements

---
 drivers/staging/lustre/lustre/fid/fid_request.c | 8 ++++----
 drivers/staging/lustre/lustre/fid/lproc_fid.c   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

Why are you sending Lustre driver patches to the linux-usb mailing list?

totally confused,

greg k-h

#3 lore raw

Re: [PATCH 1/6] staging: lustre: Add space b/w concatenated strings

Quoted 10 lines · Greg Kroah-Hartman
Quoted 8 lines · Rehas Sachdeva

Fixes checkpatch.pl warning:
CHECK: Concatenated strings should use spaces between elements

---
 drivers/staging/lustre/lustre/fid/fid_request.c | 8 ++++----
 drivers/staging/lustre/lustre/fid/lproc_fid.c   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
Quoted 5 lines

Why are you sending Lustre driver patches to the linux-usb mailing list?

totally confused,

greg k-h

Hi Greg,

I'm really sorry. It was coming by default. And I must forgotten to remove it. Anyways I fixed it now.

I'll be more careful next time. Thanks for pointing out the mistake.

Rehas

#4 lore raw

PATCH 2/6 staging: lustre: Fix block comment style

In reply to Rehas Sachdeva

Fixes checkpatch.pl warning:
WARNING: Block comments use a trailing */ on a separate line.

---
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +4 -2
index 1dc8d21..f4364f9 100644
@@ -1410,7 +1410,8 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns,
 		 * That is, for shrinker policy we drop only
 		 * old locks, but additionally choose them by
 		 * their weight. Big extent locks will stay in
-		 * the cache. */
+		 * the cache.
+		 */
 		result = pf(ns, lock, unused, added, count);
 		if (result == LDLM_POLICY_KEEP_LOCK) {
 			lu_ref_del(&lock->l_reference,
@@ -1700,7 +1701,8 @@ static int ldlm_cli_hash_cancel_unused(struct cfs_hash *hs,
  * that have 0 readers/writers.
  *
  * If flags & LCF_LOCAL, throw the locks away without trying
- * to notify the server. */
+ * to notify the server.
+ */
 int ldlm_cli_cancel_unused(struct ldlm_namespace *ns,
 			   const struct ldlm_res_id *res_id,
 			   enum ldlm_cancel_flags flags, void *opaque)
Signature · 1 line
2.7.4
#5 lore raw

PATCH 4/6 staging: lustre: Change 'seq_printf' to 'seq_puts'

In reply to Rehas Sachdeva

Fixes checkpatch.pl warning: Prefer seq_puts to seq_printf. This can be done as both have same type of first two arguments in their function definition.

---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/lproc_llite.c +1 -1
index 4e82db8..af233ea 100644
@@ -774,7 +774,7 @@ static int ll_sbi_flags_seq_show(struct seq_file *m, void *v)
 		flags >>= 1;
 		++i;
 	}
-	seq_printf(m, "\b\n");
+	seq_puts(m, "\b\n");
 	return 0;
 }
 
Signature · 1 line
2.7.4
#6 lore raw

PATCH 5/6 staging: lustre: Remove unnecessary 'return'

In reply to Rehas Sachdeva

Fixes checkpatch.pl warning:
WARNING: void function return statements are not generally useful.

---
 drivers/staging/lustre/lustre/llite/rw.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/lustre/lustre/llite/rw.c +0 -2
index bb85d16..23747fa 100644
@@ -667,7 +667,6 @@ static void ras_update_stride_detector(struct ll_readahead_state *ras,
 	ras->ras_stride_length = stride_gap + ras->ras_consecutive_pages;
 
 	RAS_CDEBUG(ras);
-	return;
 }
 
 /* Stride Read-ahead window will be increased inc_len according to
@@ -883,7 +882,6 @@ out_unlock:
 	RAS_CDEBUG(ras);
 	ras->ras_request_index++;
 	spin_unlock(&ras->ras_lock);
-	return;
 }
 
 int ll_writepage(struct page *vmpage, struct writeback_control *wbc)
Signature · 1 line
2.7.4
#7 lore raw

Re: [Outreachy kernel] [PATCH 5/6] staging: lustre: Remove unnecessary 'return'

Quoted 2 lines · Rehas Sachdeva

Fixes checkpatch.pl warning:
WARNING: void function return statements are not generally useful.

It would be better to say what you did, rather than saying fix. Here you could say:

Remove unnecessary void return at the end of a function. Issue detected by checkpatch.

julia

Quoted 36 lines
---
 drivers/staging/lustre/lustre/llite/rw.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/lustre/lustre/llite/rw.c +0 -3
index bb85d16..23747fa 100644
@@ -667,7 +667,6 @@ static void ras_update_stride_detector(struct ll_readahead_state *ras,
 	ras->ras_stride_length = stride_gap + ras->ras_consecutive_pages;
 
 	RAS_CDEBUG(ras);
-	return;
 }
 
 /* Stride Read-ahead window will be increased inc_len according to
@@ -883,7 +882,6 @@ out_unlock:
 	RAS_CDEBUG(ras);
 	ras->ras_request_index++;
 	spin_unlock(&ras->ras_lock);
-	return;
 }
 
 int ll_writepage(struct page *vmpage, struct writeback_control *wbc)
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/bfedf0128abd4c08512b015481be1d5fd1d0d01e.1473923837.git.aquannie%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#8 lore raw

Re: [Outreachy kernel] [PATCH 5/6] staging: lustre: Remove unnecessary 'return'

Quoted 5 lines · Julia Lawall
Quoted 2 lines · Rehas Sachdeva

Fixes checkpatch.pl warning:
WARNING: void function return statements are not generally useful.

Quoted 8 lines

It would be better to say what you did, rather than saying fix. Here you could say:

Remove unnecessary void return at the end of a function. Issue detected by checkpatch.

julia

Right. Thanks for the feedback Julia. I'll change it right away and be more careful next time.

Rehas

Quoted 37 lines
Quoted 37 lines
---
 drivers/staging/lustre/lustre/llite/rw.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/lustre/lustre/llite/rw.c +0 -3
index bb85d16..23747fa 100644
@@ -667,7 +667,6 @@ static void ras_update_stride_detector(struct ll_readahead_state *ras,
 	ras->ras_stride_length = stride_gap + ras->ras_consecutive_pages;
 
 	RAS_CDEBUG(ras);
-	return;
 }
 
 /* Stride Read-ahead window will be increased inc_len according to
@@ -883,7 +882,6 @@ out_unlock:
 	RAS_CDEBUG(ras);
 	ras->ras_request_index++;
 	spin_unlock(&ras->ras_lock);
-	return;
 }
 
 int ll_writepage(struct page *vmpage, struct writeback_control *wbc)
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/bfedf0128abd4c08512b015481be1d5fd1d0d01e.1473923837.git.aquannie%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#9 lore raw

Re: [Outreachy kernel] [PATCH 5/6] staging: lustre: Remove unnecessary 'return'

In reply to Julia Lawall
Quoted 5 lines · Julia Lawall
Quoted 2 lines · Rehas Sachdeva

Fixes checkpatch.pl warning:
WARNING: void function return statements are not generally useful.

Quoted 8 lines

It would be better to say what you did, rather than saying fix. Here you could say:

Remove unnecessary void return at the end of a function. Issue detected by checkpatch.

julia

Hi Julia,
Please take a look at v2. Also please suggest if I should make similar changes to the commit messages on other patches in this patchset as well. Thanks.

Rehas

Quoted 37 lines
Quoted 37 lines
---
 drivers/staging/lustre/lustre/llite/rw.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/lustre/lustre/llite/rw.c +0 -3
index bb85d16..23747fa 100644
@@ -667,7 +667,6 @@ static void ras_update_stride_detector(struct ll_readahead_state *ras,
 	ras->ras_stride_length = stride_gap + ras->ras_consecutive_pages;
 
 	RAS_CDEBUG(ras);
-	return;
 }
 
 /* Stride Read-ahead window will be increased inc_len according to
@@ -883,7 +882,6 @@ out_unlock:
 	RAS_CDEBUG(ras);
 	ras->ras_request_index++;
 	spin_unlock(&ras->ras_lock);
-	return;
 }
 
 int ll_writepage(struct page *vmpage, struct writeback_control *wbc)
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/bfedf0128abd4c08512b015481be1d5fd1d0d01e.1473923837.git.aquannie%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#10 lore raw

PATCH 6/6 staging: lustre: Fix indentation

In reply to Rehas Sachdeva

Fixes checkpatch.pl warning: Statements should start on a tabstop.

---
 drivers/staging/lustre/lustre/llite/file.c | 2 +-
 drivers/staging/lustre/lustre/llite/rw.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/llite/file.c +1 -1
index e2e81bf..bfac6dd 100644
@@ -602,7 +602,7 @@ restart:
 	} else if (it->it_flags & FMODE_EXEC) {
 		och_p = &lli->lli_mds_exec_och;
 		och_usecount = &lli->lli_open_fd_exec_count;
-	 } else {
+	} else {
 		och_p = &lli->lli_mds_read_och;
 		och_usecount = &lli->lli_open_fd_read_count;
 	}
drivers/staging/lustre/lustre/llite/rw.c +1 -1
index 23747fa..25de3bf 100644
@@ -1022,7 +1022,7 @@ int ll_writepages(struct address_space *mapping, struct writeback_control *wbc)
 	if (result > 0) {
 		wbc->nr_to_write -= result;
 		result = 0;
-	 }
+	}
 
 	if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0)) {
 		if (end == OBD_OBJECT_EOF)
Signature · 1 line
2.7.4