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

IPMI: convert message handler defines to an enum

Convert the #defines for statistics into an enum in the IPMI message
handler.

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
73f2bdb9 b2655f26

+67 -58
+67 -58
drivers/char/ipmi/ipmi_msghandler.c
··· 189 189 * Various statistics for IPMI, these index stats[] in the ipmi_smi 190 190 * structure. 191 191 */ 192 - /* Commands we got from the user that were invalid. */ 193 - #define IPMI_STAT_sent_invalid_commands 0 192 + enum ipmi_stat_indexes { 193 + /* Commands we got from the user that were invalid. */ 194 + IPMI_STAT_sent_invalid_commands = 0, 194 195 195 - /* Commands we sent to the MC. */ 196 - #define IPMI_STAT_sent_local_commands 1 196 + /* Commands we sent to the MC. */ 197 + IPMI_STAT_sent_local_commands, 197 198 198 - /* Responses from the MC that were delivered to a user. */ 199 - #define IPMI_STAT_handled_local_responses 2 199 + /* Responses from the MC that were delivered to a user. */ 200 + IPMI_STAT_handled_local_responses, 200 201 201 - /* Responses from the MC that were not delivered to a user. */ 202 - #define IPMI_STAT_unhandled_local_responses 3 202 + /* Responses from the MC that were not delivered to a user. */ 203 + IPMI_STAT_unhandled_local_responses, 203 204 204 - /* Commands we sent out to the IPMB bus. */ 205 - #define IPMI_STAT_sent_ipmb_commands 4 205 + /* Commands we sent out to the IPMB bus. */ 206 + IPMI_STAT_sent_ipmb_commands, 206 207 207 - /* Commands sent on the IPMB that had errors on the SEND CMD */ 208 - #define IPMI_STAT_sent_ipmb_command_errs 5 208 + /* Commands sent on the IPMB that had errors on the SEND CMD */ 209 + IPMI_STAT_sent_ipmb_command_errs, 209 210 210 - /* Each retransmit increments this count. */ 211 - #define IPMI_STAT_retransmitted_ipmb_commands 6 211 + /* Each retransmit increments this count. */ 212 + IPMI_STAT_retransmitted_ipmb_commands, 212 213 213 - /* When a message times out (runs out of retransmits) this is incremented. */ 214 - #define IPMI_STAT_timed_out_ipmb_commands 7 214 + /* 215 + * When a message times out (runs out of retransmits) this is 216 + * incremented. 217 + */ 218 + IPMI_STAT_timed_out_ipmb_commands, 215 219 216 - /* 217 - * This is like above, but for broadcasts. Broadcasts are 218 - * *not* included in the above count (they are expected to 219 - * time out). 220 - */ 221 - #define IPMI_STAT_timed_out_ipmb_broadcasts 8 220 + /* 221 + * This is like above, but for broadcasts. Broadcasts are 222 + * *not* included in the above count (they are expected to 223 + * time out). 224 + */ 225 + IPMI_STAT_timed_out_ipmb_broadcasts, 222 226 223 - /* Responses I have sent to the IPMB bus. */ 224 - #define IPMI_STAT_sent_ipmb_responses 9 227 + /* Responses I have sent to the IPMB bus. */ 228 + IPMI_STAT_sent_ipmb_responses, 225 229 226 - /* The response was delivered to the user. */ 227 - #define IPMI_STAT_handled_ipmb_responses 10 230 + /* The response was delivered to the user. */ 231 + IPMI_STAT_handled_ipmb_responses, 228 232 229 - /* The response had invalid data in it. */ 230 - #define IPMI_STAT_invalid_ipmb_responses 11 233 + /* The response had invalid data in it. */ 234 + IPMI_STAT_invalid_ipmb_responses, 231 235 232 - /* The response didn't have anyone waiting for it. */ 233 - #define IPMI_STAT_unhandled_ipmb_responses 12 236 + /* The response didn't have anyone waiting for it. */ 237 + IPMI_STAT_unhandled_ipmb_responses, 234 238 235 - /* Commands we sent out to the IPMB bus. */ 236 - #define IPMI_STAT_sent_lan_commands 13 239 + /* Commands we sent out to the IPMB bus. */ 240 + IPMI_STAT_sent_lan_commands, 237 241 238 - /* Commands sent on the IPMB that had errors on the SEND CMD */ 239 - #define IPMI_STAT_sent_lan_command_errs 14 242 + /* Commands sent on the IPMB that had errors on the SEND CMD */ 243 + IPMI_STAT_sent_lan_command_errs, 240 244 241 - /* Each retransmit increments this count. */ 242 - #define IPMI_STAT_retransmitted_lan_commands 15 245 + /* Each retransmit increments this count. */ 246 + IPMI_STAT_retransmitted_lan_commands, 243 247 244 - /* When a message times out (runs out of retransmits) this is incremented. */ 245 - #define IPMI_STAT_timed_out_lan_commands 16 248 + /* 249 + * When a message times out (runs out of retransmits) this is 250 + * incremented. 251 + */ 252 + IPMI_STAT_timed_out_lan_commands, 246 253 247 - /* Responses I have sent to the IPMB bus. */ 248 - #define IPMI_STAT_sent_lan_responses 17 254 + /* Responses I have sent to the IPMB bus. */ 255 + IPMI_STAT_sent_lan_responses, 249 256 250 - /* The response was delivered to the user. */ 251 - #define IPMI_STAT_handled_lan_responses 18 257 + /* The response was delivered to the user. */ 258 + IPMI_STAT_handled_lan_responses, 252 259 253 - /* The response had invalid data in it. */ 254 - #define IPMI_STAT_invalid_lan_responses 19 260 + /* The response had invalid data in it. */ 261 + IPMI_STAT_invalid_lan_responses, 255 262 256 - /* The response didn't have anyone waiting for it. */ 257 - #define IPMI_STAT_unhandled_lan_responses 20 263 + /* The response didn't have anyone waiting for it. */ 264 + IPMI_STAT_unhandled_lan_responses, 258 265 259 - /* The command was delivered to the user. */ 260 - #define IPMI_STAT_handled_commands 21 266 + /* The command was delivered to the user. */ 267 + IPMI_STAT_handled_commands, 261 268 262 - /* The command had invalid data in it. */ 263 - #define IPMI_STAT_invalid_commands 22 269 + /* The command had invalid data in it. */ 270 + IPMI_STAT_invalid_commands, 264 271 265 - /* The command didn't have anyone waiting for it. */ 266 - #define IPMI_STAT_unhandled_commands 23 272 + /* The command didn't have anyone waiting for it. */ 273 + IPMI_STAT_unhandled_commands, 267 274 268 - /* Invalid data in an event. */ 269 - #define IPMI_STAT_invalid_events 24 275 + /* Invalid data in an event. */ 276 + IPMI_STAT_invalid_events, 270 277 271 - /* Events that were received with the proper format. */ 272 - #define IPMI_STAT_events 25 278 + /* Events that were received with the proper format. */ 279 + IPMI_STAT_events, 273 280 274 - /* When you add a statistic, you must update this value. */ 275 - #define IPMI_NUM_STATS 26 281 + 282 + /* This *must* remain last, add new values above this. */ 283 + IPMI_NUM_STATS 284 + }; 276 285 277 286 278 287 #define IPMI_IPMB_NUM_SEQ 64