Skip to content

Commit abe4918

Browse files
committed
ipmi:si: Move flags get start to its own function
It's about to be used from another place, and this looks better, anyway. Signed-off-by: Corey Minyard <corey@minyard.net>
1 parent 753bc23 commit abe4918

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static void return_hosed_msg(struct smi_info *smi_info, int cCode)
313313

314314
static enum si_sm_result start_next_msg(struct smi_info *smi_info)
315315
{
316-
int rv;
316+
int rv;
317317

318318
if (!smi_info->waiting_msg) {
319319
smi_info->curr_msg = NULL;
@@ -390,6 +390,17 @@ static void start_clear_flags(struct smi_info *smi_info)
390390
smi_info->si_state = SI_CLEARING_FLAGS;
391391
}
392392

393+
static void start_get_flags(struct smi_info *smi_info)
394+
{
395+
unsigned char msg[2];
396+
397+
msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
398+
msg[1] = IPMI_GET_MSG_FLAGS_CMD;
399+
400+
start_new_msg(smi_info, msg, 2);
401+
smi_info->si_state = SI_GETTING_FLAGS;
402+
}
403+
393404
static void start_getting_msg_queue(struct smi_info *smi_info)
394405
{
395406
smi_info->curr_msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2);
@@ -817,11 +828,7 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
817828
* interrupts work with the SMI, that's not really
818829
* possible.
819830
*/
820-
msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
821-
msg[1] = IPMI_GET_MSG_FLAGS_CMD;
822-
823-
start_new_msg(smi_info, msg, 2);
824-
smi_info->si_state = SI_GETTING_FLAGS;
831+
start_get_flags(smi_info);
825832
goto restart;
826833
}
827834
}

0 commit comments

Comments
 (0)