Replace whitespaces with tabs, remove trailing spaces/tabs and other formatting inconsistencies.

This commit is contained in:
Zdenek Styblik 2012-01-21 07:19:52 +00:00
parent 55ee48696a
commit 835fe8886c

View File

@ -204,6 +204,7 @@ ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv)
cmd = intf->cmdlist;
if (strncmp(cmd->name, "default", 7) == 0)
return cmd->func(intf, argc+1, argv-1);
lprintf(LOG_ERR, "Invalid command: %s", name);
ipmi_cmd_print(intf->cmdlist);
return -1;
@ -270,13 +271,11 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
*/
void ipmi_catch_sigint()
{
if (ipmi_main_intf != NULL)
{
if (ipmi_main_intf != NULL) {
printf("\nSIGN INT: Close Interface %s\n",ipmi_main_intf->desc);
ipmi_main_intf->close(ipmi_main_intf);
}
exit(-1);
}
/* ipmi_parse_hex - convert hexadecimal numbers to ascii string
@ -480,8 +479,7 @@ ipmi_main(int argc, char ** argv,
}
break;
case 'K':
if ((tmp = getenv("IPMI_KGKEY")))
{
if ((tmp = getenv("IPMI_KGKEY"))) {
if (kgkey)
free(kgkey);
kgkey = strdup(tmp);
@ -489,8 +487,7 @@ ipmi_main(int argc, char ** argv,
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
}
else {
} else {
lprintf(LOG_WARN, "Unable to read kgkey from environment");
}
break;
@ -565,8 +562,7 @@ ipmi_main(int argc, char ** argv,
memset(optarg, 'X', i);
break;
case 'E':
if ((tmp = getenv("IPMITOOL_PASSWORD")))
{
if ((tmp = getenv("IPMITOOL_PASSWORD"))) {
if (password)
free(password);
password = strdup(tmp);
@ -575,8 +571,7 @@ ipmi_main(int argc, char ** argv,
goto out_free;
}
}
else if ((tmp = getenv("IPMI_PASSWORD")))
{
else if ((tmp = getenv("IPMI_PASSWORD"))) {
if (password)
free(password);
password = strdup(tmp);
@ -749,15 +744,15 @@ ipmi_main(int argc, char ** argv,
/* setup IPMB local and target address if given */
if (my_addr) {
ipmi_main_intf->my_addr = my_addr;
}
else {
/* Check if PICMG extension is available to use the function GetDeviceLocator
* to retreive i2c address PICMG hack to set right IPMB address,
* If extension is not supported, should not give any problems
} else {
/* Check if PICMG extension is available to use the function
* GetDeviceLocator to retreive i2c address PICMG hack to set
* right IPMB address, If extension is not supported, should
* not give any problems
* PICMG Extension Version 2.0 (PICMG 3.0 Revision 1.0 ATCA) to
* PICMG Extension Version 2.3 (PICMG 3.0 Revision 3.0 ATCA)
*/
/* First, check if PICMG extension is available and supported */
struct ipmi_rq req;
struct ipmi_rs *rsp;
@ -775,12 +770,8 @@ ipmi_main(int argc, char ** argv,
rsp = ipmi_main_intf->sendrecv(ipmi_main_intf, &req);
if (rsp && !rsp->ccode) {
if
(
(rsp->data[0] == 0)
&&
((rsp->data[1] & 0x0F ) == PICMG_ATCA_MAJOR_VERSION )
){
if ( (rsp->data[0] == 0) &&
((rsp->data[1] & 0x0F) == PICMG_ATCA_MAJOR_VERSION) ) {
version_accepted = 1;
lprintf(LOG_INFO, "Discovered PICMG Extension %d.%d",
(rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
@ -801,28 +792,26 @@ ipmi_main(int argc, char ** argv,
if (rsp && !rsp->ccode) {
ipmi_main_intf->my_addr = rsp->data[2];
ipmi_main_intf->target_addr = ipmi_main_intf->my_addr;
lprintf(LOG_INFO, "Discovered IPMB address = 0x%x", ipmi_main_intf->my_addr);
lprintf(LOG_INFO, "Discovered IPMB address = 0x%x",
ipmi_main_intf->my_addr);
}
}
else{
} else {
lprintf(LOG_INFO,
"No PICMG Extenstion discovered, keeping IPMB address 0x20");
}
}
if ( target_addr > 0 && (target_addr != my_addr) ) {
/* need to open the interface first */
if (ipmi_main_intf->open != NULL)
ipmi_main_intf->open(ipmi_main_intf);
ipmi_main_intf->target_addr = target_addr;
if (transit_addr > 0) {
ipmi_main_intf->transit_addr = transit_addr;
ipmi_main_intf->transit_channel = transit_channel;
}
else
{
} else {
ipmi_main_intf->transit_addr = ipmi_main_intf->my_addr;
}
/* must be admin level to do this over lan */
@ -841,8 +830,7 @@ ipmi_main(int argc, char ** argv,
/* Enable Big Buffer when requested */
ipmi_main_intf->channel_buf_size = 0;
if( my_long_packet_size != 0 )
{
if ( my_long_packet_size != 0 ) {
printf("Setting large buffer to %i\n", my_long_packet_size);
if (ipmi_kontronoem_set_large_buffer( ipmi_main_intf, my_long_packet_size ) == 0)
{
@ -860,8 +848,7 @@ ipmi_main(int argc, char ** argv,
else
rc = ipmi_cmd_run(ipmi_main_intf, NULL, 0, NULL);
if(my_long_packet_set == 1)
{
if (my_long_packet_set == 1) {
/* Restore defaults */
ipmi_kontronoem_set_large_buffer( ipmi_main_intf, 0 );
}