From: tip-bot for Amerigo Wang <amwang@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, acme@redhat.com, paulus@samba.org,
hpa@zytor.com, mingo@redhat.com, a.p.zijlstra@chello.nl,
efault@gmx.de, amwang@redhat.com, fweisbec@gmail.com,
tglx@linutronix.de, mingo@elte.hu
Subject: [tip:perf/core] perf: Use format string of printf to align strings
Date: Mon, 28 Dec 2009 10:04:37 GMT [thread overview]
Message-ID: <tip-3912f2abc942a002ef611fc973add5e5eadb3432@git.kernel.org> (raw)
In-Reply-To: <20091214082700.4224.57640.sendpatchset@localhost.localdomain>
Commit-ID: 3912f2abc942a002ef611fc973add5e5eadb3432
Gitweb: http://git.kernel.org/tip/3912f2abc942a002ef611fc973add5e5eadb3432
Author: Amerigo Wang <amwang@redhat.com>
AuthorDate: Mon, 14 Dec 2009 03:23:56 -0500
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 28 Dec 2009 09:03:16 +0100
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: 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>
---
tools/perf/builtin-help.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 9f810b1..e427d69 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -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);
}
}
prev parent reply other threads:[~2009-12-28 10:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-14 8:23 [Patch] perf: use " Amerigo Wang
2009-12-28 10:04 ` tip-bot for Amerigo Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-3912f2abc942a002ef611fc973add5e5eadb3432@git.kernel.org \
--to=amwang@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome