Skip to contentSkip to conversation

clk: Neaten clk_summary output

PATCH In review Geert Uytterhoeven 1 participant 3 messages Mar 25, 2014 – May 26, 2014 2 messages not in the archive Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: Neaten clk_summary output

From: Geert Uytterhoeven <[email protected]>

- Limit ruler to 80 characters (was: 81),
- Widen rate column by 1 for nicer spacing,
- Right-align numbers and their column headers,
- Move a newline to reduce the number of seq_printf() calls,
- Use set_puts() for fixed strings.

Before:

clock enable_cnt prepare_cnt rate accuracy
---------------------------------------------------------------------------------

 extal                          2           2            20000000   0
    thermal                     1           1            20000000   0
    cp                          0           0            10000000   0
       tpu0                     0           0            10000000   0
       tmu0                     0           0            10000000   0
    main                        1           1            20000000   0
       pll3                     0           0            1600000000 0
          ddr                   0           0            200000000  0
          zb3d2                 0           0            200000000  0
          zb3                   0           0            400000000  0
       pll1                     4           4            1560000000 0
          oscclk                0           0            126953     0
          rclk                  1           1            31738      0
             cmt1               0           0            31738      0
             cmt0               1           1            31738      0
          imp                   0           0            390000000  0

After:

clock enable_cnt prepare_cnt rate accuracy
--------------------------------------------------------------------------------

 extal                                    2            2    20000000          0
    thermal                               1            1    20000000          0
    cp                                    0            0    10000000          0
       tpu0                               0            0    10000000          0
       tmu0                               0            0    10000000          0
    main                                  1            1    20000000          0
       pll3                               0            0  1600000000          0
          ddr                             0            0   200000000          0
          zb3d2                           0            0   200000000          0
          zb3                             0            0   400000000          0
       pll1                               4            4  1560000000          0
          oscclk                          0            0      126953          0
          rclk                            1            1       31738          0
             cmt1                         0            0       31738          0
             cmt0                         1            1       31738          0
          imp                             0            0   390000000          0
---
 drivers/clk/clk.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/clk/clk.c +3 -4
index fb3c40b4fbe2..73fe1fade11f 100644
@@ -106,12 +106,11 @@ static void clk_summary_show_one(struct seq_file *s, struct clk *c, int level)
 	if (!c)
 		return;
 
-	seq_printf(s, "%*s%-*s %-11d %-12d %-10lu %-11lu",
+	seq_printf(s, "%*s%-*s %11d %12d %11lu %10lu\n",
 		   level * 3 + 1, "",
 		   30 - level * 3, c->name,
 		   c->enable_count, c->prepare_count, clk_get_rate(c),
 		   clk_get_accuracy(c));
-	seq_printf(s, "\n");
 }
 
 static void clk_summary_show_subtree(struct seq_file *s, struct clk *c,
@@ -132,8 +131,8 @@ static int clk_summary_show(struct seq_file *s, void *data)
 {
 	struct clk *c;
 
-	seq_printf(s, "   clock                        enable_cnt  prepare_cnt  rate        accuracy\n");
-	seq_printf(s, "---------------------------------------------------------------------------------\n");
+	seq_puts(s, "   clock                         enable_cnt  prepare_cnt        rate   accuracy\n");
+	seq_puts(s, "--------------------------------------------------------------------------------\n");
 
 	clk_prepare_lock();
 
Signature · 1 line
1.7.9.5

A message that is not in the archive (sent off-list or not yet received): 20140513001759.5943.52169@quantum

#2 lore raw

Hi Mike,

Quoted 9 lines · Mike Turquette

Quoting Geert Uytterhoeven (2014-03-25 04:16:24)

Quoted 7 lines

From: Geert Uytterhoeven <[email protected]>

- Limit ruler to 80 characters (was: 81),
- Widen rate column by 1 for nicer spacing,
- Right-align numbers and their column headers,
- Move a newline to reduce the number of seq_printf() calls,
- Use set_puts() for fixed strings.

Quoted 3 lines
Quoted 1 line

Thanks for the fix. Taken into clk-next.

I don't see it in clk-next, though?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

A message that is not in the archive (sent off-list or not yet received): 20140523211221.23136.12584@quantum

#4 lore raw

Hi Mike,

Quoted 13 lines · Mike Turquette

Quoting Geert Uytterhoeven (2014-05-23 00:14:41)

Quoted 12 lines · Mike Turquette
Quoted 11 lines

Quoting Geert Uytterhoeven (2014-03-25 04:16:24)

Quoted 9 lines

From: Geert Uytterhoeven <[email protected]>

- Limit ruler to 80 characters (was: 81),
- Widen rate column by 1 for nicer spacing,
- Right-align numbers and their column headers,
- Move a newline to reduce the number of seq_printf() calls,
- Use set_puts() for fixed strings.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Thanks for the fix. Taken into clk-next.

I don't see it in clk-next, though?

When I say "clk-next" I really mean my local/private branch. You'll see it at the end of today when I push my next set of tested patches out to my linaro mirror.

Thanks, I can see it now.

Sorry for being so impatient.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds