mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_get_power_consumption_data - simplify - If rsp is NULL or ccode is not 0, then return immediately.
This commit is contained in:
parent
5819b314af
commit
5d5251f7da
@ -3064,7 +3064,11 @@ ipmi_get_power_consumption_data(struct ipmi_intf * intf,uint8_t unit)
|
||||
sdr->record.common->keys.owner_id,
|
||||
sdr->record.common->keys.lun,
|
||||
sdr->record.common->keys.channel);
|
||||
if (rsp != NULL && rsp->ccode == 0) {
|
||||
if (rsp == NULL || rsp->ccode != 0) {
|
||||
lprintf(LOG_ERR,
|
||||
"Error : Can not access the System Level sensor data");
|
||||
return -1;
|
||||
}
|
||||
readingbtuphr = sdr_convert_sensor_reading(sdr->record.full,
|
||||
sensorReadingData.sensorReading);
|
||||
warning_threshbtuphr = sdr_convert_sensor_reading(sdr->record.full,
|
||||
@ -3086,11 +3090,6 @@ ipmi_get_power_consumption_data(struct ipmi_intf * intf,uint8_t unit)
|
||||
printf("Warning threshold : %d W \n",(warning_threshbtuphr));
|
||||
printf("Failure threshold : %d W \n",(failure_threshbtuphr));
|
||||
}
|
||||
} else {
|
||||
lprintf(LOG_ERR,
|
||||
"Error : Can not access the System Level sensor data");
|
||||
return -1;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user