clk: Drop !clk checks in debugfs dumping
diff mbox series

Message ID 20190826234729.145593-1-sboyd@kernel.org
State In Next
Commit 9ae8539a5913ba6909c162a1ebe184c23e40e328
Headers show
Series
  • clk: Drop !clk checks in debugfs dumping
Related show

Commit Message

Stephen Boyd Aug. 26, 2019, 11:47 p.m. UTC
These recursive functions have checks for !clk being passed in, but the
callers are always looping through lists and therefore the pointers
can't be NULL. Drop the checks to simplify the code.

Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/clk.c | 12 ------------
 1 file changed, 12 deletions(-)


base-commit: 5f9e832c137075045d15cd6899ab0505cfb2ca4b

Comments

Stephen Boyd Sept. 9, 2019, 9:59 a.m. UTC | #1
Quoting Stephen Boyd (2019-08-26 16:47:29)
> These recursive functions have checks for !clk being passed in, but the
> callers are always looping through lists and therefore the pointers
> can't be NULL. Drop the checks to simplify the code.
> 
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next

Patch
diff mbox series

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index c0990703ce54..a5b686307c38 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2847,9 +2847,6 @@  static struct hlist_head *orphan_list[] = {
 static void clk_summary_show_one(struct seq_file *s, struct clk_core *c,
 				 int level)
 {
-	if (!c)
-		return;
-
 	seq_printf(s, "%*s%-*s %7d %8d %8d %11lu %10lu %5d %6d\n",
 		   level * 3 + 1, "",
 		   30 - level * 3, c->name,
@@ -2864,9 +2861,6 @@  static void clk_summary_show_subtree(struct seq_file *s, struct clk_core *c,
 {
 	struct clk_core *child;
 
-	if (!c)
-		return;
-
 	clk_summary_show_one(s, c, level);
 
 	hlist_for_each_entry(child, &c->children, child_node)
@@ -2896,9 +2890,6 @@  DEFINE_SHOW_ATTRIBUTE(clk_summary);
 
 static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level)
 {
-	if (!c)
-		return;
-
 	/* This should be JSON format, i.e. elements separated with a comma */
 	seq_printf(s, "\"%s\": { ", c->name);
 	seq_printf(s, "\"enable_count\": %d,", c->enable_count);
@@ -2915,9 +2906,6 @@  static void clk_dump_subtree(struct seq_file *s, struct clk_core *c, int level)
 {
 	struct clk_core *child;
 
-	if (!c)
-		return;
-
 	clk_dump_one(s, c, level);
 
 	hlist_for_each_entry(child, &c->children, child_node) {