Skip to content

Commit

Permalink
perf: Use format string of printf to align strings
Browse files Browse the repository at this point in the history
Instead of filling whitespaces to do alignment, use
printf's format string.

This simplifies the code a bit.

Signed-off-by: WANG 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: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Amerigo Wang authored and Ingo Molnar committed Dec 28, 2009
1 parent 049ae80 commit 3912f2a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/perf/builtin-help.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ void list_common_cmds_help(void)

puts(" The most commonly used perf commands are:");
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
printf(" %s ", common_cmds[i].name);
mput_char(' ', longest - strlen(common_cmds[i].name));
printf(" %-*s ", longest, common_cmds[i].name);
puts(common_cmds[i].help);
}
}
Expand Down

0 comments on commit 3912f2a

Please sign in to comment.