sel: Minor refactoring

Minor code duplication reduction

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
Alexander Amelkin 2018-07-20 19:11:04 +03:00
parent 928716244d
commit b3d258b234
No known key found for this signature in database
GPG Key ID: E893587B5B74178D

View File

@ -2722,13 +2722,12 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR, "Get SEL Time command failed");
return -1;
}
if (rsp->ccode > 0) {
if (rsp == NULL || rsp->ccode > 0) {
lprintf(LOG_ERR, "Get SEL Time command failed: %s",
val2str(rsp->ccode, completion_code_vals));
rsp
? val2str(rsp->ccode, completion_code_vals)
: "Unknown"
);
return -1;
}
if (rsp->data_len != 4) {
@ -2827,13 +2826,12 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
#endif
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR, "Set SEL Time command failed");
return -1;
}
if (rsp->ccode > 0) {
if (rsp == NULL || rsp->ccode > 0) {
lprintf(LOG_ERR, "Set SEL Time command failed: %s",
val2str(rsp->ccode, completion_code_vals));
rsp
? val2str(rsp->ccode, completion_code_vals)
: "Unknown"
);
return -1;
}
@ -2842,8 +2840,6 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
return 0;
}
static int
ipmi_sel_clear(struct ipmi_intf * intf)
{