All,

I spent some time to enable some compiler warning messages which flag code 
defects.
I then went about cleanup up these defects as well as the warnings which were 
already
being  flagged.

Here is the new CFLAGS for ipmitool compiles:

CFLAGS="$CFLAGS -fno-strict-aliasing -Wreturn-type -Wno-unused-result -Wno-pack
ed-bitfield-compat"

I had to add the no-packed-bitfield-compat since there is some bit packing 
being flagged
as a warning due to a change in GCC 4.4.  I was unable to figure out the 
correct resolution as I
don't know how these bitfields are supposed to be packed.    If anyone knows 
how to fix the code,
let me know and I'll get rid of the -Wno-packed-bitfield-compat on CFLAGS.

.../include/ipmitool/ipmi_fru.h:415:1: note: offset of packed bit-field 
'local_chn' has changed in GCC 4.4
../include/ipmitool/ipmi_fru.h:527:1: note: offset of packed bit-field 
'lane1port' has changed in GCC 4.4
../include/ipmitool/ipmi_fru.h:527:1: note: offset of packed bit-field 
'lane3port' has changed in GCC 4.4

If anyone has some time, please help me out with a code review. I'm going to 
submit this on Friday
unless I hear that someone can take the time to review it for me.

Thanks in Advance,
Jim

--
-- Jim Mankovich | jm...@hp.com --

>From cd463c9bd0b9bd01d210882619a68b581ca3ecc9 Mon Sep 17 00:00:00 2001
From: Jim Mankovich <jm...@hp.com>
Date: Mon, 30 Jul 2012 12:27:49 -0600
Subject: [PATCH] Cleanup all compiler warnings

Enable compiler warnings and resolve every compiler warning so that 
ipmitool builds cleanly

Signed-off-by: Jim Mankovich <jm...@hp.com>
---
 configure.in          |    2 +-
 lib/helper.c          |    2 +-
 lib/ipmi_chassis.c    |   10 +++---
 lib/ipmi_dcmi.c       |    6 ++--
 lib/ipmi_delloem.c    |   83 +++++++++++++++++++++++++------------------------
 lib/ipmi_ekanalyzer.c |    8 ++---
 lib/ipmi_fru.c        |    6 ++--
 lib/ipmi_gendev.c     |    4 +--
 lib/ipmi_hpmfwupg.c   |   14 ++++-----
 lib/ipmi_ime.c        |    8 +++--
 lib/ipmi_picmg.c      |   14 +++------
 lib/ipmi_sel.c        |    2 +-
 lib/ipmi_sensor.c     |    2 +-
 src/plugins/lan/lan.c |    7 ++---
 14 files changed, 84 insertions(+), 84 deletions(-)

diff --git a/configure.in b/configure.in
index 680619c..a32967f 100644
--- a/configure.in
+++ b/configure.in
@@ -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"
diff --git a/lib/helper.c b/lib/helper.c
index fb10770..9db693a 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -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;
diff --git a/lib/ipmi_chassis.c b/lib/ipmi_chassis.c
index b1c9d60..94124d3 100644
--- a/lib/ipmi_chassis.c
+++ b/lib/ipmi_chassis.c
@@ -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);
          }
 
       }
diff --git a/lib/ipmi_dcmi.c b/lib/ipmi_dcmi.c
index f33ba5a..d618b48 100755
--- a/lib/ipmi_dcmi.c
+++ b/lib/ipmi_dcmi.c
@@ -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:                   ");
diff --git a/lib/ipmi_delloem.c b/lib/ipmi_delloem.c
index 937dcac..3819763 100644
--- a/lib/ipmi_delloem.c
+++ b/lib/ipmi_delloem.c
@@ -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;
diff --git a/lib/ipmi_ekanalyzer.c b/lib/ipmi_ekanalyzer.c
index 9ec248b..b34a2aa 100644
--- a/lib/ipmi_ekanalyzer.c
+++ b/lib/ipmi_ekanalyzer.c
@@ -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;
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index 573887c..59a6a55 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -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)
 						-
diff --git a/lib/ipmi_gendev.c b/lib/ipmi_gendev.c
index 04b55ef..7a4cf08 100644
--- a/lib/ipmi_gendev.c
+++ b/lib/ipmi_gendev.c
@@ -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
          {
diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c
index 395b673..46bcb31 100644
--- a/lib/ipmi_hpmfwupg.c
+++ b/lib/ipmi_hpmfwupg.c
@@ -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) )
    {
diff --git a/lib/ipmi_ime.c b/lib/ipmi_ime.c
index f6924de..d2102ec 100755
--- a/lib/ipmi_ime.c
+++ b/lib/ipmi_ime.c
@@ -435,7 +435,7 @@ static int ImeUpgrade(struct ipmi_intf *intf, char* imageFilename)
             printf("Percent: %02i,  ", shownPercent);
             time(&current);
             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;
    }
 }
 
diff --git a/lib/ipmi_picmg.c b/lib/ipmi_picmg.c
index 03a8b08..7182f63 100644
--- a/lib/ipmi_picmg.c
+++ b/lib/ipmi_picmg.c
@@ -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
 
diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c
index 3d2017d..3c99b66 100644
--- a/lib/ipmi_sel.c
+++ b/lib/ipmi_sel.c
@@ -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.*/
diff --git a/lib/ipmi_sensor.c b/lib/ipmi_sensor.c
index 7e5cf85..92cf240 100644
--- a/lib/ipmi_sensor.c
+++ b/lib/ipmi_sensor.c
@@ -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;
 		}
diff --git a/src/plugins/lan/lan.c b/src/plugins/lan/lan.c
index 9752985..63c7ed6 100644
--- a/src/plugins/lan/lan.c
+++ b/src/plugins/lan/lan.c
@@ -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);
-- 
1.7.9.5

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to