From 9824117dd964ecebf5d81990dbf21dfb56445049 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Tue, 12 Apr 2022 15:38:51 -0500 Subject: 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 Signed-off-by: Corey Minyard --- include/linux/ipmi_smi.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux') diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index 9277d21c2690..5d69820d8b02 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h @@ -125,6 +125,12 @@ struct ipmi_smi_msg { void (*done)(struct ipmi_smi_msg *msg); }; +#define INIT_IPMI_SMI_MSG(done_handler) \ +{ \ + .done = done_handler, \ + .type = IPMI_SMI_MSG_TYPE_NORMAL \ +} + struct ipmi_smi_handlers { struct module *owner; -- cgit From f214549d717310f795c20db9497db3938116399d Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Tue, 12 Apr 2022 15:49:47 -0500 Subject: ipmi: Add an intializer for ipmi_recv_msg struct Don't hand-initialize the struct here, create a macro to initialize it so new fields added don't get forgotten in places. Signed-off-by: Corey Minyard --- include/linux/ipmi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux') diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 163831a087ef..a1c9c0d48ebf 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h @@ -72,6 +72,11 @@ struct ipmi_recv_msg { unsigned char msg_data[IPMI_MAX_MSG_LENGTH]; }; +#define INIT_IPMI_RECV_MSG(done_handler) \ +{ \ + .done = done_handler \ +} + /* Allocate and free the receive message. */ void ipmi_free_recv_msg(struct ipmi_recv_msg *msg); -- cgit