public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: lustre: fix all braces issues reported by checkpatch
@ 2017-07-15 15:39 James Simmons
  2017-07-15 15:52 ` Joe Perches
  2017-07-17 12:27 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: James Simmons @ 2017-07-15 15:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Cleanup all braces that was reported by checkpatch. The only
issue not fixed up is in mdc_lock.c. Removing the braces in
the case of mdc_lock.c will break the build.

Signed-off-by: James Simmons <jsimmons@infradead.org>
------------------------------------------------------------------
v1) Initial patch
v2) Rebased against latest staging-next tree
---
 drivers/staging/lustre/lustre/fld/fld_cache.c  | 3 ++-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 9 +++++----
 drivers/staging/lustre/lustre/llite/vvp_dev.c  | 5 +++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c b/drivers/staging/lustre/lustre/fld/fld_cache.c
index b852fed..adaa094 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -348,9 +348,10 @@ static void fld_cache_overlap_handle(struct fld_cache *cache,
 
 		f_curr->fce_range.lsr_end = new_start;
 		fld_cache_entry_add(cache, f_new, &f_curr->fce_list);
-	} else
+	} else {
 		CERROR("NEW range =" DRANGE " curr = " DRANGE "\n",
 		       PRANGE(range), PRANGE(&f_curr->fce_range));
+	}
 }
 
 struct fld_cache_entry
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index ddb4642..181025d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -1029,11 +1029,11 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct list_head *work_list)
 	if (work_list && lock->l_completion_ast)
 		ldlm_add_ast_work_item(lock, NULL, work_list);
 
-	if (res->lr_type == LDLM_PLAIN || res->lr_type == LDLM_IBITS)
+	if (res->lr_type == LDLM_PLAIN || res->lr_type == LDLM_IBITS) {
 		ldlm_grant_lock_with_skiplist(lock);
-	else if (res->lr_type == LDLM_EXTENT)
+	} else if (res->lr_type == LDLM_EXTENT) {
 		ldlm_extent_add_lock(res, lock);
-	else if (res->lr_type == LDLM_FLOCK) {
+	} else if (res->lr_type == LDLM_FLOCK) {
 		/*
 		 * We should not add locks to granted list in the following cases:
 		 * - this is an UNLOCK but not a real lock;
@@ -1045,8 +1045,9 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct list_head *work_list)
 		    ldlm_is_test_lock(lock) || ldlm_is_flock_deadlock(lock))
 			return;
 		ldlm_resource_add_lock(res, &res->lr_granted, lock);
-	} else
+	} else {
 		LBUG();
+	}
 
 	ldlm_pool_add(&ldlm_res_to_ns(res)->ns_pool, lock);
 }
diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index 8e45672..2b60699 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -591,9 +591,10 @@ static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos)
 	env = cl_env_get(&refcheck);
 	if (!IS_ERR(env)) {
 		sbi = f->private;
-		if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT)
+		if (sbi->ll_site->ls_obj_hash->hs_cur_bits >
+		    64 - PGC_OBJ_SHIFT) {
 			pos = ERR_PTR(-EFBIG);
-		else {
+		} else {
 			*pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev,
 						*pos);
 			if (*pos == ~0ULL)
-- 
1.8.3.1

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

* Re: [PATCH] staging: lustre: lustre: fix all braces issues reported by checkpatch
  2017-07-15 15:39 [PATCH] staging: lustre: lustre: fix all braces issues reported by checkpatch James Simmons
@ 2017-07-15 15:52 ` Joe Perches
  2017-07-15 23:00   ` James Simmons
  2017-07-17 12:27 ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Joe Perches @ 2017-07-15 15:52 UTC (permalink / raw)
  To: James Simmons, Greg Kroah-Hartman, devel, Andreas Dilger,
	Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List

On Sat, 2017-07-15 at 11:39 -0400, James Simmons wrote:
> Cleanup all braces that was reported by checkpatch. The only
> issue not fixed up is in mdc_lock.c. Removing the braces in
> the case of mdc_lock.c will break the build.

what checkpatch warning in mdc_locks.c is that?

$ ./scripts/checkpatch.pl -f --terse --nosummary drivers/staging/lustre/lustre/mdc/mdc_locks.c 
drivers/staging/lustre/lustre/mdc/mdc_locks.c:590: WARNING: line over 80 characters
drivers/staging/lustre/lustre/mdc/mdc_locks.c:600: WARNING: line over 80 characters
drivers/staging/lustre/lustre/mdc/mdc_locks.c:637: WARNING: line over 80 characters

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

* Re: [PATCH] staging: lustre: lustre: fix all braces issues reported by checkpatch
  2017-07-15 15:52 ` Joe Perches
@ 2017-07-15 23:00   ` James Simmons
  0 siblings, 0 replies; 4+ messages in thread
From: James Simmons @ 2017-07-15 23:00 UTC (permalink / raw)
  To: Joe Perches
  Cc: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin,
	Linux Kernel Mailing List, Lustre Development List

[-- Attachment #1: Type: text/plain, Size: 953 bytes --]


> On Sat, 2017-07-15 at 11:39 -0400, James Simmons wrote:
> > Cleanup all braces that was reported by checkpatch. The only
> > issue not fixed up is in mdc_lock.c. Removing the braces in
> > the case of mdc_lock.c will break the build.
> 
> what checkpatch warning in mdc_locks.c is that?
> 
> $ ./scripts/checkpatch.pl -f --terse --nosummary drivers/staging/lustre/lustre/mdc/mdc_locks.c 
> drivers/staging/lustre/lustre/mdc/mdc_locks.c:590: WARNING: line over 80 characters
> drivers/staging/lustre/lustre/mdc/mdc_locks.c:600: WARNING: line over 80 characters
> drivers/staging/lustre/lustre/mdc/mdc_locks.c:637: WARNING: line over 80 characters

For 4.11-xxx kernels I was seeing

WARNING: braces {} are not necessary for any arm of this statement
#914: FILE: drivers/staging/lustre/lustre/mdc/mdc_locks.c:914:
+       if (it->it_op & IT_CREAT) {
[...]
+       } else if (it->it_op == IT_OPEN) {
[...]
+       } else {
[...]

Now it doesn't show up.

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

* Re: [PATCH] staging: lustre: lustre: fix all braces issues reported by checkpatch
  2017-07-15 15:39 [PATCH] staging: lustre: lustre: fix all braces issues reported by checkpatch James Simmons
  2017-07-15 15:52 ` Joe Perches
@ 2017-07-17 12:27 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-17 12:27 UTC (permalink / raw)
  To: James Simmons
  Cc: devel, Andreas Dilger, Oleg Drokin, Linux Kernel Mailing List,
	Lustre Development List

On Sat, Jul 15, 2017 at 11:39:22AM -0400, James Simmons wrote:
> Cleanup all braces that was reported by checkpatch. The only
> issue not fixed up is in mdc_lock.c. Removing the braces in
> the case of mdc_lock.c will break the build.
> 
> Signed-off-by: James Simmons <jsimmons@infradead.org>
> ------------------------------------------------------------------
> v1) Initial patch
> v2) Rebased against latest staging-next tree

Those lines go below:

> ---

That line.

I'll edit it by hand this time...

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

end of thread, other threads:[~2017-07-17 12:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-15 15:39 [PATCH] staging: lustre: lustre: fix all braces issues reported by checkpatch James Simmons
2017-07-15 15:52 ` Joe Perches
2017-07-15 23:00   ` James Simmons
2017-07-17 12:27 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox