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:
Zdenek Styblik 2013-07-07 11:47:49 +00:00
parent 5819b314af
commit 5d5251f7da

View File

@ -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.owner_id,
sdr->record.common->keys.lun, sdr->record.common->keys.lun,
sdr->record.common->keys.channel); 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, readingbtuphr = sdr_convert_sensor_reading(sdr->record.full,
sensorReadingData.sensorReading); sensorReadingData.sensorReading);
warning_threshbtuphr = sdr_convert_sensor_reading(sdr->record.full, 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("Warning threshold : %d W \n",(warning_threshbtuphr));
printf("Failure threshold : %d W \n",(failure_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; return status;
} }
/* /*