Skip to content

Commit

Permalink
ipmi: Move message sending into its own function
Browse files Browse the repository at this point in the history
Getting ready for a transmit queue.

Signed-off-by: Corey Minyard <[email protected]>
  • Loading branch information
cminyard committed Dec 11, 2014
1 parent 65be754 commit 7f4a1c8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/char/ipmi/ipmi_msghandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 7f4a1c8

Please sign in to comment.