Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IPMI: Convert system interface defines to an enum

Convert the #defines for statistics into an enum in the IPMI system interface
and remove the unused timeout_restart statistic. And comment what these
statistics mean.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Corey Minyard and committed by
Linus Torvalds
ba8ff1c6 64959e2d

+42 -16
+42 -16
drivers/char/ipmi/ipmi_si_intf.c
··· 124 124 /* 125 125 * Indexes into stats[] in smi_info below. 126 126 */ 127 + enum si_stat_indexes { 128 + /* 129 + * Number of times the driver requested a timer while an operation 130 + * was in progress. 131 + */ 132 + SI_STAT_short_timeouts = 0, 127 133 128 - #define SI_STAT_short_timeouts 0 129 - #define SI_STAT_long_timeouts 1 130 - #define SI_STAT_timeout_restarts 2 131 - #define SI_STAT_idles 3 132 - #define SI_STAT_interrupts 4 133 - #define SI_STAT_attentions 5 134 - #define SI_STAT_flag_fetches 6 135 - #define SI_STAT_hosed_count 7 136 - #define SI_STAT_complete_transactions 8 137 - #define SI_STAT_events 9 138 - #define SI_STAT_watchdog_pretimeouts 10 139 - #define SI_STAT_incoming_messages 11 134 + /* 135 + * Number of times the driver requested a timer while nothing was in 136 + * progress. 137 + */ 138 + SI_STAT_long_timeouts, 140 139 141 - /* If you add a stat, you must update this value. */ 142 - #define SI_NUM_STATS 12 140 + /* Number of times the interface was idle while being polled. */ 141 + SI_STAT_idles, 142 + 143 + /* Number of interrupts the driver handled. */ 144 + SI_STAT_interrupts, 145 + 146 + /* Number of time the driver got an ATTN from the hardware. */ 147 + SI_STAT_attentions, 148 + 149 + /* Number of times the driver requested flags from the hardware. */ 150 + SI_STAT_flag_fetches, 151 + 152 + /* Number of times the hardware didn't follow the state machine. */ 153 + SI_STAT_hosed_count, 154 + 155 + /* Number of completed messages. */ 156 + SI_STAT_complete_transactions, 157 + 158 + /* Number of IPMI events received from the hardware. */ 159 + SI_STAT_events, 160 + 161 + /* Number of watchdog pretimeouts. */ 162 + SI_STAT_watchdog_pretimeouts, 163 + 164 + /* Number of asyncronous messages received. */ 165 + SI_STAT_incoming_messages, 166 + 167 + 168 + /* This *must* remain last, add new values above this. */ 169 + SI_NUM_STATS 170 + }; 143 171 144 172 struct smi_info 145 173 { ··· 2427 2399 smi_get_stat(smi, short_timeouts)); 2428 2400 out += sprintf(out, "long_timeouts: %u\n", 2429 2401 smi_get_stat(smi, long_timeouts)); 2430 - out += sprintf(out, "timeout_restarts: %u\n", 2431 - smi_get_stat(smi, timeout_restarts)); 2432 2402 out += sprintf(out, "idles: %u\n", 2433 2403 smi_get_stat(smi, idles)); 2434 2404 out += sprintf(out, "interrupts: %u\n",