public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging/zcache: Add braces for else, if 'if' had some
@ 2011-02-19  2:15 Peter Huewe
  2011-02-23 22:04 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Huewe @ 2011-02-19  2:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dan Magenheimer, Nitin Gupta, devel, linux-kernel, Peter Huewe

This patch fixes a Coding Style issue by adding needed braces for the
else branches, if the preceding 'if' branch had braces around it.

Rationale: CodingStyle.txt Section 3
KernelVersion: linux-next 20100219

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 drivers/staging/zcache/tmem.c   |    6 ++++--
 drivers/staging/zcache/tmem.h   |   10 ++++++----
 drivers/staging/zcache/zcache.c |    6 ++++--
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/zcache/tmem.c b/drivers/staging/zcache/tmem.c
index e954d40..a4bb57f 100644
--- a/drivers/staging/zcache/tmem.c
+++ b/drivers/staging/zcache/tmem.c
@@ -352,8 +352,9 @@ insert:
 
 				objnode->slots[offset] = slot;
 				objnode->slots_in_use++;
-			} else
+			} else {
 				obj->objnode_tree_root = slot;
+			}
 		}
 		/* go down a level */
 		offset = (index >> shift) & OBJNODE_TREE_MAP_MASK;
@@ -366,8 +367,9 @@ insert:
 	if (objnode) {
 		objnode->slots_in_use++;
 		objnode->slots[offset] = pampd;
-	} else
+	} else {
 		obj->objnode_tree_root = pampd;
+	}
 	obj->pampd_count++;
 out:
 	return ret;
diff --git a/drivers/staging/zcache/tmem.h b/drivers/staging/zcache/tmem.h
index 2e07e21..6d16386 100644
--- a/drivers/staging/zcache/tmem.h
+++ b/drivers/staging/zcache/tmem.h
@@ -113,14 +113,16 @@ static inline int tmem_oid_compare(struct tmem_oid *left,
 				ret = -1;
 			else
 				return 1;
-		} else if (left->oid[1] < right->oid[1])
+		} else if (left->oid[1] < right->oid[1]) {
 			ret = -1;
-		else
+		} else {
 			ret = 1;
-	} else if (left->oid[2] < right->oid[2])
+		}
+	} else if (left->oid[2] < right->oid[2]) {
 		ret = -1;
-	else
+	} else {
 		ret = 1;
+	}
 	return ret;
 }
 
diff --git a/drivers/staging/zcache/zcache.c b/drivers/staging/zcache/zcache.c
index 61be849..c45cad6 100644
--- a/drivers/staging/zcache/zcache.c
+++ b/drivers/staging/zcache/zcache.c
@@ -340,8 +340,9 @@ found_unbuddied:
 	} else if (zh1->size != 0) { /* buddy1 in use, buddy0 is vacant */
 		ASSERT_SENTINEL(zh1, ZBH);
 		zh = zh0;
-	} else
+	} else {
 		BUG();
+	}
 	list_del_init(&zbpg->bud_list);
 	zbud_unbuddied[found_good_buddy].count--;
 	list_add_tail(&zbpg->bud_list, &zbud_buddied_list);
@@ -1191,8 +1192,9 @@ static int shrink_zcache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
 		if (spin_trylock(&zcache_direct_reclaim_lock)) {
 			zbud_evict_pages(nr);
 			spin_unlock(&zcache_direct_reclaim_lock);
-		} else
+		} else {
 			zcache_aborted_shrink++;
+		}
 	}
 	ret = (int)atomic_read(&zcache_zbud_curr_raw_pages);
 out:
-- 
1.7.2.2


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

* Re: [PATCH] staging/zcache: Add braces for else, if 'if' had some
  2011-02-19  2:15 [PATCH] staging/zcache: Add braces for else, if 'if' had some Peter Huewe
@ 2011-02-23 22:04 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2011-02-23 22:04 UTC (permalink / raw)
  To: Peter Huewe
  Cc: Greg Kroah-Hartman, devel, Dan Magenheimer, linux-kernel,
	Nitin Gupta

On Sat, Feb 19, 2011 at 03:15:55AM +0100, Peter Huewe wrote:
> This patch fixes a Coding Style issue by adding needed braces for the
> else branches, if the preceding 'if' branch had braces around it.
> 
> Rationale: CodingStyle.txt Section 3

That's not a good rationale, the existing code is just fine as-is,
sorry.

thanks,

greg k-h

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

end of thread, other threads:[~2011-02-23 22:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-19  2:15 [PATCH] staging/zcache: Add braces for else, if 'if' had some Peter Huewe
2011-02-23 22:04 ` Greg KH

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