aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Kryzhanovskyy <xmaks@email.cz>2010-07-30 03:56:02 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-07-30 03:56:02 +0200
commit5e87c2ef150275ddb8fd7be0397881eeeb3bb081 (patch)
tree8a1eb57a05e81ace34abab326621fb8ea2c2dcfd
parent68fca4cd55e7bf6075eb1ccd303ae57a7ec1b8da (diff)
downloadbusybox-w32-5e87c2ef150275ddb8fd7be0397881eeeb3bb081.tar.gz
busybox-w32-5e87c2ef150275ddb8fd7be0397881eeeb3bb081.tar.bz2
busybox-w32-5e87c2ef150275ddb8fd7be0397881eeeb3bb081.zip
mpstat: small code shrink
Signed-off-by: Maksym Kryzhanovskyy <xmaks@email.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--procps/mpstat.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/procps/mpstat.c b/procps/mpstat.c
index 125bb3de7..b0d187ea6 100644
--- a/procps/mpstat.c
+++ b/procps/mpstat.c
@@ -954,16 +954,14 @@ int mpstat_main(int UNUSED_PARAM argc, char **argv)
954 } 954 }
955 955
956 if (opt & OPT_INTS) { 956 if (opt & OPT_INTS) {
957 if (strcmp(opt_irq_fmt, "ALL") == 0) 957 static const char v[] = {
958 G.options |= D_IRQ_SUM + D_IRQ_CPU + D_SOFTIRQS; 958 D_IRQ_CPU, D_IRQ_SUM, D_SOFTIRQS,
959 else if (strcmp(opt_irq_fmt, "CPU") == 0) 959 D_IRQ_SUM + D_IRQ_CPU + D_SOFTIRQS
960 G.options |= D_IRQ_CPU; 960 };
961 else if (strcmp(opt_irq_fmt, "SUM") == 0) 961 i = index_in_strings("CPU\0SUM\0SCPU\0ALL\0", opt_irq_fmt);
962 G.options |= D_IRQ_SUM; 962 if (i == -1)
963 else if (strcmp(opt_irq_fmt, "SCPU") == 0)
964 G.options |= D_SOFTIRQS;
965 else
966 bb_show_usage(); 963 bb_show_usage();
964 G.options |= v[i];
967 } 965 }
968 966
969 if ((opt & OPT_UTIL) /* -u? */ 967 if ((opt & OPT_UTIL) /* -u? */