From 232e85af3fe1f2809d5d12afdbe75c760bad5481 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 10 Nov 2021 10:50:08 +0100 Subject: [PATCH] irqtop: small coding style change Signed-off-by: Karel Zak --- sys-utils/irqtop.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys-utils/irqtop.c b/sys-utils/irqtop.c index 16212a223f..c0d3c29413 100644 --- a/sys-utils/irqtop.c +++ b/sys-utils/irqtop.c @@ -68,10 +68,10 @@ #define MAX_EVENTS 3 -enum irqtop_cpus_table { - irqtop_cpus_table_auto, - irqtop_cpus_table_enable, - irqtop_cpus_table_disable, +enum irqtop_cpustat_mode { + IRQTOP_CPUSTAT_AUTO, + IRQTOP_CPUSTAT_ENABLE, + IRQTOP_CPUSTAT_DISABLE, }; /* top control struct */ @@ -84,7 +84,7 @@ struct irqtop_ctl { struct itimerspec timer; struct irq_stat *prev_stat; - enum irqtop_cpus_table cpus; + enum irqtop_cpustat_mode cpustat_mode; unsigned int request_exit:1; unsigned int softirq:1; }; @@ -121,10 +121,10 @@ static int update_screen(struct irqtop_ctl *ctl, struct irq_output *out) scols_table_reduce_termwidth(table, 1); /* make cpus table */ - if (ctl->cpus != irqtop_cpus_table_disable) { + if (ctl->cpustat_mode != IRQTOP_CPUSTAT_DISABLE) { cpus = get_scols_cpus_table(out, ctl->prev_stat, stat); scols_table_reduce_termwidth(cpus, 1); - if (ctl->cpus == irqtop_cpus_table_auto) + if (ctl->cpustat_mode == IRQTOP_CPUSTAT_AUTO) scols_table_enable_nowrap(cpus, 1); } @@ -304,11 +304,11 @@ static void parse_args( struct irqtop_ctl *ctl, switch (o) { case 'c': if (!strcmp(optarg, "auto")) - ctl->cpus = irqtop_cpus_table_auto; + ctl->cpustat_mode = IRQTOP_CPUSTAT_AUTO; else if (!strcmp(optarg, "enable")) - ctl->cpus = irqtop_cpus_table_enable; + ctl->cpustat_mode = IRQTOP_CPUSTAT_ENABLE; else if (!strcmp(optarg, "disable")) - ctl->cpus = irqtop_cpus_table_disable; + ctl->cpustat_mode = IRQTOP_CPUSTAT_DISABLE; else errx(EXIT_FAILURE, _("unsupported mode '%s'"), optarg); break; -- 2.47.3