mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID:355 - Remove declared, but not used variables
Commit removes bunch of declared, but not used, variables.
This commit is contained in:
parent
2b8974fb22
commit
24ebe2fed9
@ -2783,8 +2783,6 @@ ipmi_set_power_capstatus_command(struct ipmi_intf * intf, uint8_t val)
|
|||||||
static int
|
static int
|
||||||
ipmi_powermgmt(struct ipmi_intf * intf)
|
ipmi_powermgmt(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
time_t now;
|
|
||||||
struct tm* tm;
|
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
uint8_t msg_data[2];
|
uint8_t msg_data[2];
|
||||||
@ -2811,9 +2809,6 @@ ipmi_powermgmt(struct ipmi_intf * intf)
|
|||||||
int remainder;
|
int remainder;
|
||||||
int wattReading;
|
int wattReading;
|
||||||
|
|
||||||
now = time(0);
|
|
||||||
tm = gmtime(&now);
|
|
||||||
|
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||||
req.msg.lun = 0;
|
req.msg.lun = 0;
|
||||||
@ -2893,7 +2888,6 @@ ipmi_powermgmt(struct ipmi_intf * intf)
|
|||||||
ipmi_time_to_str(ampPeakTimeConv, ampPeakTime);
|
ipmi_time_to_str(ampPeakTimeConv, ampPeakTime);
|
||||||
ipmi_time_to_str(wattPeakTimeConv, wattPeakTime);
|
ipmi_time_to_str(wattPeakTimeConv, wattPeakTime);
|
||||||
ipmi_time_to_str(bmctimeconv, bmctime);
|
ipmi_time_to_str(bmctimeconv, bmctime);
|
||||||
now = time(0);
|
|
||||||
|
|
||||||
remainder = (cumReadingConv % 1000);
|
remainder = (cumReadingConv % 1000);
|
||||||
cumReadingConv = cumReadingConv / 1000;
|
cumReadingConv = cumReadingConv / 1000;
|
||||||
@ -3645,7 +3639,6 @@ ipmi_set_power_cap(struct ipmi_intf * intf, int unit, int val)
|
|||||||
uint8_t data[13], *rdata;
|
uint8_t data[13], *rdata;
|
||||||
uint16_t powercapval;
|
uint16_t powercapval;
|
||||||
uint64_t maxpowerbtuphr;
|
uint64_t maxpowerbtuphr;
|
||||||
uint64_t maxpowerbtuphr1;
|
|
||||||
uint64_t minpowerbtuphr;
|
uint64_t minpowerbtuphr;
|
||||||
IPMI_POWER_CAP ipmipowercap;
|
IPMI_POWER_CAP ipmipowercap;
|
||||||
|
|
||||||
@ -3733,11 +3726,10 @@ ipmi_set_power_cap(struct ipmi_intf * intf, int unit, int val)
|
|||||||
|| (val > ipmipowercap.MaximumPowerConsmp)) && (unit == btuphr)) {
|
|| (val > ipmipowercap.MaximumPowerConsmp)) && (unit == btuphr)) {
|
||||||
minpowerbtuphr = watt_to_btuphr_conversion(ipmipowercap.MinimumPowerConsmp);
|
minpowerbtuphr = watt_to_btuphr_conversion(ipmipowercap.MinimumPowerConsmp);
|
||||||
maxpowerbtuphr = watt_to_btuphr_conversion(ipmipowercap.MaximumPowerConsmp);
|
maxpowerbtuphr = watt_to_btuphr_conversion(ipmipowercap.MaximumPowerConsmp);
|
||||||
maxpowerbtuphr1 = watt_to_btuphr_conversion(ipmipowercap.MaximumPowerConsmp);
|
|
||||||
lprintf(LOG_ERR,
|
lprintf(LOG_ERR,
|
||||||
"Cap value is out of boundary conditon it should be between %d",
|
"Cap value is out of boundary conditon it should be between %d",
|
||||||
minpowerbtuphr);
|
minpowerbtuphr);
|
||||||
lprintf(LOG_ERR, " -%d", maxpowerbtuphr1);
|
lprintf(LOG_ERR, " -%d", maxpowerbtuphr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
rc = ipmi_mc_setsysinfo(intf, 13, data);
|
rc = ipmi_mc_setsysinfo(intf, 13, data);
|
||||||
|
@ -458,7 +458,6 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int rc = ERROR_STATUS;
|
int rc = ERROR_STATUS;
|
||||||
int file_type[MAX_FILE_NUMBER];
|
int file_type[MAX_FILE_NUMBER];
|
||||||
int tmp_ret = 0;
|
|
||||||
char *filename[MAX_FILE_NUMBER];
|
char *filename[MAX_FILE_NUMBER];
|
||||||
unsigned int argument_offset = 0;
|
unsigned int argument_offset = 0;
|
||||||
unsigned int type_offset = 0;
|
unsigned int type_offset = 0;
|
||||||
@ -508,7 +507,7 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
|
|||||||
rc = ipmi_ek_display_fru_header (filename[type_offset]);
|
rc = ipmi_ek_display_fru_header (filename[type_offset]);
|
||||||
if (rc != ERROR_STATUS) {
|
if (rc != ERROR_STATUS) {
|
||||||
/* Display FRU header info in detail record */
|
/* Display FRU header info in detail record */
|
||||||
tmp_ret = ipmi_ek_display_fru_header_detail(filename[type_offset]);
|
rc = ipmi_ek_display_fru_header_detail(filename[type_offset]);
|
||||||
/* Convert from binary data into multi record structure */
|
/* Convert from binary data into multi record structure */
|
||||||
rc = ipmi_ekanalyzer_fru_file2structure (filename[type_offset],
|
rc = ipmi_ekanalyzer_fru_file2structure (filename[type_offset],
|
||||||
&list_head, &list_record, &list_last );
|
&list_head, &list_record, &list_last );
|
||||||
|
@ -810,12 +810,11 @@ fru_area_print_multirec_bloc(struct ipmi_intf * intf, struct fru_info * fru,
|
|||||||
uint8_t id, uint32_t offset)
|
uint8_t id, uint32_t offset)
|
||||||
{
|
{
|
||||||
uint8_t * fru_data = NULL;
|
uint8_t * fru_data = NULL;
|
||||||
uint32_t fru_len, i;
|
uint32_t i;
|
||||||
struct fru_multirec_header * h;
|
struct fru_multirec_header * h;
|
||||||
uint32_t last_off, len;
|
uint32_t last_off, len;
|
||||||
|
|
||||||
i = last_off = offset;
|
i = last_off = offset;
|
||||||
fru_len = 0;
|
|
||||||
|
|
||||||
fru_data = malloc(fru->size + 1);
|
fru_data = malloc(fru->size + 1);
|
||||||
if (fru_data == NULL) {
|
if (fru_data == NULL) {
|
||||||
@ -1592,7 +1591,6 @@ static void ipmi_fru_oemkontron_get( int argc, char ** argv,uint8_t * fru_data,
|
|||||||
printf("Kontron OEM Information Record\n");
|
printf("Kontron OEM Information Record\n");
|
||||||
version = oh->record_version;
|
version = oh->record_version;
|
||||||
|
|
||||||
int blockstart;
|
|
||||||
uint8_t blockCount;
|
uint8_t blockCount;
|
||||||
uint8_t blockIndex=0;
|
uint8_t blockIndex=0;
|
||||||
|
|
||||||
@ -1613,7 +1611,6 @@ static void ipmi_fru_oemkontron_get( int argc, char ** argv,uint8_t * fru_data,
|
|||||||
void * pRecordData;
|
void * pRecordData;
|
||||||
uint8_t nameLen;
|
uint8_t nameLen;
|
||||||
|
|
||||||
blockstart = offset;
|
|
||||||
nameLen = ( fru_data[offset++] &= 0x3F );
|
nameLen = ( fru_data[offset++] &= 0x3F );
|
||||||
printf(" Name: %*.*s\n",nameLen, nameLen, (const char *)(fru_data+offset));
|
printf(" Name: %*.*s\n",nameLen, nameLen, (const char *)(fru_data+offset));
|
||||||
|
|
||||||
@ -1743,7 +1740,6 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
|
|||||||
version = oh->record_version;
|
version = oh->record_version;
|
||||||
|
|
||||||
if( version == formatVersion ){
|
if( version == formatVersion ){
|
||||||
int blockstart;
|
|
||||||
uint8_t blockCount;
|
uint8_t blockCount;
|
||||||
uint8_t blockIndex=0;
|
uint8_t blockIndex=0;
|
||||||
|
|
||||||
@ -1765,8 +1761,6 @@ static int ipmi_fru_oemkontron_edit( int argc, char ** argv,uint8_t * fru_data,
|
|||||||
void * pRecordData;
|
void * pRecordData;
|
||||||
uint8_t nameLen;
|
uint8_t nameLen;
|
||||||
|
|
||||||
blockstart = offset;
|
|
||||||
|
|
||||||
nameLen = ( fru_data[offset++] & 0x3F );
|
nameLen = ( fru_data[offset++] & 0x3F );
|
||||||
|
|
||||||
if( version == 0 || version == 1 )
|
if( version == 0 || version == 1 )
|
||||||
@ -3357,6 +3351,9 @@ ipmi_fru_edit_multirec(struct ipmi_intf * intf, uint8_t id ,
|
|||||||
retStatus = ipmi_fru_get_multirec_location_from_fru(intf, id, &fruInfo,
|
retStatus = ipmi_fru_get_multirec_location_from_fru(intf, id, &fruInfo,
|
||||||
&offFruMultiRec,
|
&offFruMultiRec,
|
||||||
&fruMultiRecSize);
|
&fruMultiRecSize);
|
||||||
|
if (retStatus != 0) {
|
||||||
|
return retStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
lprintf(LOG_DEBUG, "FRU Size : %lu\n", fruMultiRecSize);
|
lprintf(LOG_DEBUG, "FRU Size : %lu\n", fruMultiRecSize);
|
||||||
@ -3406,14 +3403,13 @@ ipmi_fru_edit_multirec(struct ipmi_intf * intf, uint8_t id ,
|
|||||||
|
|
||||||
{
|
{
|
||||||
uint8_t * fru_data;
|
uint8_t * fru_data;
|
||||||
uint32_t fru_len, i;
|
uint32_t i;
|
||||||
uint32_t offset= offFruMultiRec;
|
uint32_t offset= offFruMultiRec;
|
||||||
struct fru_multirec_header * h;
|
struct fru_multirec_header * h;
|
||||||
uint32_t last_off, len;
|
uint32_t last_off, len;
|
||||||
uint8_t error=0;
|
uint8_t error=0;
|
||||||
|
|
||||||
i = last_off = offset;
|
i = last_off = offset;
|
||||||
fru_len = 0;
|
|
||||||
|
|
||||||
memset(&fru, 0, sizeof(fru));
|
memset(&fru, 0, sizeof(fru));
|
||||||
fru_data = malloc(fru.size + 1);
|
fru_data = malloc(fru.size + 1);
|
||||||
@ -3560,6 +3556,9 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
|
|||||||
retStatus = ipmi_fru_get_multirec_location_from_fru(intf, id, &fruInfo,
|
retStatus = ipmi_fru_get_multirec_location_from_fru(intf, id, &fruInfo,
|
||||||
&offFruMultiRec,
|
&offFruMultiRec,
|
||||||
&fruMultiRecSize);
|
&fruMultiRecSize);
|
||||||
|
if (retStatus != 0) {
|
||||||
|
return retStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
lprintf(LOG_DEBUG, "FRU Size : %lu\n", fruMultiRecSize);
|
lprintf(LOG_DEBUG, "FRU Size : %lu\n", fruMultiRecSize);
|
||||||
@ -3609,14 +3608,13 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
|
|||||||
|
|
||||||
{
|
{
|
||||||
uint8_t * fru_data;
|
uint8_t * fru_data;
|
||||||
uint32_t fru_len, i;
|
uint32_t i;
|
||||||
uint32_t offset= offFruMultiRec;
|
uint32_t offset= offFruMultiRec;
|
||||||
struct fru_multirec_header * h;
|
struct fru_multirec_header * h;
|
||||||
uint32_t last_off, len;
|
uint32_t last_off, len;
|
||||||
uint8_t error=0;
|
uint8_t error=0;
|
||||||
|
|
||||||
i = last_off = offset;
|
i = last_off = offset;
|
||||||
fru_len = 0;
|
|
||||||
|
|
||||||
fru_data = malloc(fru.size + 1);
|
fru_data = malloc(fru.size + 1);
|
||||||
if (fru_data == NULL) {
|
if (fru_data == NULL) {
|
||||||
@ -4851,7 +4849,7 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
|
|||||||
uint8_t *fru_data_new = NULL;
|
uint8_t *fru_data_new = NULL;
|
||||||
uint8_t *fru_area = NULL;
|
uint8_t *fru_area = NULL;
|
||||||
uint32_t fru_field_offset, fru_field_offset_tmp;
|
uint32_t fru_field_offset, fru_field_offset_tmp;
|
||||||
uint32_t fru_section_len, old_section_len, header_offset;
|
uint32_t fru_section_len, header_offset;
|
||||||
uint32_t chassis_offset, board_offset, product_offset;
|
uint32_t chassis_offset, board_offset, product_offset;
|
||||||
uint32_t chassis_len, board_len, product_len, product_len_new;
|
uint32_t chassis_len, board_len, product_len, product_len_new;
|
||||||
int num_byte_change = 0, padding_len = 0;
|
int num_byte_change = 0, padding_len = 0;
|
||||||
@ -4925,9 +4923,6 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
|
|||||||
goto ipmi_fru_set_field_string_rebuild_out;
|
goto ipmi_fru_set_field_string_rebuild_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Keep length for future old section display */
|
|
||||||
old_section_len = fru_section_len;
|
|
||||||
|
|
||||||
/*************************
|
/*************************
|
||||||
3) Seek to field index */
|
3) Seek to field index */
|
||||||
for (i = 0;i <= f_index; i++) {
|
for (i = 0;i <= f_index; i++) {
|
||||||
|
@ -300,7 +300,6 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option)
|
|||||||
struct HpmfwupgGetTargetUpgCapabilitiesCtx targetCapCmd;
|
struct HpmfwupgGetTargetUpgCapabilitiesCtx targetCapCmd;
|
||||||
int rc = HPMFWUPG_SUCCESS;
|
int rc = HPMFWUPG_SUCCESS;
|
||||||
int componentId = 0;
|
int componentId = 0;
|
||||||
int flagColdReset = FALSE;
|
|
||||||
struct ipm_devid_rsp devIdrsp;
|
struct ipm_devid_rsp devIdrsp;
|
||||||
struct HpmfwupgGetComponentPropertiesCtx getCompProp;
|
struct HpmfwupgGetComponentPropertiesCtx getCompProp;
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
@ -437,13 +436,6 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option)
|
|||||||
gVersionInfo[componentId].deferredAux[2] = 0xff;
|
gVersionInfo[componentId].deferredAux[2] = 0xff;
|
||||||
gVersionInfo[componentId].deferredAux[3] = 0xff;
|
gVersionInfo[componentId].deferredAux[3] = 0xff;
|
||||||
}
|
}
|
||||||
if (gVersionInfo[componentId].coldResetRequired) {
|
|
||||||
/*
|
|
||||||
* If any of the component indicates that the Payload Cold reset is required
|
|
||||||
* then set the flag
|
|
||||||
*/
|
|
||||||
flagColdReset = TRUE;
|
|
||||||
}
|
|
||||||
if (option & VIEW_MODE) {
|
if (option & VIEW_MODE) {
|
||||||
HpmDisplayVersion(mode,
|
HpmDisplayVersion(mode,
|
||||||
&gVersionInfo[componentId],
|
&gVersionInfo[componentId],
|
||||||
@ -1002,14 +994,11 @@ HpmfwupgUpgradeStage(struct ipmi_intf *intf,
|
|||||||
struct HpmfwupgActionRecord* pActionRecord;
|
struct HpmfwupgActionRecord* pActionRecord;
|
||||||
int rc = HPMFWUPG_SUCCESS;
|
int rc = HPMFWUPG_SUCCESS;
|
||||||
unsigned char *pImagePtr;
|
unsigned char *pImagePtr;
|
||||||
unsigned int actionsSize;
|
|
||||||
int flagColdReset = FALSE;
|
int flagColdReset = FALSE;
|
||||||
/* Put pointer after image header */
|
/* Put pointer after image header */
|
||||||
pImagePtr = (unsigned char*)
|
pImagePtr = (unsigned char*)
|
||||||
(pFwupgCtx->pImageData + sizeof(struct HpmfwupgImageHeader) +
|
(pFwupgCtx->pImageData + sizeof(struct HpmfwupgImageHeader) +
|
||||||
pImageHeader->oemDataLength + sizeof(unsigned char)/*checksum*/);
|
pImageHeader->oemDataLength + sizeof(unsigned char)/*checksum*/);
|
||||||
/* Deternime actions size */
|
|
||||||
actionsSize = pFwupgCtx->imageSize - sizeof(struct HpmfwupgImageHeader);
|
|
||||||
if (!(option & VIEW_MODE)) {
|
if (!(option & VIEW_MODE)) {
|
||||||
HpmDisplayUpgradeHeader();
|
HpmDisplayUpgradeHeader();
|
||||||
}
|
}
|
||||||
|
@ -430,11 +430,9 @@ static int ImeUpgrade(struct ipmi_intf *intf, char* imageFilename)
|
|||||||
|
|
||||||
if(currentPercent != shownPercent)
|
if(currentPercent != shownPercent)
|
||||||
{
|
{
|
||||||
uint16_t timeElapsedSecond;
|
|
||||||
shownPercent = currentPercent;
|
shownPercent = currentPercent;
|
||||||
printf("Percent: %02i, ", shownPercent);
|
printf("Percent: %02i, ", shownPercent);
|
||||||
time(¤t);
|
time(¤t);
|
||||||
timeElapsedSecond = (current-start) + ((current-start)%60);
|
|
||||||
printf("Elapsed time %02ld:%02ld\r",((current-start)/60), ((current-start)%60));
|
printf("Elapsed time %02ld:%02ld\r",((current-start)/60), ((current-start)%60));
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
|
|||||||
struct pef_lan_cfgparm_dest_type * ptype;
|
struct pef_lan_cfgparm_dest_type * ptype;
|
||||||
struct pef_lan_cfgparm_dest_info * pinfo;
|
struct pef_lan_cfgparm_dest_info * pinfo;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
uint8_t tbl_size, dsttype, timeout, retries;
|
uint8_t dsttype, timeout, retries;
|
||||||
|
|
||||||
memset(&lsel, 0, sizeof(lsel));
|
memset(&lsel, 0, sizeof(lsel));
|
||||||
lsel.id = PEF_LAN_CFGPARM_ID_DEST_COUNT;
|
lsel.id = PEF_LAN_CFGPARM_ID_DEST_COUNT;
|
||||||
@ -283,9 +283,6 @@ ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
|
|||||||
"Alert destination count");
|
"Alert destination count");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tbl_size = (rsp->data[1] & PEF_LAN_DEST_TABLE_SIZE_MASK);
|
|
||||||
//if (tbl_size == 0 || dest == 0) /* LAN alerting not supported */
|
|
||||||
// return;
|
|
||||||
|
|
||||||
lsel.id = PEF_LAN_CFGPARM_ID_DESTTYPE;
|
lsel.id = PEF_LAN_CFGPARM_ID_DESTTYPE;
|
||||||
lsel.set = dest;
|
lsel.set = dest;
|
||||||
|
@ -97,7 +97,6 @@ static struct termios _saved_tio;
|
|||||||
static int _in_raw_mode = 0;
|
static int _in_raw_mode = 0;
|
||||||
static int _disable_keepalive = 0;
|
static int _disable_keepalive = 0;
|
||||||
static int _use_sol_for_keepalive = 0;
|
static int _use_sol_for_keepalive = 0;
|
||||||
static int _keepalive_retries = 0;
|
|
||||||
|
|
||||||
extern int verbose;
|
extern int verbose;
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ SendTimedI2cRequest (
|
|||||||
if( status != TRUE ) {
|
if( status != TRUE ) {
|
||||||
DWORD error;
|
DWORD error;
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
return ACCESN_ERROR;
|
return error;
|
||||||
}
|
}
|
||||||
if( respLength == 0 ) {
|
if( respLength == 0 ) {
|
||||||
return ACCESN_ERROR;
|
return ACCESN_ERROR;
|
||||||
@ -1134,7 +1134,7 @@ SendTimedImbpRequest (
|
|||||||
if( status != TRUE ) {
|
if( status != TRUE ) {
|
||||||
DWORD error;
|
DWORD error;
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
return ACCESN_ERROR;
|
return error;
|
||||||
}
|
}
|
||||||
if( respLength == 0 ) {
|
if( respLength == 0 ) {
|
||||||
return ACCESN_ERROR;
|
return ACCESN_ERROR;
|
||||||
@ -1211,7 +1211,7 @@ SendAsyncImbpRequest (
|
|||||||
if( status != TRUE ) {
|
if( status != TRUE ) {
|
||||||
DWORD error;
|
DWORD error;
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
return ACCESN_ERROR;
|
return error;
|
||||||
}
|
}
|
||||||
if( respLength != 2 ) {
|
if( respLength != 2 ) {
|
||||||
return ACCESN_ERROR;
|
return ACCESN_ERROR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user