mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
sel: Minor refactoring
Minor code duplication reduction Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
parent
928716244d
commit
b3d258b234
@ -2722,13 +2722,12 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
rsp = intf->sendrecv(intf, &req);
|
rsp = intf->sendrecv(intf, &req);
|
||||||
|
|
||||||
if (rsp == NULL) {
|
if (rsp == NULL || rsp->ccode > 0) {
|
||||||
lprintf(LOG_ERR, "Get SEL Time command failed");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (rsp->ccode > 0) {
|
|
||||||
lprintf(LOG_ERR, "Get SEL Time command failed: %s",
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
if (rsp->data_len != 4) {
|
if (rsp->data_len != 4) {
|
||||||
@ -2827,13 +2826,12 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
rsp = intf->sendrecv(intf, &req);
|
rsp = intf->sendrecv(intf, &req);
|
||||||
if (rsp == NULL) {
|
if (rsp == NULL || rsp->ccode > 0) {
|
||||||
lprintf(LOG_ERR, "Set SEL Time command failed");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (rsp->ccode > 0) {
|
|
||||||
lprintf(LOG_ERR, "Set SEL Time command failed: %s",
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2842,8 +2840,6 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ipmi_sel_clear(struct ipmi_intf * intf)
|
ipmi_sel_clear(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user