ipmi:si: Move flags get start to its own function
authorCorey Minyard <corey@minyard.net>
Wed, 20 Aug 2025 18:25:33 +0000 (13:25 -0500)
committerCorey Minyard <corey@minyard.net>
Mon, 8 Sep 2025 15:21:41 +0000 (10:21 -0500)
It's about to be used from another place, and this looks better,
anyway.

Signed-off-by: Corey Minyard <corey@minyard.net>
drivers/char/ipmi/ipmi_si_intf.c

index cd23798..7b2ba31 100644 (file)
@@ -313,7 +313,7 @@ static void return_hosed_msg(struct smi_info *smi_info, int cCode)
 
 static enum si_sm_result start_next_msg(struct smi_info *smi_info)
 {
-       int              rv;
+       int rv;
 
        if (!smi_info->waiting_msg) {
                smi_info->curr_msg = NULL;
@@ -390,6 +390,17 @@ static void start_clear_flags(struct smi_info *smi_info)
        smi_info->si_state = SI_CLEARING_FLAGS;
 }
 
+static void start_get_flags(struct smi_info *smi_info)
+{
+       unsigned char msg[2];
+
+       msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
+       msg[1] = IPMI_GET_MSG_FLAGS_CMD;
+
+       start_new_msg(smi_info, msg, 2);
+       smi_info->si_state = SI_GETTING_FLAGS;
+}
+
 static void start_getting_msg_queue(struct smi_info *smi_info)
 {
        smi_info->curr_msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2);
@@ -817,11 +828,7 @@ restart:
                         * interrupts work with the SMI, that's not really
                         * possible.
                         */
-                       msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
-                       msg[1] = IPMI_GET_MSG_FLAGS_CMD;
-
-                       start_new_msg(smi_info, msg, 2);
-                       smi_info->si_state = SI_GETTING_FLAGS;
+                       start_get_flags(smi_info);
                        goto restart;
                }
        }