mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-01-21 16:42:19 +08:00
Enable compiler warnings and resolve all compiler warning so that
ipmitool compiles and links with no warning or error messages
This commit is contained in:
parent
342e71d577
commit
89037b5158
@ -33,7 +33,7 @@ AC_CHECK_FUNCS([alarm gethostbyname socket select])
|
||||
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
|
||||
AC_CHECK_FUNCS([getpassphrase])
|
||||
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing -Wreturn-type -Wno-unused-result -Wno-packed-bitfield-compat"
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
|
||||
@ -306,7 +306,7 @@ int str2ushort(const char * str, uint16_t * ushrt_ptr)
|
||||
int str2uchar(const char * str, uint8_t * uchr_ptr)
|
||||
{
|
||||
int rc = (-3);
|
||||
int64_t arg_ulong = 0;
|
||||
uint64_t arg_ulong = 0;
|
||||
if ( (rc = str2ulong(str, &arg_ulong)) != 0 ) {
|
||||
*uchr_ptr = 0;
|
||||
return rc;
|
||||
|
||||
@ -231,10 +231,10 @@ ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
minutes -= hours * 60;
|
||||
|
||||
if (mins_per_count < 60) {
|
||||
printf("POH Counter : %li days, %li hours, %li minutes\n",
|
||||
printf("POH Counter : %i days, %i hours, %li minutes\n",
|
||||
days, hours, (long)minutes);
|
||||
} else {
|
||||
printf("POH Counter : %li days, %li hours\n", days, hours);
|
||||
printf("POH Counter : %i days, %i hours\n", days, hours);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -730,14 +730,14 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
|
||||
printf(" Boot Initiator Info :\n");
|
||||
printf(" Channel Number : %d\n", (rsp->data[2] & 0x0f));
|
||||
printf(" Session Id : %08Xh\n",session_id);
|
||||
printf(" Session Id : %08lXh\n",session_id);
|
||||
if(timestamp != 0)
|
||||
{
|
||||
printf(" Timestamp : %08Xh, %s\n",timestamp,time_buf);
|
||||
printf(" Timestamp : %08lXh, %s\n",timestamp,time_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" Timestamp : %08Xh, undefined\n",timestamp);
|
||||
printf(" Timestamp : %08lXh, undefined\n",timestamp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ uint16_t str2val2(const char *str, const struct dcmi_cmd *vs)
|
||||
int i;
|
||||
|
||||
if (vs == NULL || str == NULL)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
if (strncasecmp(vs[i].str, str, __maxlen(str, vs[i].str)) == 0)
|
||||
@ -346,7 +346,7 @@ const char * val2str2(uint16_t val, const struct dcmi_cmd *vs)
|
||||
int i;
|
||||
|
||||
if (vs == NULL)
|
||||
return;
|
||||
return NULL;
|
||||
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
if (vs[i].val == val)
|
||||
@ -1089,7 +1089,7 @@ static int ipmi_dcmi_pwr_rd(struct ipmi_intf * intf) {
|
||||
printf(" Average power reading over sample period: %8d Watts\n",
|
||||
val.avg_pwr);
|
||||
printf(" IPMI timestamp: %s",
|
||||
ctime(&val.time_stamp));
|
||||
ctime((time_t *)&val.time_stamp));
|
||||
printf(" Sampling period: %08d Milliseconds\n",
|
||||
val.sample);
|
||||
printf(" Power reading state is: ");
|
||||
|
||||
@ -143,7 +143,7 @@ static void usage(void);
|
||||
|
||||
/* LCD Function prototypes */
|
||||
static int ipmi_delloem_lcd_main (struct ipmi_intf * intf, int argc, char ** argv);
|
||||
static int ipmi_lcd_get_platform_model_name (struct ipmi_intf * intf,char* lcdstring,
|
||||
static void ipmi_lcd_get_platform_model_name (struct ipmi_intf * intf,char* lcdstring,
|
||||
uint8_t max_length,uint8_t field_type);
|
||||
static int ipmi_idracvalidator_command (struct ipmi_intf * intf);
|
||||
static int ipmi_lcd_get_configure_command_wh (struct ipmi_intf * intf);
|
||||
@ -231,7 +231,7 @@ static void ipmi_vFlash_usage(void);
|
||||
/* LED Function prototypes */
|
||||
|
||||
static int ipmi_getsesmask(int, char **);
|
||||
static int CheckSetLEDSupport(struct ipmi_intf * intf);
|
||||
static void CheckSetLEDSupport(struct ipmi_intf * intf);
|
||||
static int IsSetLEDSupported(void);
|
||||
static void ipmi_setled_usage(void);
|
||||
static int ipmi_delloem_setled_main(struct ipmi_intf *intf, int argc, char ** argv);
|
||||
@ -636,7 +636,7 @@ static int ipmi_delloem_lcd_main (struct ipmi_intf * intf, int argc, char ** arg
|
||||
ipmi_lcd_usage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@ -654,7 +654,7 @@ static int ipmi_delloem_lcd_main (struct ipmi_intf * intf, int argc, char ** arg
|
||||
* Return:
|
||||
*
|
||||
******************************************************************/
|
||||
static int
|
||||
static void
|
||||
ipmi_lcd_get_platform_model_name (struct ipmi_intf * intf,
|
||||
char* lcdstring,
|
||||
uint8_t max_length,
|
||||
@ -1946,7 +1946,7 @@ static int ipmi_delloem_mac_main (struct ipmi_intf * intf, int argc, char ** arg
|
||||
{
|
||||
ipmi_mac_usage();
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@ -2553,6 +2553,7 @@ static int ipmi_delloem_lan_main (struct ipmi_intf * intf, int argc, char ** arg
|
||||
ipmi_lan_usage();
|
||||
return -1;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@ -3249,6 +3250,7 @@ static int ipmi_delloem_powermonitor_main (struct ipmi_intf * intf, int argc, ch
|
||||
ipmi_powermonitor_usage();
|
||||
return -1;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@ -3740,13 +3742,13 @@ static int ipmi_get_power_headroom_command (struct ipmi_intf * intf,uint8_t unit
|
||||
peakpowerheadroombtuphr=watt_to_btuphr_conversion(powerheadroom.peakheadroom);
|
||||
instantpowerhearoom= watt_to_btuphr_conversion(powerheadroom.instheadroom);
|
||||
|
||||
printf ("System Instantaneous Headroom : %ld BTU/hr\n",instantpowerhearoom);
|
||||
printf ("System Peak Headroom : %ld BTU/hr\n",peakpowerheadroombtuphr);
|
||||
printf ("System Instantaneous Headroom : %lld BTU/hr\n",instantpowerhearoom);
|
||||
printf ("System Peak Headroom : %lld BTU/hr\n",peakpowerheadroombtuphr);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("System Instantaneous Headroom : %ld W\n",powerheadroom.instheadroom);
|
||||
printf ("System Peak Headroom : %ld W\n",powerheadroom.peakheadroom);
|
||||
printf ("System Instantaneous Headroom : %d W\n",powerheadroom.instheadroom);
|
||||
printf ("System Peak Headroom : %d W\n",powerheadroom.peakheadroom);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -4239,33 +4241,33 @@ static int ipmi_print_power_consmpt_history(struct ipmi_intf* intf,int unit )
|
||||
{
|
||||
printf ("Average Power Consumption ");
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(avgpower.lastminutepower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(avgpower.lasthourpower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(avgpower.lastdaypower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(avgpower.lastweakpower);
|
||||
printf ("%4d BTU/hr\n",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr\n",tempbtuphrconv);
|
||||
|
||||
printf ("Max Power Consumption ");
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(stPeakpower.lastminutepower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(stPeakpower.lasthourpower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(stPeakpower.lastdaypower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(stPeakpower.lastweakpower);
|
||||
printf ("%4d BTU/hr\n",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr\n",tempbtuphrconv);
|
||||
|
||||
printf ("Min Power Consumption ");
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(stMinpower.lastminutepower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(stMinpower.lasthourpower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(stMinpower.lastdaypower);
|
||||
printf ("%4d BTU/hr ",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr ",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(stMinpower.lastweakpower);
|
||||
printf ("%4d BTU/hr\n\n",tempbtuphrconv);
|
||||
printf ("%4lld BTU/hr\n\n",tempbtuphrconv);
|
||||
|
||||
}
|
||||
else
|
||||
@ -4273,33 +4275,33 @@ static int ipmi_print_power_consmpt_history(struct ipmi_intf* intf,int unit )
|
||||
|
||||
printf ("Average Power Consumption ");
|
||||
tempbtuphrconv=(avgpower.lastminutepower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(avgpower.lasthourpower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(avgpower.lastdaypower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(avgpower.lastweakpower);
|
||||
printf ("%4ld W \n",tempbtuphrconv);
|
||||
printf ("%4lld W \n",tempbtuphrconv);
|
||||
|
||||
printf ("Max Power Consumption ");
|
||||
tempbtuphrconv=(stPeakpower.lastminutepower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(stPeakpower.lasthourpower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(stPeakpower.lastdaypower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(stPeakpower.lastweakpower);
|
||||
printf ("%4ld W \n",tempbtuphrconv);
|
||||
printf ("%4lld W \n",tempbtuphrconv);
|
||||
|
||||
printf ("Min Power Consumption ");
|
||||
tempbtuphrconv=(stMinpower.lastminutepower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(stMinpower.lasthourpower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(stMinpower.lastdaypower);
|
||||
printf ("%4ld W ",tempbtuphrconv);
|
||||
printf ("%4lld W ",tempbtuphrconv);
|
||||
tempbtuphrconv=(stMinpower.lastweakpower);
|
||||
printf ("%4ld W \n\n",tempbtuphrconv);
|
||||
printf ("%4lld W \n\n",tempbtuphrconv);
|
||||
}
|
||||
|
||||
lastminutepeakpower=stPeakpower.lastminutepowertime;
|
||||
@ -4454,16 +4456,16 @@ static int ipmi_print_power_cap(struct ipmi_intf* intf,uint8_t unit )
|
||||
{
|
||||
if (unit ==btuphr){
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(ipmipowercap.MaximumPowerConsmp);
|
||||
printf ("Maximum power: %ld BTU/hr\n",tempbtuphrconv);
|
||||
printf ("Maximum power: %lld BTU/hr\n",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(ipmipowercap.MinimumPowerConsmp);
|
||||
printf ("Minimum power: %ld BTU/hr\n",tempbtuphrconv);
|
||||
printf ("Minimum power: %lld BTU/hr\n",tempbtuphrconv);
|
||||
tempbtuphrconv=watt_to_btuphr_conversion(ipmipowercap.PowerCap);
|
||||
printf ("Power cap : %ld BTU/hr\n",tempbtuphrconv);
|
||||
printf ("Power cap : %lld BTU/hr\n",tempbtuphrconv);
|
||||
}else{
|
||||
|
||||
printf ("Maximum power: %ld Watt\n",ipmipowercap.MaximumPowerConsmp);
|
||||
printf ("Minimum power: %ld Watt\n",ipmipowercap.MinimumPowerConsmp);
|
||||
printf ("Power cap : %ld Watt\n",ipmipowercap.PowerCap);
|
||||
printf ("Maximum power: %d Watt\n",ipmipowercap.MaximumPowerConsmp);
|
||||
printf ("Minimum power: %d Watt\n",ipmipowercap.MinimumPowerConsmp);
|
||||
printf ("Power cap : %d Watt\n",ipmipowercap.PowerCap);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
@ -4818,6 +4820,7 @@ static int ipmi_delloem_vFlash_main (struct ipmi_intf * intf, int argc, char **
|
||||
|
||||
current_arg++;
|
||||
rc = ipmi_delloem_vFlash_process(intf, current_arg, argv);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@ -5038,7 +5041,7 @@ IsSetLEDSupported(void)
|
||||
return SetLEDSupported;
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
CheckSetLEDSupport(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp = NULL;
|
||||
|
||||
@ -2420,7 +2420,7 @@ ipmi_ek_display_fru_header_detail( char * filename )
|
||||
len = (header.offset.board * FACTOR_OFFSET)
|
||||
- (header.offset.internal * FACTOR_OFFSET);
|
||||
}
|
||||
printf("Length: %d\n", len);
|
||||
printf("Length: %ld\n", len);
|
||||
printf("Data dump:\n");
|
||||
while ( (len > 0) && ( !feof (input_file) ) ) {
|
||||
unsigned char data;
|
||||
@ -3071,7 +3071,7 @@ ipmi_ek_display_shelf_power_distribution_record(
|
||||
max_int = record->data[offset+0] | (record->data[offset+1]<<8);
|
||||
printf(" Max Internal Current:\t %ld Amps\n", (max_int*10));
|
||||
offset += 2;
|
||||
printf(" Min Expected Operating Voltage: %ld Volts\n",
|
||||
printf(" Min Expected Operating Voltage: %d Volts\n",
|
||||
(record->data[offset++]/2));
|
||||
entries = record->data[offset++];
|
||||
printf(" Feed to FRU count: 0x%02x\n", entries);
|
||||
@ -3846,7 +3846,7 @@ ipmi_ek_display_clock_config_record( struct ipmi_ek_multi_header * record )
|
||||
(feature > 1) & 1,
|
||||
(feature&1)?"Source":"Receiver");
|
||||
printf("\tFamily: 0x%02x - AccLVL: 0x%02x\n", family, accuracy);
|
||||
printf("\tFRQ: %-9d - min: %-9d - max: %-9d\n",
|
||||
printf("\tFRQ: %-9ld - min: %-9ld - max: %-9ld\n",
|
||||
freq, min_freq, max_freq);
|
||||
}
|
||||
printf("\n");
|
||||
@ -3899,7 +3899,7 @@ ipmi_ekanalyzer_fru_file2structure( char * filename,
|
||||
int record_count = 0;
|
||||
|
||||
if ( verbose == LOG_DEBUG ){
|
||||
printf( "start multi offset = 0x%02x\n", multi_offset );
|
||||
printf( "start multi offset = 0x%02lx\n", multi_offset );
|
||||
}
|
||||
/*the offset value is in multiple of 8 bytes.*/
|
||||
multi_offset = multi_offset * 8;
|
||||
|
||||
@ -4549,7 +4549,7 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
|
||||
/*************************
|
||||
1) Read ALL FRU */
|
||||
printf("Read All FRU area\n");
|
||||
printf("Fru Size : %lu bytes\n", fru.size);
|
||||
printf("Fru Size : %u bytes\n", fru.size);
|
||||
|
||||
/* Read current fru data */
|
||||
read_fru_area(intf ,&fru, fruId, 0, fru.size , fru_data_old);
|
||||
@ -4617,7 +4617,7 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
|
||||
}
|
||||
|
||||
#ifdef DBG_RESIZE_FRU
|
||||
printf("Section Length: %lu\n", fru_section_len);
|
||||
printf("Section Length: %u\n", fru_section_len);
|
||||
#endif
|
||||
|
||||
/*************************
|
||||
@ -4779,7 +4779,7 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
|
||||
|
||||
/* Copy remaing bytes in section */
|
||||
#ifdef DBG_RESIZE_FRU
|
||||
printf("Copying remaining of sections: %lu \n",
|
||||
printf("Copying remaining of sections: %u \n",
|
||||
(
|
||||
(fru_data_old + header_offset + fru_section_len - 1)
|
||||
-
|
||||
|
||||
@ -323,7 +323,7 @@ ipmi_gendev_read_file(
|
||||
}
|
||||
if(counter == (eeprom_info.size))
|
||||
{
|
||||
printf("\r%100 percent completed\n");
|
||||
printf("\r%%100 percent completed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -510,7 +510,7 @@ ipmi_gendev_write_file(
|
||||
}
|
||||
if(counter == (eeprom_info.size))
|
||||
{
|
||||
printf("\r%100 percent completed\n");
|
||||
printf("\r%%100 percent completed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1103,7 +1103,7 @@ static int HpmFwupgActionUploadFirmware
|
||||
int HpmGetUserInput(char *str)
|
||||
{
|
||||
char userInput[2];
|
||||
printf(str);
|
||||
printf("%s", str);
|
||||
scanf("%s",userInput);
|
||||
if (toupper(userInput[0]) == 'Y')
|
||||
{
|
||||
@ -1172,7 +1172,7 @@ void HpmDisplayUpgrade( int skip, unsigned int totalSent,
|
||||
if (totalSent== displayFWLength)
|
||||
{
|
||||
/* Display the time taken to complete the upgrade */
|
||||
printf("| | Upload Time: %02d.%02d | Image Size: %05x |\n",
|
||||
printf("| | Upload Time: %02ld.%02ld | Image Size: %05x |\n",
|
||||
timeElapsed/60,timeElapsed%60,totalSent);
|
||||
}
|
||||
}
|
||||
@ -1184,7 +1184,7 @@ void HpmDisplayUpgrade( int skip, unsigned int totalSent,
|
||||
* Description: This function displays the information about version header
|
||||
*
|
||||
*****************************************************************************/
|
||||
int HpmDisplayVersionHeader(int mode)
|
||||
void HpmDisplayVersionHeader(int mode)
|
||||
{
|
||||
if ( mode & IMAGE_VER)
|
||||
{
|
||||
@ -1209,7 +1209,7 @@ int HpmDisplayVersionHeader(int mode)
|
||||
* Description: This function displays the version of the image and target
|
||||
*
|
||||
*****************************************************************************/
|
||||
int HpmDisplayVersion(int mode,VERSIONINFO *pVersion)
|
||||
void HpmDisplayVersion(int mode,VERSIONINFO *pVersion)
|
||||
{
|
||||
char descString[12];
|
||||
memset(&descString,0x00,12);
|
||||
@ -1299,7 +1299,7 @@ int HpmfwupgTargetCheck(struct ipmi_intf * intf, int option)
|
||||
if (rc != HPMFWUPG_SUCCESS)
|
||||
{
|
||||
lprintf(LOG_NOTICE,"Verify whether the Target board is present \n");
|
||||
return;
|
||||
return HPMFWUPG_ERROR;
|
||||
}
|
||||
|
||||
rc = HpmfwupgGetTargetUpgCapabilities(intf, &targetCapCmd);
|
||||
@ -2455,7 +2455,7 @@ static int HpmFwupgActionUploadFirmware
|
||||
}
|
||||
if (displayFWLength == totalSent)
|
||||
{
|
||||
printf("\n Time Taken %02d:%02d",(end-start)/60, (end-start)%60);
|
||||
printf("\n Time Taken %02ld:%02ld",(end-start)/60, (end-start)%60);
|
||||
printf("\n\n");
|
||||
}
|
||||
}
|
||||
@ -3723,7 +3723,7 @@ int ipmi_hpmfwupg_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if ( (argc == 0) || (strcmp(argv[0], "help") == 0) )
|
||||
{
|
||||
HpmfwupgPrintUsage();
|
||||
return;
|
||||
return HPMFWUPG_ERROR;
|
||||
}
|
||||
if ( (strcmp(argv[0], "check") == 0) )
|
||||
{
|
||||
|
||||
@ -435,7 +435,7 @@ static int ImeUpgrade(struct ipmi_intf *intf, char* imageFilename)
|
||||
printf("Percent: %02i, ", shownPercent);
|
||||
time(¤t);
|
||||
timeElapsedSecond = (current-start) + ((current-start)%60);
|
||||
printf("Elapsed time %02d:%02d\r",((current-start)/60), ((current-start)%60));
|
||||
printf("Elapsed time %02ld:%02ld\r",((current-start)/60), ((current-start)%60));
|
||||
fflush(stdout);
|
||||
|
||||
}
|
||||
@ -484,13 +484,13 @@ static int ImeUpgrade(struct ipmi_intf *intf, char* imageFilename)
|
||||
)
|
||||
{
|
||||
time(&end);
|
||||
printf("Update Completed in %02d:%02d\n",(end-start)/60, (end-start)%60);
|
||||
printf("Update Completed in %02ld:%02ld\n",(end-start)/60, (end-start)%60);
|
||||
}
|
||||
else
|
||||
{
|
||||
time(&end);
|
||||
printf("Update Error\n");
|
||||
printf("\nTime Taken %02d:%02d\n",(end-start)/60, (end-start)%60);
|
||||
printf("\nTime Taken %02ld:%02ld\n",(end-start)/60, (end-start)%60);
|
||||
}
|
||||
|
||||
return rc;
|
||||
@ -969,10 +969,12 @@ static int ImeManualRollback(struct ipmi_intf *intf)
|
||||
)
|
||||
{
|
||||
printf("Manual Rollback Succeed\n");
|
||||
return IME_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Manual Rollback Completed With Error\n");
|
||||
return IME_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -432,11 +432,11 @@ ipmi_picmg_portstate_get(struct ipmi_intf * intf, int interface,int channel,
|
||||
}
|
||||
else if (d->type >= 0x06 && d->type <= 0xef)
|
||||
{
|
||||
printf("Reserved\n",d->type);
|
||||
printf("Reserved\n");
|
||||
}
|
||||
else if (d->type >= 0xf0 && d->type <= 0xfe)
|
||||
{
|
||||
printf("OEM GUID Definition\n",d->type);
|
||||
printf("OEM GUID Definition\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -508,7 +508,6 @@ ipmi_picmg_portstate_set(struct ipmi_intf * intf, int interface, int channel,
|
||||
struct ipmi_rq req;
|
||||
|
||||
unsigned char msg_data[6];
|
||||
struct fru_picmgext_link_desc* d;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
@ -799,7 +798,7 @@ ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("LED Color Capabilities: ", rsp->data[1] );
|
||||
printf("LED Color Capabilities: ");
|
||||
for ( i=0 ; i<8 ; i++ ) {
|
||||
if ( rsp->data[1] & (0x01 << i) ) {
|
||||
printf("%s, ", led_color_str[ i ]);
|
||||
@ -982,7 +981,6 @@ ipmi_picmg_get_power_level(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
int
|
||||
ipmi_picmg_set_power_level(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int i;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
@ -1114,7 +1112,6 @@ ipmi_picmg_fru_control(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
int
|
||||
ipmi_picmg_clk_get(struct ipmi_intf * intf, int clk_id,int clk_res,int mode)
|
||||
{
|
||||
int i;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
@ -1204,7 +1201,7 @@ ipmi_picmg_clk_get(struct ipmi_intf * intf, int clk_id,int clk_res,int mode)
|
||||
oemval2str( rsp->data[3], rsp->data[4],
|
||||
picmg_clk_accuracy_vals));
|
||||
|
||||
printf(" - Freq: %d\n", freq);
|
||||
printf(" - Freq: %ld\n", freq);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1215,7 +1212,6 @@ ipmi_picmg_clk_get(struct ipmi_intf * intf, int clk_id,int clk_res,int mode)
|
||||
int
|
||||
ipmi_picmg_clk_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int i;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
@ -1262,7 +1258,7 @@ printf("## index: %d\n", msg_data[2]);
|
||||
printf("## setting: 0x%02x\n", msg_data[3]);
|
||||
printf("## family: %d\n", msg_data[4]);
|
||||
printf("## acc: %d\n", msg_data[5]);
|
||||
printf("## freq: %d\n", freq );
|
||||
printf("## freq: %ld\n", freq );
|
||||
printf("## res: %d\n", msg_data[10]);
|
||||
#endif
|
||||
|
||||
|
||||
@ -754,7 +754,7 @@ char * get_dell_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
|
||||
// For the SPEC 1.5 Only the DIMM Number is Valid.
|
||||
if(0x51 == version)
|
||||
{
|
||||
snprintf(tmpdesc, SIZE_OF_DESC, "DIMM %s", ('A'+ data3));
|
||||
snprintf(tmpdesc, SIZE_OF_DESC, "DIMM %c", ('A'+ data3));
|
||||
strcat(desc, tmpdesc);
|
||||
}
|
||||
/* For the SPEC 2.0 Decode the DIMM Number as it supports more.*/
|
||||
|
||||
@ -704,7 +704,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
for(i=1;i<=6;i++) {
|
||||
val[i] = sdr_convert_sensor_reading(sdr->record.common, rsp->data[i]);
|
||||
val[i] = sdr_convert_sensor_reading(sdr->record.full, rsp->data[i]);
|
||||
if(val[i] < 0)
|
||||
val[i] = 0;
|
||||
}
|
||||
|
||||
@ -47,6 +47,7 @@
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sel.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_oem.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
@ -79,8 +80,6 @@ static struct ipmi_rs * ipmi_lan_recv_packet(struct ipmi_intf * intf);
|
||||
static struct ipmi_rs * ipmi_lan_poll_recv(struct ipmi_intf * intf);
|
||||
static int ipmi_lan_setup(struct ipmi_intf * intf);
|
||||
static int ipmi_lan_keepalive(struct ipmi_intf * intf);
|
||||
static struct ipmi_rs * ipmi_lan_send_payload(struct ipmi_intf * intf,
|
||||
struct ipmi_v2_payload * payload);
|
||||
static struct ipmi_rs * ipmi_lan_recv_sol(struct ipmi_intf * intf);
|
||||
static struct ipmi_rs * ipmi_lan_send_sol(struct ipmi_intf * intf,
|
||||
struct ipmi_v2_payload * payload);
|
||||
@ -1132,7 +1131,7 @@ uint8_t * ipmi_lan_build_sol_msg(struct ipmi_intf * intf,
|
||||
msg = malloc(len);
|
||||
if (msg == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
memset(msg, 0, len);
|
||||
|
||||
@ -1493,7 +1492,7 @@ ack_sol_packet(struct ipmi_intf * intf,
|
||||
* Receive a SOL packet and send an ACK in response.
|
||||
*
|
||||
*/
|
||||
struct ipmi_rs *
|
||||
static struct ipmi_rs *
|
||||
ipmi_lan_recv_sol(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp = ipmi_lan_poll_recv(intf);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user