Commit 3912f2ab authored by Amerigo Wang's avatar Amerigo Wang Committed by Ingo Molnar

perf: Use format string of printf to align strings

Instead of filling whitespaces to do alignment, use
printf's format string.

This simplifies the code a bit.
Signed-off-by: default avatarWANG Cong <amwang@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091214082700.4224.57640.sendpatchset@localhost.localdomain>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 049ae80b
...@@ -286,8 +286,7 @@ void list_common_cmds_help(void) ...@@ -286,8 +286,7 @@ void list_common_cmds_help(void)
puts(" The most commonly used perf commands are:"); puts(" The most commonly used perf commands are:");
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
printf(" %s ", common_cmds[i].name); printf(" %-*s ", longest, common_cmds[i].name);
mput_char(' ', longest - strlen(common_cmds[i].name));
puts(common_cmds[i].help); puts(common_cmds[i].help);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment