ID: 28 - 'lib/ipmi_delloem.c' - clean up the code

Don't ``printf (...)'' -> ``printf(...)''.
This commit is contained in:
Zdenek Styblik 2013-07-07 11:26:45 +00:00
parent 38f89a449d
commit e95a4cf998

View File

@ -1554,25 +1554,25 @@ ipmi_macinfo_drac_idrac_virtual_mac(struct ipmi_intf* intf,uint8_t NicNum)
return -1; return -1;
} }
if (IMC_IDRAC_10G == IMC_Type) { if (IMC_IDRAC_10G == IMC_Type) {
printf ("\nDRAC MAC Address "); printf("\nDRAC MAC Address ");
} else if ((IMC_IDRAC_11G_MODULAR == IMC_Type) } else if ((IMC_IDRAC_11G_MODULAR == IMC_Type)
|| (IMC_IDRAC_11G_MONOLITHIC== IMC_Type)) { || (IMC_IDRAC_11G_MONOLITHIC== IMC_Type)) {
printf ("\niDRAC6 MAC Address "); printf("\niDRAC6 MAC Address ");
} else if ((IMC_IDRAC_12G_MODULAR == IMC_Type) } else if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) { || (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) {
printf ("\niDRAC7 MAC Address "); printf("\niDRAC7 MAC Address ");
} else if ((IMC_MASER_LITE_BMC== IMC_Type) } else if ((IMC_MASER_LITE_BMC== IMC_Type)
|| (IMC_MASER_LITE_NU== IMC_Type)) { || (IMC_MASER_LITE_NU== IMC_Type)) {
printf ("\nBMC MAC Address "); printf("\nBMC MAC Address ");
} else { } else {
printf ("\niDRAC6 MAC Address "); printf("\niDRAC6 MAC Address ");
} }
for (j = 0; j < 5; j++) { for (j = 0; j < 5; j++) {
printf("%02x:", VirtualMacAddress[j]); printf("%02x:", VirtualMacAddress[j]);
} }
printf("%02x", VirtualMacAddress[j]); printf("%02x", VirtualMacAddress[j]);
printf ("\n"); printf("\n");
} }
return 0; return 0;
} }
@ -1621,25 +1621,25 @@ ipmi_macinfo_drac_idrac_mac(struct ipmi_intf* intf,uint8_t NicNum)
MACADDRESSLENGH); MACADDRESSLENGH);
if (IMC_IDRAC_10G == IMC_Type) { if (IMC_IDRAC_10G == IMC_Type) {
printf ("\nDRAC MAC Address "); printf("\nDRAC MAC Address ");
} else if ((IMC_IDRAC_11G_MODULAR == IMC_Type) } else if ((IMC_IDRAC_11G_MODULAR == IMC_Type)
|| (IMC_IDRAC_11G_MONOLITHIC== IMC_Type)) { || (IMC_IDRAC_11G_MONOLITHIC== IMC_Type)) {
printf ("\niDRAC6 MAC Address "); printf("\niDRAC6 MAC Address ");
} else if ((IMC_IDRAC_12G_MODULAR == IMC_Type) } else if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) { || (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) {
printf ("\niDRAC7 MAC Address "); printf("\niDRAC7 MAC Address ");
} else if ((IMC_MASER_LITE_BMC== IMC_Type) } else if ((IMC_MASER_LITE_BMC== IMC_Type)
|| (IMC_MASER_LITE_NU== IMC_Type)) { || (IMC_MASER_LITE_NU== IMC_Type)) {
printf ("\n\rBMC MAC Address "); printf("\n\rBMC MAC Address ");
} else { } else {
printf ("\niDRAC6 MAC Address "); printf("\niDRAC6 MAC Address ");
} }
for (j = 0; j < 5; j++) { for (j = 0; j < 5; j++) {
printf("%02x:", iDRAC6MacAddressByte[j]); printf("%02x:", iDRAC6MacAddressByte[j]);
} }
printf("%02x", iDRAC6MacAddressByte[j]); printf("%02x", iDRAC6MacAddressByte[j]);
printf ("\n"); printf("\n");
} }
return 0; return 0;
} }
@ -1688,7 +1688,7 @@ ipmi_macinfo_10g(struct ipmi_intf* intf, uint8_t NicNum)
Total_No_NICs = (uint8_t)rsp->data[0 + PARAM_REV_OFFSET]; /* Byte 1: Total Number of Embedded NICs */ Total_No_NICs = (uint8_t)rsp->data[0 + PARAM_REV_OFFSET]; /* Byte 1: Total Number of Embedded NICs */
if (IDRAC_NIC_NUMBER != NicNum) { if (IDRAC_NIC_NUMBER != NicNum) {
if (0xff == NicNum) { if (0xff == NicNum) {
printf ("\nSystem LOMs"); printf("\nSystem LOMs");
} }
printf("\nNIC Number\tMAC Address\n"); printf("\nNIC Number\tMAC Address\n");
memcpy(&EmbeddedNICMacAddress_10G, memcpy(&EmbeddedNICMacAddress_10G,
@ -1707,7 +1707,7 @@ ipmi_macinfo_10g(struct ipmi_intf* intf, uint8_t NicNum)
EmbeddedNICMacAddress_10G.MacAddress[i].MacAddressByte[j]); EmbeddedNICMacAddress_10G.MacAddress[i].MacAddressByte[j]);
} }
} }
printf ("\n"); printf("\n");
} }
ipmi_macinfo_drac_idrac_mac(intf,NicNum); ipmi_macinfo_drac_idrac_mac(intf,NicNum);
return 0; return 0;
@ -1769,7 +1769,7 @@ ipmi_macinfo_11g(struct ipmi_intf* intf, uint8_t NicNum)
loop_count = maxlen / len; loop_count = maxlen / len;
if (IDRAC_NIC_NUMBER != NicNum) { if (IDRAC_NIC_NUMBER != NicNum) {
if (0xff == NicNum) { if (0xff == NicNum) {
printf ("\nSystem LOMs"); printf("\nSystem LOMs");
} }
printf("\nNIC Number\tMAC Address\t\tStatus\n"); printf("\nNIC Number\tMAC Address\t\tStatus\n");
/*Read the LOM type and Mac Addresses */ /*Read the LOM type and Mac Addresses */
@ -1800,8 +1800,8 @@ ipmi_macinfo_11g(struct ipmi_intf* intf, uint8_t NicNum)
if (LOM_MACTYPE_ETHERNET == EmbeddedNICMacAddress.LOMMacAddress[i].MacType) { if (LOM_MACTYPE_ETHERNET == EmbeddedNICMacAddress.LOMMacAddress[i].MacType) {
if ((0xff==NicNum) if ((0xff==NicNum)
|| (NicNum == EmbeddedNICMacAddress.LOMMacAddress[i].NICNumber)) { || (NicNum == EmbeddedNICMacAddress.LOMMacAddress[i].NICNumber)) {
printf ("\n%d",EmbeddedNICMacAddress.LOMMacAddress[i].NICNumber); printf("\n%d",EmbeddedNICMacAddress.LOMMacAddress[i].NICNumber);
printf ("\t\t"); printf("\t\t");
for (j = 0; j < 5; j++) { for (j = 0; j < 5; j++) {
printf("%02x:", printf("%02x:",
EmbeddedNICMacAddress.LOMMacAddress[i].MacAddressByte[j]); EmbeddedNICMacAddress.LOMMacAddress[i].MacAddressByte[j]);
@ -1811,14 +1811,14 @@ ipmi_macinfo_11g(struct ipmi_intf* intf, uint8_t NicNum)
if (LOM_ETHERNET_ENABLED if (LOM_ETHERNET_ENABLED
== EmbeddedNICMacAddress.LOMMacAddress[i].EthernetStatus) { == EmbeddedNICMacAddress.LOMMacAddress[i].EthernetStatus) {
printf ("\tEnabled"); printf("\tEnabled");
} else { } else {
printf ("\tDisabled"); printf("\tDisabled");
} }
} }
} }
} }
printf ("\n"); printf("\n");
} }
ipmi_macinfo_drac_idrac_mac(intf,NicNum); ipmi_macinfo_drac_idrac_mac(intf,NicNum);
return 0; return 0;
@ -2274,14 +2274,14 @@ ipmi_lan_get_nic_selection(struct ipmi_intf * intf)
if ((nic_selection < 6) && (nic_selection > 0) if ((nic_selection < 6) && (nic_selection > 0)
&& (nic_selection_failover < 7)) { && (nic_selection_failover < 7)) {
if(nic_selection == 1) { if(nic_selection == 1) {
printf ("%s\n",NIC_Selection_Mode_String_12g[nic_selection-1]); printf("%s\n",NIC_Selection_Mode_String_12g[nic_selection-1]);
} else if(nic_selection) { } else if(nic_selection) {
printf ("Shared LOM : %s\n", printf("Shared LOM : %s\n",
NIC_Selection_Mode_String_12g[nic_selection-1]); NIC_Selection_Mode_String_12g[nic_selection-1]);
if(nic_selection_failover == 0) { if(nic_selection_failover == 0) {
printf ("Failover LOM : None\n"); printf("Failover LOM : None\n");
} else if(nic_selection_failover >= 2 && nic_selection_failover <= 6) { } else if(nic_selection_failover >= 2 && nic_selection_failover <= 6) {
printf ("Failover LOM : %s\n", printf("Failover LOM : %s\n",
NIC_Selection_Mode_String_12g[nic_selection_failover + 3]); NIC_Selection_Mode_String_12g[nic_selection_failover + 3]);
} }
} }
@ -2291,7 +2291,7 @@ ipmi_lan_get_nic_selection(struct ipmi_intf * intf)
return -1; return -1;
} }
} else { } else {
printf ("%s\n",NIC_Selection_Mode_String[nic_selection]); printf("%s\n",NIC_Selection_Mode_String[nic_selection]);
} }
return 0; return 0;
} }
@ -2947,8 +2947,8 @@ ipmi_get_power_headroom_command(struct ipmi_intf * intf,uint8_t unit)
powerheadroom.instheadroom = BSWAP_16(powerheadroom.instheadroom); powerheadroom.instheadroom = BSWAP_16(powerheadroom.instheadroom);
powerheadroom.peakheadroom = BSWAP_16(powerheadroom.peakheadroom); powerheadroom.peakheadroom = BSWAP_16(powerheadroom.peakheadroom);
# endif # endif
printf ("Headroom\n"); printf("Headroom\n");
printf ("Statistic Reading\n"); printf("Statistic Reading\n");
if (unit == btuphr) { if (unit == btuphr) {
peakpowerheadroombtuphr = watt_to_btuphr_conversion(powerheadroom.peakheadroom); peakpowerheadroombtuphr = watt_to_btuphr_conversion(powerheadroom.peakheadroom);
instantpowerhearoom = watt_to_btuphr_conversion(powerheadroom.instheadroom); instantpowerhearoom = watt_to_btuphr_conversion(powerheadroom.instheadroom);
@ -3007,19 +3007,19 @@ ipmi_get_power_consumption_data(struct ipmi_intf * intf,uint8_t unit)
failure_threshbtuphr = sdr_convert_sensor_reading(sdr->record.full, failure_threshbtuphr = sdr_convert_sensor_reading(sdr->record.full,
rsp->data[5]); rsp->data[5]);
printf ("System Board System Level\n"); printf("System Board System Level\n");
if (unit == btuphr) { if (unit == btuphr) {
readingbtuphr = watt_to_btuphr_conversion(readingbtuphr); readingbtuphr = watt_to_btuphr_conversion(readingbtuphr);
warning_threshbtuphr = watt_to_btuphr_conversion(warning_threshbtuphr); warning_threshbtuphr = watt_to_btuphr_conversion(warning_threshbtuphr);
failure_threshbtuphr = watt_to_btuphr_conversion( failure_threshbtuphr); failure_threshbtuphr = watt_to_btuphr_conversion( failure_threshbtuphr);
printf ("Reading : %d BTU/hr\n", readingbtuphr); printf("Reading : %d BTU/hr\n", readingbtuphr);
printf ("Warning threshold : %d BTU/hr\n", warning_threshbtuphr); printf("Warning threshold : %d BTU/hr\n", warning_threshbtuphr);
printf ("Failure threshold : %d BTU/hr\n", failure_threshbtuphr); printf("Failure threshold : %d BTU/hr\n", failure_threshbtuphr);
} else { } else {
printf ("Reading : %d W \n",readingbtuphr); printf("Reading : %d W \n",readingbtuphr);
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 { } else {
lprintf(LOG_ERR, lprintf(LOG_ERR,
@ -3115,7 +3115,7 @@ ipmi_print_get_power_consmpt_data(struct ipmi_intf * intf, uint8_t unit)
{ {
int rc = 0; int rc = 0;
IPMI_INST_POWER_CONSUMPTION_DATA instpowerconsumptiondata = {0,0,0,0}; IPMI_INST_POWER_CONSUMPTION_DATA instpowerconsumptiondata = {0,0,0,0};
printf ("\nPower consumption information\n"); printf("\nPower consumption information\n");
rc = ipmi_get_power_consumption_data(intf, unit); rc = ipmi_get_power_consumption_data(intf, unit);
if (rc == (-1)) { if (rc == (-1)) {
return rc; return rc;
@ -3334,71 +3334,71 @@ ipmi_print_power_consmpt_history(struct ipmi_intf * intf, int unit)
return rc; return rc;
} }
if (rc == 0) { if (rc == 0) {
printf ("Power Consumption History\n\n"); printf("Power Consumption History\n\n");
/* The fields are alligned manually changing the spaces will alter /* The fields are alligned manually changing the spaces will alter
* the alignment*/ * the alignment*/
printf ("Statistic Last Minute Last Hour " printf("Statistic Last Minute Last Hour "
"Last Day Last Week\n\n"); "Last Day Last Week\n\n");
if (unit == btuphr) { if (unit == btuphr) {
printf ("Average Power Consumption "); printf("Average Power Consumption ");
tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastminutepower); tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastminutepower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lasthourpower); tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lasthourpower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastdaypower); tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastdaypower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastweakpower); tempbtuphrconv = watt_to_btuphr_conversion(avgpower.lastweakpower);
printf ("%4lld BTU/hr\n", tempbtuphrconv); printf("%4lld BTU/hr\n", tempbtuphrconv);
printf ("Max Power Consumption "); printf("Max Power Consumption ");
tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastminutepower); tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastminutepower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lasthourpower); tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lasthourpower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastdaypower); tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastdaypower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastweakpower); tempbtuphrconv = watt_to_btuphr_conversion(stPeakpower.lastweakpower);
printf ("%4lld BTU/hr\n", tempbtuphrconv); printf("%4lld BTU/hr\n", tempbtuphrconv);
printf ("Min Power Consumption "); printf("Min Power Consumption ");
tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastminutepower); tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastminutepower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lasthourpower); tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lasthourpower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastdaypower); tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastdaypower);
printf ("%4lld BTU/hr ", tempbtuphrconv); printf("%4lld BTU/hr ", tempbtuphrconv);
tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastweakpower); tempbtuphrconv = watt_to_btuphr_conversion(stMinpower.lastweakpower);
printf ("%4lld BTU/hr\n\n", tempbtuphrconv); printf("%4lld BTU/hr\n\n", tempbtuphrconv);
} else { } else {
printf ("Average Power Consumption "); printf("Average Power Consumption ");
tempbtuphrconv = (avgpower.lastminutepower); tempbtuphrconv = (avgpower.lastminutepower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv = (avgpower.lasthourpower); tempbtuphrconv = (avgpower.lasthourpower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv = (avgpower.lastdaypower); tempbtuphrconv = (avgpower.lastdaypower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv=(avgpower.lastweakpower); tempbtuphrconv=(avgpower.lastweakpower);
printf ("%4lld W \n", tempbtuphrconv); printf("%4lld W \n", tempbtuphrconv);
printf ("Max Power Consumption "); printf("Max Power Consumption ");
tempbtuphrconv = (stPeakpower.lastminutepower); tempbtuphrconv = (stPeakpower.lastminutepower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv = (stPeakpower.lasthourpower); tempbtuphrconv = (stPeakpower.lasthourpower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv = (stPeakpower.lastdaypower); tempbtuphrconv = (stPeakpower.lastdaypower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv = (stPeakpower.lastweakpower); tempbtuphrconv = (stPeakpower.lastweakpower);
printf ("%4lld W \n", tempbtuphrconv); printf("%4lld W \n", tempbtuphrconv);
printf ("Min Power Consumption "); printf("Min Power Consumption ");
tempbtuphrconv = (stMinpower.lastminutepower); tempbtuphrconv = (stMinpower.lastminutepower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv = (stMinpower.lasthourpower); tempbtuphrconv = (stMinpower.lasthourpower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv = (stMinpower.lastdaypower); tempbtuphrconv = (stMinpower.lastdaypower);
printf ("%4lld W ", tempbtuphrconv); printf("%4lld W ", tempbtuphrconv);
tempbtuphrconv = (stMinpower.lastweakpower); tempbtuphrconv = (stMinpower.lastweakpower);
printf ("%4lld W \n\n", tempbtuphrconv); printf("%4lld W \n\n", tempbtuphrconv);
} }
lastminutepeakpower = stPeakpower.lastminutepowertime; lastminutepeakpower = stPeakpower.lastminutepowertime;
@ -3406,30 +3406,30 @@ ipmi_print_power_consmpt_history(struct ipmi_intf * intf, int unit)
lastdaypeakpower = stPeakpower.lastdaypowertime; lastdaypeakpower = stPeakpower.lastdaypowertime;
lastweekpeakpower = stPeakpower.lastweekpowertime; lastweekpeakpower = stPeakpower.lastweekpowertime;
printf ("Max Power Time\n"); printf("Max Power Time\n");
ipmi_time_to_str(lastminutepeakpower, timestr); ipmi_time_to_str(lastminutepeakpower, timestr);
printf ("Last Minute : %s",timestr); printf("Last Minute : %s",timestr);
ipmi_time_to_str(lasthourpeakpower, timestr); ipmi_time_to_str(lasthourpeakpower, timestr);
printf ("Last Hour : %s",timestr); printf("Last Hour : %s",timestr);
ipmi_time_to_str(lastdaypeakpower, timestr); ipmi_time_to_str(lastdaypeakpower, timestr);
printf ("Last Day : %s",timestr); printf("Last Day : %s",timestr);
ipmi_time_to_str(lastweekpeakpower, timestr); ipmi_time_to_str(lastweekpeakpower, timestr);
printf ("Last Week : %s",timestr); printf("Last Week : %s",timestr);
lastminutepeakpower=stMinpower.lastminutepowertime; lastminutepeakpower=stMinpower.lastminutepowertime;
lasthourpeakpower=stMinpower.lasthourpowertime; lasthourpeakpower=stMinpower.lasthourpowertime;
lastdaypeakpower=stMinpower.lastdaypowertime; lastdaypeakpower=stMinpower.lastdaypowertime;
lastweekpeakpower=stMinpower.lastweekpowertime; lastweekpeakpower=stMinpower.lastweekpowertime;
printf ("Min Power Time\n"); printf("Min Power Time\n");
ipmi_time_to_str(lastminutepeakpower, timestr); ipmi_time_to_str(lastminutepeakpower, timestr);
printf ("Last Minute : %s", timestr); printf("Last Minute : %s", timestr);
ipmi_time_to_str(lasthourpeakpower, timestr); ipmi_time_to_str(lasthourpeakpower, timestr);
printf ("Last Hour : %s", timestr); printf("Last Hour : %s", timestr);
ipmi_time_to_str(lastdaypeakpower, timestr); ipmi_time_to_str(lastdaypeakpower, timestr);
printf ("Last Day : %s", timestr); printf("Last Day : %s", timestr);
ipmi_time_to_str(lastweekpeakpower, timestr); ipmi_time_to_str(lastweekpeakpower, timestr);
printf ("Last Week : %s", timestr); printf("Last Week : %s", timestr);
} }
return rc; return rc;
} }