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

ipmi: Add an intializer for ipmi_smi_msg struct

There was a "type" element added to this structure, but some static
values were missed. The default value will be zero, which is correct,
but create an initializer for the type and initialize the type properly
in the initializer to avoid future issues.

Reported-by: Joe Wiese <jwiese@rackspace.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>

+12 -12
+1 -3
drivers/char/ipmi/ipmi_poweroff.c
··· 94 94 { 95 95 atomic_dec(&dummy_count); 96 96 } 97 - static struct ipmi_smi_msg halt_smi_msg = { 98 - .done = dummy_smi_free 99 - }; 97 + static struct ipmi_smi_msg halt_smi_msg = INIT_IPMI_SMI_MSG(dummy_smi_free); 100 98 static struct ipmi_recv_msg halt_recv_msg = { 101 99 .done = dummy_recv_free 102 100 };
+5 -9
drivers/char/ipmi/ipmi_watchdog.c
··· 354 354 complete(&msg_wait); 355 355 } 356 356 } 357 - static struct ipmi_smi_msg smi_msg = { 358 - .done = msg_free_smi 359 - }; 357 + static struct ipmi_smi_msg smi_msg = INIT_IPMI_SMI_MSG(msg_free_smi); 360 358 static struct ipmi_recv_msg recv_msg = { 361 359 .done = msg_free_recv 362 360 }; ··· 473 475 atomic_dec(&panic_done_count); 474 476 } 475 477 476 - static struct ipmi_smi_msg panic_halt_heartbeat_smi_msg = { 477 - .done = panic_smi_free 478 - }; 478 + static struct ipmi_smi_msg panic_halt_heartbeat_smi_msg = 479 + INIT_IPMI_SMI_MSG(panic_smi_free); 479 480 static struct ipmi_recv_msg panic_halt_heartbeat_recv_msg = { 480 481 .done = panic_recv_free 481 482 }; ··· 513 516 atomic_sub(2, &panic_done_count); 514 517 } 515 518 516 - static struct ipmi_smi_msg panic_halt_smi_msg = { 517 - .done = panic_smi_free 518 - }; 519 + static struct ipmi_smi_msg panic_halt_smi_msg = 520 + INIT_IPMI_SMI_MSG(panic_smi_free); 519 521 static struct ipmi_recv_msg panic_halt_recv_msg = { 520 522 .done = panic_recv_free 521 523 };
+6
include/linux/ipmi_smi.h
··· 125 125 void (*done)(struct ipmi_smi_msg *msg); 126 126 }; 127 127 128 + #define INIT_IPMI_SMI_MSG(done_handler) \ 129 + { \ 130 + .done = done_handler, \ 131 + .type = IPMI_SMI_MSG_TYPE_NORMAL \ 132 + } 133 + 128 134 struct ipmi_smi_handlers { 129 135 struct module *owner; 130 136