ipmi: Move message sending into its own function
authorCorey Minyard <cminyard@mvista.com>
Fri, 7 Nov 2014 02:52:24 +0000 (20:52 -0600)
committerCorey Minyard <cminyard@mvista.com>
Thu, 11 Dec 2014 21:04:09 +0000 (15:04 -0600)
Getting ready for a transmit queue.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_msghandler.c

index 31de905b0a0e7295f965c9af83b28d70f18a7571..1a8e7b2131e9fa258fa06af43eb1e7fcec6eaa73 100644 (file)
@@ -1485,6 +1485,12 @@ static inline void format_lan_msg(struct ipmi_smi_msg   *smi_msg,
        smi_msg->msgid = msgid;
 }
 
+static void smi_send(ipmi_smi_t intf, struct ipmi_smi_handlers *handlers,
+                    struct ipmi_smi_msg *smi_msg, int priority)
+{
+       handlers->sender(intf->send_info, smi_msg, 0);
+}
+
 /*
  * Separate from ipmi_request so that the user does not have to be
  * supplied in certain circumstances (mainly at panic time).  If
@@ -1868,7 +1874,7 @@ static int i_ipmi_request(ipmi_user_t          user,
        }
 #endif
 
-       handlers->sender(intf->send_info, smi_msg, priority);
+       smi_send(intf, handlers, smi_msg, priority);
        rcu_read_unlock();
 
        return 0;
@@ -3079,7 +3085,7 @@ static int handle_ipmb_get_msg_cmd(ipmi_smi_t          intf,
                rcu_read_lock();
                handlers = intf->handlers;
                if (handlers) {
-                       handlers->sender(intf->send_info, msg, 0);
+                       smi_send(intf, handlers, msg, 0);
                        /*
                         * We used the message, so return the value
                         * that causes it to not be freed or
@@ -3972,8 +3978,7 @@ static void check_msg_timeout(ipmi_smi_t intf, struct seq_table *ent,
                                ipmi_inc_stat(intf,
                                              retransmitted_ipmb_commands);
 
-                       intf->handlers->sender(intf->send_info,
-                                              smi_msg, 0);
+                       smi_send(intf, intf->handlers, smi_msg, 0);
                } else
                        ipmi_free_smi_msg(smi_msg);