[PATCH] powertop: Re-use string using define (~ -36)
Marek Polacek
mmpolacek at gmail.com
Wed Nov 3 09:45:15 UTC 2010
Maybe the #define should be on the top of the file?
Signed-off-by: Marek Polacek <mmpolacek at gmail.com>
---
procps/powertop.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/procps/powertop.c b/procps/powertop.c
index 77b071f..27dd10d 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -616,7 +616,9 @@ static NOINLINE void print_intel_cstates(void)
if (!edx || !(ecx & 1))
return;
- printf("Your CPU supports the following C-states: ");
+# define report_str "Your %s reports these C-states: "
+
+ printf(report_str, "CPU");
i = 0;
while (edx) {
if (edx & 7)
@@ -627,7 +629,7 @@ static NOINLINE void print_intel_cstates(void)
bb_putchar('\n');
/* Print BIOS C-States */
- printf("Your BIOS reports the following C-states: ");
+ printf(report_str, "BIOS");
for (i = 0; i < ARRAY_SIZE(bios_table); i++)
if (bios_table[i])
printf("C%u ", i);
--
1.7.3.2
More information about the busybox
mailing list