--- ipmi-fru-example.c.orig	2011-07-19 13:13:14.213901572 +0200
+++ ipmi-fru-example.c	2011-07-19 13:28:28.517901992 +0200
@@ -1,5 +1,5 @@
 /*****************************************************************************\
- *  $Id: ipmi-fru.c,v 1.59 2010-02-08 22:20:58 chu11 Exp $
+ *  $Id: ipmi-fru-example.c,v 1.59 2010-02-08 22:20:58 chu11 Exp $
  *****************************************************************************
  *  Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
  *  Copyright (C) 2007 The Regents of the University of California.
@@ -65,15 +65,15 @@
                                                   &strbuflen) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_type_length_field_to_string: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_type_length_field_to_string: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
   if (strbuflen)
     printf ("  FRU %s: %s\n",
-	    str,
-	    strbuf);
+        str,
+        strbuf);
 
   return (0);
 }
@@ -107,17 +107,17 @@
                                         IPMI_FRU_CUSTOM_FIELDS) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_chassis_info_area: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_chassis_info_area: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
   if (IPMI_FRU_CHASSIS_TYPE_VALID (chassis_type))
     printf ("  FRU Chassis Type: %s\n",
-	    ipmi_fru_chassis_types[chassis_type]);
+        ipmi_fru_chassis_types[chassis_type]);
   else
     printf ("  FRU Chassis Type: %s\n",
-	    ipmi_fru_chassis_types[IPMI_FRU_CHASSIS_TYPE_UNKNOWN]);
+        ipmi_fru_chassis_types[IPMI_FRU_CHASSIS_TYPE_UNKNOWN]);
 
   /* achu: Chassis Info Area has no language code, assume English. */
 
@@ -184,17 +184,17 @@
                                       IPMI_FRU_CUSTOM_FIELDS) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_board_info_area: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_board_info_area: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
   if (IPMI_FRU_LANGUAGE_CODE_VALID (language_code))
     printf ("  FRU Board Language: %s\n",
-	    ipmi_fru_language_codes[language_code]);
+        ipmi_fru_language_codes[language_code]);
   else
     printf ("  FRU Board Language Code: %02Xh\n",
-	    language_code);
+        language_code);
 
   /* Posix says individual calls need not clear/set all portions of
    * 'struct tm', thus passing 'struct tm' between functions could
@@ -208,7 +208,7 @@
   strftime (mfg_date_time_buf, IPMI_FRU_STR_BUFLEN, "%D - %T", &mfg_date_time_tm);
 
   printf ("  FRU Board Manufacturing Date/Time: %s\n",
-	  mfg_date_time_buf);
+      mfg_date_time_buf);
 
   if (_output_field (language_code,
                      &board_manufacturer,
@@ -291,17 +291,17 @@
                                         IPMI_FRU_CUSTOM_FIELDS) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_product_info_area: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_product_info_area: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
   if (IPMI_FRU_LANGUAGE_CODE_VALID (language_code))
     printf ("  FRU Product Language: %s\n",
-	    ipmi_fru_language_codes[language_code]);
+        ipmi_fru_language_codes[language_code]);
   else
     printf ("  FRU Product Language Code: %02Xh\n",
-	    language_code);
+        language_code);
 
   if (_output_field (language_code,
                      &product_manufacturer_name,
@@ -422,35 +422,35 @@
                                                            &predictive_fail_tachometer_lower_threshold) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_multirecord_power_supply_information: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_multirecord_power_supply_information: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
   printf ("  FRU Power Supply Overall Capacity: %u Watts\n",
-	  overall_capacity);
+      overall_capacity);
   printf ("  FRU Power Supply Peak VA: %u VA\n",
-	  peak_va);
+      peak_va);
   printf ("  FRU Power Supply Max Inrush Current: %u Amps\n",
-	  inrush_current);
+      inrush_current);
   printf ("  FRU Power Supply Inrush Interval: %u ms\n",
-	  inrush_interval);
+      inrush_interval);
   printf ("  FRU Power Supply Low End Input Voltage 1: %u mV\n",
-	  low_end_input_voltage_range_1);
+      low_end_input_voltage_range_1);
   printf ("  FRU Power Supply High End Input Voltage 1: %u mV\n",
-	  high_end_input_voltage_range_1);
+      high_end_input_voltage_range_1);
   printf ("  FRU Power Supply Low End Input Voltage 2: %u mV\n",
-	  low_end_input_voltage_range_2);
+      low_end_input_voltage_range_2);
   printf ("  FRU Power Supply High End Input Voltage 2: %u mV\n",
-	  high_end_input_voltage_range_2);
-  printf ("  FRU Power Supply Low End Acceptable Frequencey: %u Hz\n",
-	  low_end_input_frequency_range);
-  printf ("  FRU Power Supply High End Acceptable Frequencey: %u Hz\n",
-	  high_end_input_frequency_range);
+      high_end_input_voltage_range_2);
+  printf ("  FRU Power Supply Low End Acceptable Frequency: %u Hz\n",
+      low_end_input_frequency_range);
+  printf ("  FRU Power Supply High End Acceptable Frequency: %u Hz\n",
+      high_end_input_frequency_range);
   printf ("  FRU Power Supply A/C Dropout Tolerance: %u ms\n",
-	  ac_dropout_tolerance);
+      ac_dropout_tolerance);
   printf ("  FRU Power Supply Predictive Fail Support: %s\n",
-	  (predictive_fail_support) ? "Yes" : "No");
+      (predictive_fail_support) ? "Yes" : "No");
   if (predictive_fail_support)
     {
       if (tachometer_pulses_per_rotation_predictive_fail_polarity)
@@ -469,22 +469,22 @@
         }
     }
   printf ("  FRU Power Supply Power Factor Correction Supported: %s\n",
-	  (power_factor_correction) ? "Yes" : "No");
+      (power_factor_correction) ? "Yes" : "No");
   printf ("  FRU Power Supply AutoSwitch Supprt: %s\n",
-	  (autoswitch) ? "Yes" : "No");
+      (autoswitch) ? "Yes" : "No");
   printf ("  FRU Power Supply Hot Swap Support: %s\n",
-	  (hot_swap_support) ? "Yes" : "No");
+      (hot_swap_support) ? "Yes" : "No");
 
   printf ("  FRU Power Supply Peak Capacity: %u Watts\n",
-	  peak_capacity);
+      peak_capacity);
   printf ("  FRU Power Supply Hold Up Time: %u s\n",
-	  hold_up_time);
+      hold_up_time);
   printf ("  FRU Power Supply Voltage 1: %s\n",
-	  _voltage_str (voltage_1));
+      _voltage_str (voltage_1));
   printf ("  FRU Power Supply Voltage 2: %s\n",
-	  _voltage_str (voltage_2));
+      _voltage_str (voltage_2));
   printf ("  FRU Power Supply Total Combined Wattage: %u Watts\n",
-	  total_combined_wattage);
+      total_combined_wattage);
 
   return (0);
 }
@@ -518,27 +518,27 @@
                                             &maximum_current_draw) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_multirecord_dc_output: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_multirecord_dc_output: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
   printf ("  FRU DC Output Output Number: %u\n",
-	  output_number);
+      output_number);
   printf ("  FRU DC Output Output on Standy: %s\n",
-	  (standby) ? "Yes" : "No");
+      (standby) ? "Yes" : "No");
   printf ("  FRU DC Output Nominal Voltage: %d mV\n",
-	  (int16_t)nominal_voltage);
+      (int16_t)nominal_voltage);
   printf ("  FRU DC Output Maximum Negative Voltage Deviation: %d mV\n",
-	  (int16_t)maximum_negative_voltage_deviation);
+      (int16_t)maximum_negative_voltage_deviation);
   printf ("  FRU DC Output Maximum Positive Voltage Deviation: %d mV\n",
-	  (int16_t)maximum_positive_voltage_deviation);
+      (int16_t)maximum_positive_voltage_deviation);
   printf ("  FRU DC Output Ripple and Noise pk-pk: %u mV\n",
-	  ripple_and_noise_pk_pk);
+      ripple_and_noise_pk_pk);
   printf ("  FRU DC Output Minimum Current Draw: %u mA\n",
-	  minimum_current_draw);
+      minimum_current_draw);
   printf ("  FRU DC Output Maximum Current Draw: %u mA\n",
-	  maximum_current_draw);
+      maximum_current_draw);
 
   return (0);
 }
@@ -572,25 +572,25 @@
                                           &maximum_current_load) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_multirecord_dc_load: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_multirecord_dc_load: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
   printf ("  FRU DC Load Output Number: %u\n",
-	  output_number);
+      output_number);
   printf ("  FRU DC Load Nominal Voltage: %d mV\n",
-	  (int16_t)nominal_voltage);
+      (int16_t)nominal_voltage);
   printf ("  FRU DC Load Spec'd Minimum Voltage: %d mV\n",
-	  (int16_t)specd_minimum_voltage);
+      (int16_t)specd_minimum_voltage);
   printf ("  FRU DC Load Spec'd Maximum Voltage: %d mV\n",
-	  (int16_t)specd_maximum_voltage);
+      (int16_t)specd_maximum_voltage);
   printf ("  FRU DC Load Spec'd Ripple and Noise pk-pk: %u mV\n",
-	  specd_ripple_and_noise_pk_pk);
+      specd_ripple_and_noise_pk_pk);
   printf ("  FRU DC Load Minimum Current Load: %u mA\n",
-	  minimum_current_load);
+      minimum_current_load);
   printf ("  FRU DC Load Maximum Current Load: %u mA\n",
-	  maximum_current_load);
+      maximum_current_load);
 
   return (0);
 }
@@ -617,29 +617,29 @@
                                                            &sub_record_data_len) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_multirecord_management_access_record: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_multirecord_management_access_record: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
   if (sub_record_type == IPMI_FRU_SUB_RECORD_TYPE_SYSTEM_MANAGEMENT_URL)
     printf ("  FRU Management Access System Management URL: %s\n",
-	    (char *)sub_record_data);
+        (char *)sub_record_data);
   else if (sub_record_type == IPMI_FRU_SUB_RECORD_TYPE_SYSTEM_NAME)
     printf ("  FRU Management Access System Name: %s\n",
-	    (char *)sub_record_data);
+        (char *)sub_record_data);
   else if (sub_record_type == IPMI_FRU_SUB_RECORD_TYPE_SYSTEM_PING_ADDRESS)
     printf ("  FRU Management Access System Ping Address: %s\n",
-	    (char *)sub_record_data);
+        (char *)sub_record_data);
   else if (sub_record_type == IPMI_FRU_SUB_RECORD_TYPE_COMPONENT_MANAGEMENT_URL)
     printf ("  FRU Management Access Component Management URL: %s\n",
-	    (char *)sub_record_data);
+        (char *)sub_record_data);
   else if (sub_record_type == IPMI_FRU_SUB_RECORD_TYPE_COMPONENT_NAME)
     printf ("  FRU Management Access Component Name: %s\n",
-	    (char *)sub_record_data);
+        (char *)sub_record_data);
   else if (sub_record_type == IPMI_FRU_SUB_RECORD_TYPE_COMPONENT_PING_ADDRESS)
     printf ("  FRU Management Access Component Ping Address: %s\n",
-	    (char *)sub_record_data);
+        (char *)sub_record_data);
   else if (sub_record_type == IPMI_FRU_SUB_RECORD_TYPE_SYSTEM_UNIQUE_ID)
     {
       printf ("  FRU Management Access System Unique ID:");
@@ -650,7 +650,7 @@
             printf ("\n    ");
 
           printf (" %02Xh",
-		  sub_record_data[i]);
+          sub_record_data[i]);
         }
       printf ("\n");
     }
@@ -663,7 +663,7 @@
             printf ("\n    ");
 
           printf (" %02Xh",
-		  sub_record_data[i]);
+          sub_record_data[i]);
         }
       printf ("\n");
     }
@@ -700,8 +700,8 @@
                                                             &code_range_mask_len) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_multirecord_base_compatibility_record: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_multirecord_base_compatibility_record: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
@@ -716,18 +716,18 @@
 
   if (ret > 0)
     printf ("  FRU Base Compatibility Manufacturer ID: %s (%Xh)\n",
-	    iana_buf,
-	    manufacturer_id);
+        iana_buf,
+        manufacturer_id);
   else
     printf ("  FRU Base Compatibility Manufacturer ID: %Xh\n",
-	    manufacturer_id);
+        manufacturer_id);
 
   printf ("  FRU Base Compatibility Entity ID: %Xh\n",
-	  entity_id_code);
+      entity_id_code);
   printf ("  FRU Base Compatibility Comptability Base: %Xh\n",
-	  compatibility_base);
+      compatibility_base);
   printf ("  FRU Base Compatibility Comptability Code Start Value: %Xh\n",
-	  compatibility_code_start_value);
+      compatibility_code_start_value);
 
   if (code_range_mask_len)
     {
@@ -741,7 +741,7 @@
             printf ("\n    ");
           
           printf (" %02Xh",
-		  code_range_mask[i]);
+          code_range_mask[i]);
         }
       printf ("\n");
     }
@@ -778,8 +778,8 @@
                                                                 &code_range_mask_len) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_multirecord_extended_compatibility_record: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_multirecord_extended_compatibility_record: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
 
@@ -794,18 +794,18 @@
 
   if (ret > 0)
     printf ("  FRU Extended Compatibility Manufacturer ID: %s (%Xh)\n",
-	    iana_buf,
-	    manufacturer_id);
+        iana_buf,
+        manufacturer_id);
   else
     printf ("  FRU Extended Compatibility Manufacturer ID: %Xh\n",
-	    manufacturer_id);
+        manufacturer_id);
 
   printf ("  FRU Extended Compatibility Entity ID: %Xh\n",
-	  entity_id_code);
+      entity_id_code);
   printf ("  FRU Extended Compatibility Comptability Base: %Xh\n",
-	  compatibility_base);
+      compatibility_base);
   printf ("  FRU Extended Compatibility Comptability Code Start Value: %Xh\n",
-	  compatibility_code_start_value);
+      compatibility_code_start_value);
 
   if (code_range_mask_len)
     {
@@ -819,7 +819,7 @@
             printf ("\n    ");
           
           printf (" %02Xh",
-		  code_range_mask[i]);
+          code_range_mask[i]);
         }
       printf ("\n");
     }
@@ -850,8 +850,8 @@
                                              &oem_data_len) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_multirecord_oem_record: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_multirecord_oem_record: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       return (-1);
     }
   
@@ -866,11 +866,11 @@
   
   if (ret > 0)
     printf ("  FRU OEM Manufacturer ID: %s (%Xh)\n",
-	    iana_buf,
-	    manufacturer_id);
+        iana_buf,
+        manufacturer_id);
   else
     printf ("  FRU OEM Manufacturer ID: %Xh\n",
-	    manufacturer_id);
+        manufacturer_id);
 
   if (oem_data_len)
     {
@@ -884,7 +884,7 @@
             printf ("\n    ");
 
           printf (" %02Xh",
-		  oem_data[i]);
+          oem_data[i]);
         }
       printf ("\n");
     }
@@ -905,25 +905,25 @@
     }
 
   if ((ret = ipmi_ctx_find_inband (ipmi_ctx,
-				   NULL,
-				   0, /* don't disable auto-probe */
-				   0,
-				   0,
-				   NULL,
-				   0, /* workaround flags, none by default */
-				   0  /* flags */
-				   )) < 0)
+                   NULL,
+                   0, /* don't disable auto-probe */
+                   0,
+                   0,
+                   NULL,
+                   0, /* workaround flags, none by default */
+                   0  /* flags */
+                   )) < 0)
     {
       fprintf (stderr,
-	       "ipmi_ctx_find_inband: %s",
-	       ipmi_ctx_errormsg (ipmi_ctx));
+           "ipmi_ctx_find_inband: %s",
+           ipmi_ctx_errormsg (ipmi_ctx));
       goto cleanup;
     }
 
   if (!ret)
     {
       fprintf (stderr,
-	       "could not find inband device");
+           "could not find inband device");
       goto cleanup;
     }
 
@@ -938,8 +938,8 @@
   if (ipmi_fru_parse_ctx_set_flags (fru_parse_ctx, IPMI_FRU_PARSE_FLAGS_SKIP_CHECKSUM_CHECKS) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_ctx_set_flags: %s\n",
-	       ipmi_fru_parse_ctx_strerror (ipmi_fru_parse_ctx_errnum (fru_parse_ctx)));
+           "ipmi_fru_parse_ctx_set_flags: %s\n",
+           ipmi_fru_parse_ctx_strerror (ipmi_fru_parse_ctx_errnum (fru_parse_ctx)));
       goto cleanup;
     }
 
@@ -947,8 +947,8 @@
   if (ipmi_fru_parse_open_device_id (fru_parse_ctx, 0) < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_open_device_id: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_open_device_id: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       goto cleanup;
     }
 
@@ -966,8 +966,8 @@
                                          IPMI_FRU_PARSE_AREA_SIZE_MAX) < 0)
         {
           fprintf (stderr,
-		   "ipmi_fru_parse_open_device_id: %s\n",
-		   ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_open_device_id: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
           goto cleanup;
         }
 
@@ -1027,8 +1027,8 @@
               break;
             default:
               fprintf (stderr,
-		       "  FRU Error: Unknown FRU Area Type Read: %02Xh\n",
-		       area_type);
+               "  FRU Error: Unknown FRU Area Type Read: %02Xh\n",
+               area_type);
               goto next;
               break;
             }
@@ -1042,8 +1042,8 @@
   if (ret < 0)
     {
       fprintf (stderr,
-	       "ipmi_fru_parse_next: %s\n",
-	       ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
+           "ipmi_fru_parse_next: %s\n",
+           ipmi_fru_parse_ctx_errormsg (fru_parse_ctx));
       goto cleanup;
     }
 
