All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] staging: lustre: Fix multiple checkpatch warnings
@ 2016-09-15 12:48 Rehas Sachdeva
  2016-09-15 12:50 ` [PATCH v2 1/6] staging: lustre: Add space b/w concatenated strings Rehas Sachdeva
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 12:48 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman

Change in Version 2:
Elaborate commit message for patch: Remove unnecessary 'return'.

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(-)

-- 
2.7.4



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

* [PATCH v2 1/6] staging: lustre: Add space b/w concatenated strings
  2016-09-15 12:48 [PATCH v2 0/6] staging: lustre: Fix multiple checkpatch warnings Rehas Sachdeva
@ 2016-09-15 12:50 ` Rehas Sachdeva
  2016-09-15 12:51 ` [PATCH v2 2/6] staging: lustre: Fix block comment style Rehas Sachdeva
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 12:50 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman

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

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
 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(-)

diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c
index 454744d..edd72b9 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -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;
diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c
index 81b7ca9..3ed32d7 100644
--- a/drivers/staging/lustre/lustre/fid/lproc_fid.c
+++ b/drivers/staging/lustre/lustre/fid/lproc_fid.c
@@ -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));
 	}
 
-- 
2.7.4



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

* [PATCH v2 2/6] staging: lustre: Fix block comment style
  2016-09-15 12:48 [PATCH v2 0/6] staging: lustre: Fix multiple checkpatch warnings Rehas Sachdeva
  2016-09-15 12:50 ` [PATCH v2 1/6] staging: lustre: Add space b/w concatenated strings Rehas Sachdeva
@ 2016-09-15 12:51 ` Rehas Sachdeva
  2016-09-15 12:51 ` [PATCH v2 3/6] staging: lustre: Change 'unsigned' to 'unsigned int' Rehas Sachdeva
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 12:51 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman

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

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 1dc8d21..f4364f9 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -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)
-- 
2.7.4



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

* [PATCH v2 3/6] staging: lustre: Change 'unsigned' to 'unsigned int'
  2016-09-15 12:48 [PATCH v2 0/6] staging: lustre: Fix multiple checkpatch warnings Rehas Sachdeva
  2016-09-15 12:50 ` [PATCH v2 1/6] staging: lustre: Add space b/w concatenated strings Rehas Sachdeva
  2016-09-15 12:51 ` [PATCH v2 2/6] staging: lustre: Fix block comment style Rehas Sachdeva
@ 2016-09-15 12:51 ` Rehas Sachdeva
  2016-09-15 12:52 ` [PATCH v2 4/6] staging: lustre: Change 'seq_printf' to 'seq_puts' Rehas Sachdeva
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 12:51 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman

Fixes checkpatch.pl warning:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index e2c2587..62d9f6f 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -449,8 +449,8 @@ static unsigned ldlm_res_hop_hash(struct cfs_hash *hs,
 				  const void *key, unsigned mask)
 {
 	const struct ldlm_res_id     *id  = key;
-	unsigned		val = 0;
-	unsigned		i;
+	unsigned int		val = 0;
+	unsigned int		i;
 
 	for (i = 0; i < RES_NAME_SIZE; i++)
 		val += id->name[i];
@@ -561,9 +561,9 @@ static struct cfs_hash_ops ldlm_ns_fid_hash_ops = {
 struct ldlm_ns_hash_def {
 	enum ldlm_ns_type nsd_type;
 	/** hash bucket bits */
-	unsigned	nsd_bkt_bits;
+	unsigned int	nsd_bkt_bits;
 	/** hash bits */
-	unsigned	nsd_all_bits;
+	unsigned int	nsd_all_bits;
 	/** hash operations */
 	struct cfs_hash_ops *nsd_hops;
 };
-- 
2.7.4



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

* [PATCH v2 4/6] staging: lustre: Change 'seq_printf' to 'seq_puts'
  2016-09-15 12:48 [PATCH v2 0/6] staging: lustre: Fix multiple checkpatch warnings Rehas Sachdeva
                   ` (2 preceding siblings ...)
  2016-09-15 12:51 ` [PATCH v2 3/6] staging: lustre: Change 'unsigned' to 'unsigned int' Rehas Sachdeva
@ 2016-09-15 12:52 ` Rehas Sachdeva
  2016-09-15 12:52 ` [PATCH v2 5/6] staging: lustre: Remove unnecessary 'return' Rehas Sachdeva
  2016-09-15 12:53 ` [PATCH v2 6/6] staging: lustre: Fix indentation Rehas Sachdeva
  5 siblings, 0 replies; 8+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 12:52 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman

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.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 4e82db8..af233ea 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -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;
 }
 
-- 
2.7.4



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

* [PATCH v2 5/6] staging: lustre: Remove unnecessary 'return'
  2016-09-15 12:48 [PATCH v2 0/6] staging: lustre: Fix multiple checkpatch warnings Rehas Sachdeva
                   ` (3 preceding siblings ...)
  2016-09-15 12:52 ` [PATCH v2 4/6] staging: lustre: Change 'seq_printf' to 'seq_puts' Rehas Sachdeva
@ 2016-09-15 12:52 ` Rehas Sachdeva
  2016-09-15 13:01   ` [Outreachy kernel] " Julia Lawall
  2016-09-15 12:53 ` [PATCH v2 6/6] staging: lustre: Fix indentation Rehas Sachdeva
  5 siblings, 1 reply; 8+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 12:52 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman

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

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
Change in v2:
Edit the commit message to include what change was made rather than simply
stating the fix.

 drivers/staging/lustre/lustre/llite/rw.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c
index bb85d16..23747fa 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -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



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

* [PATCH v2 6/6] staging: lustre: Fix indentation
  2016-09-15 12:48 [PATCH v2 0/6] staging: lustre: Fix multiple checkpatch warnings Rehas Sachdeva
                   ` (4 preceding siblings ...)
  2016-09-15 12:52 ` [PATCH v2 5/6] staging: lustre: Remove unnecessary 'return' Rehas Sachdeva
@ 2016-09-15 12:53 ` Rehas Sachdeva
  5 siblings, 0 replies; 8+ messages in thread
From: Rehas Sachdeva @ 2016-09-15 12:53 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman

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

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
---
 drivers/staging/lustre/lustre/llite/file.c | 2 +-
 drivers/staging/lustre/lustre/llite/rw.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index e2e81bf..bfac6dd 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -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;
 	}
diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c
index 23747fa..25de3bf 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -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)
-- 
2.7.4



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

* Re: [Outreachy kernel] [PATCH v2 5/6] staging: lustre: Remove unnecessary 'return'
  2016-09-15 12:52 ` [PATCH v2 5/6] staging: lustre: Remove unnecessary 'return' Rehas Sachdeva
@ 2016-09-15 13:01   ` Julia Lawall
  0 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2016-09-15 13:01 UTC (permalink / raw)
  To: Rehas Sachdeva
  Cc: outreachy-kernel, Oleg Drokin, Andreas Dilger, James Simmons,
	Greg Kroah-Hartman



On Thu, 15 Sep 2016, Rehas Sachdeva wrote:

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

This commit message looks ok.

julia

>
> Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
> ---
> Change in v2:
> Edit the commit message to include what change was made rather than simply
> stating the fix.
>
>  drivers/staging/lustre/lustre/llite/rw.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c
> index bb85d16..23747fa 100644
> --- a/drivers/staging/lustre/lustre/llite/rw.c
> +++ b/drivers/staging/lustre/lustre/llite/rw.c
> @@ -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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/bfedf0128abd4c08512b015481be1d5fd1d0d01e.1473942874.git.aquannie%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2016-09-15 13:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 12:48 [PATCH v2 0/6] staging: lustre: Fix multiple checkpatch warnings Rehas Sachdeva
2016-09-15 12:50 ` [PATCH v2 1/6] staging: lustre: Add space b/w concatenated strings Rehas Sachdeva
2016-09-15 12:51 ` [PATCH v2 2/6] staging: lustre: Fix block comment style Rehas Sachdeva
2016-09-15 12:51 ` [PATCH v2 3/6] staging: lustre: Change 'unsigned' to 'unsigned int' Rehas Sachdeva
2016-09-15 12:52 ` [PATCH v2 4/6] staging: lustre: Change 'seq_printf' to 'seq_puts' Rehas Sachdeva
2016-09-15 12:52 ` [PATCH v2 5/6] staging: lustre: Remove unnecessary 'return' Rehas Sachdeva
2016-09-15 13:01   ` [Outreachy kernel] " Julia Lawall
2016-09-15 12:53 ` [PATCH v2 6/6] staging: lustre: Fix indentation Rehas Sachdeva

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.