staging: lustre: Fix multiple checkpatch warnings
v2 cover staging: lustre: Fix multiple checkpatch warnings
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(-)
Signature · 1 line
2.7.4
PATCH v2 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
@@ -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
@@ -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
PATCH v2 2/6 staging: lustre: Fix block comment style
In reply to Rehas SachdevaFixes 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
@@ -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
PATCH v2 3/6 staging: lustre: Change 'unsigned' to 'unsigned int'
In reply to Rehas SachdevaFixes checkpatch.pl warning:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
--- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +4 -4
@@ -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; };
Signature · 1 line
2.7.4
PATCH v2 4/6 staging: lustre: Change 'seq_printf' to 'seq_puts'
In reply to Rehas SachdevaFixes 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
@@ -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
PATCH v2 5/6 staging: lustre: Remove unnecessary 'return'
In reply to Rehas SachdevaRemove unnecessary void return at the end of a function. Issue detected by checkpatch.
---
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(-)
drivers/staging/lustre/lustre/llite/rw.c +0 -2
@@ -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
Re: [Outreachy kernel] [PATCH v2 5/6] staging: lustre: Remove unnecessary 'return'
Quoted 2 lines · Rehas Sachdeva
Remove unnecessary void return at the end of a function. Issue detected by checkpatch.
This commit message looks ok.
julia
Quoted 40 lines
Signed-off-by Rehas Sachdeva <[email protected]>---
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(-)drivers/staging/lustre/lustre/llite/rw.c +0
-3@@ -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.1473942874.git.aquannie%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
PATCH v2 6/6 staging: lustre: Fix indentation
In reply to Rehas SachdevaFixes 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
@@ -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
@@ -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