cleanup all unused-parameter warnings

Cleanup all unused-parameter warnings.  Each warning was examined to
verify it wasn't simply a case of a build macro difference.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Patrick Venture <venture@google.com>
This commit is contained in:
Patrick Venture
2018-11-14 08:37:45 -08:00
committed by Alexander Amelkin
parent d6d9c85139
commit 8ea6094118
22 changed files with 170 additions and 173 deletions

View File

@@ -171,12 +171,10 @@ static int ipmi_lcd_get_status(struct ipmi_intf *intf);
static int ipmi_lcd_set_kvm(struct ipmi_intf *intf, char status);
static int ipmi_lcd_set_lock(struct ipmi_intf *intf, char lock);
static int ipmi_lcd_set_single_line_text(struct ipmi_intf *intf, char *text);
static int ipmi_lcd_set_text(struct ipmi_intf *intf, char *text,
int line_number);
static int ipmi_lcd_set_text(struct ipmi_intf *intf, char *text);
static int ipmi_lcd_configure_wh(struct ipmi_intf *intf, uint32_t mode,
uint16_t lcdquallifier, uint8_t errordisp, int8_t line_number, char *text);
static int ipmi_lcd_configure(struct ipmi_intf *intf, int command,
int8_t line_number, char *text);
uint16_t lcdquallifier, uint8_t errordisp, char *text);
static int ipmi_lcd_configure(struct ipmi_intf *intf, int command, char *text);
static void ipmi_lcd_usage(void);
/* MAC Function prototypes */
static int ipmi_delloem_mac_main(struct ipmi_intf *intf, int argc, char **argv);
@@ -417,10 +415,10 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
}
if (strncmp(argv[current_arg], "none\0", 5) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_NONE, 0xFF,
0XFF, 0, NULL);
0XFF, NULL);
} else if (strncmp(argv[current_arg], "modelname\0", 10) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0xFF,
0XFF, 0, NULL);
0XFF, NULL);
} else if (strncmp(argv[current_arg], "userdefined\0", 12) == 0) {
current_arg++;
if (argc <= current_arg) {
@@ -428,31 +426,31 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED,
0xFF, 0XFF, line_number, argv[current_arg]);
0xFF, 0XFF, argv[current_arg]);
} else if (strncmp(argv[current_arg], "ipv4address\0", 12) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV4ADRESS,
0xFF, 0XFF, 0, NULL);
0xFF, 0XFF, NULL);
} else if (strncmp(argv[current_arg], "macaddress\0", 11) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_IDRAC_MAC_ADDRESS,
0xFF, 0XFF, 0, NULL);
0xFF, 0XFF, NULL);
} else if (strncmp(argv[current_arg], "systemname\0", 11) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_OS_SYSTEM_NAME, 0xFF,
0XFF, 0, NULL);
0XFF, NULL);
} else if (strncmp(argv[current_arg], "servicetag\0", 11) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SERVICE_TAG, 0xFF,
0XFF, 0, NULL);
0XFF, NULL);
} else if (strncmp(argv[current_arg], "ipv6address\0", 12) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV6ADRESS,
0xFF, 0XFF, 0, NULL);
0xFF, 0XFF, NULL);
} else if (strncmp(argv[current_arg], "ambienttemp\0", 12) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_AMBEINT_TEMP, 0xFF,
0XFF, 0, NULL);
0XFF, NULL);
} else if (strncmp(argv[current_arg], "systemwatt\0", 11) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SYSTEM_WATTS, 0xFF,
0XFF, 0, NULL);
0XFF, NULL);
} else if (strncmp(argv[current_arg], "assettag\0", 9) == 0) {
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_ASSET_TAG, 0xFF,
0XFF, 0, NULL);
0XFF, NULL);
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
ipmi_lcd_usage();
} else {
@@ -472,13 +470,13 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
if (strncmp(argv[current_arg], "watt\0", 5) == 0) {
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x00, 0XFF, 0, NULL);
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x00, 0XFF, NULL);
} else if (strncmp(argv[current_arg], "btuphr\0",7) == 0) {
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x01, 0XFF, 0, NULL);
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x01, 0XFF, NULL);
} else if (strncmp(argv[current_arg], "celsius\0", 8) == 0) {
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x02, 0xFF, 0, NULL);
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x02, 0xFF, NULL);
} else if (strncmp(argv[current_arg], "fahrenheit", 11) == 0) {
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x03, 0xFF, 0, NULL);
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x03, 0xFF, NULL);
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
ipmi_lcd_usage();
} else {
@@ -499,10 +497,10 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
}
if (strncmp(argv[current_arg], "sel\0", 4) == 0) {
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF,
IPMI_DELL_LCD_ERROR_DISP_SEL, 0, NULL);
IPMI_DELL_LCD_ERROR_DISP_SEL, NULL);
} else if (strncmp(argv[current_arg], "simple\0", 7) == 0) {
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF,
IPMI_DELL_LCD_ERROR_DISP_VERBOSE, 0, NULL);
IPMI_DELL_LCD_ERROR_DISP_VERBOSE, NULL);
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
ipmi_lcd_usage();
} else {
@@ -512,10 +510,10 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
}
} else if ((strncmp(argv[current_arg], "none\0", 5) == 0)
&& (iDRAC_FLAG==0)) {
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_NONE, 0, NULL);
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_NONE, NULL);
} else if ((strncmp(argv[current_arg], "default\0", 8) == 0)
&& (iDRAC_FLAG==0)) {
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0, NULL);
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, NULL);
} else if ((strncmp(argv[current_arg], "custom\0", 7) == 0)
&& (iDRAC_FLAG==0)) {
current_arg++;
@@ -524,7 +522,7 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED,
line_number, argv[current_arg]);
argv[current_arg]);
} else if (strncmp(argv[current_arg], "vkvm\0", 5) == 0) {
current_arg++;
if (argc <= current_arg) {
@@ -1332,13 +1330,12 @@ ipmi_lcd_set_single_line_text(struct ipmi_intf * intf, char * text)
* Description: This function sets lcd line text
* Input: intf - ipmi interface
* text - lcd string
* line_number- line number
* Output:
* Return: -1 on error
* 0 if successful
*/
static int
ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
ipmi_lcd_set_text(struct ipmi_intf * intf, char * text)
{
int rc = 0;
IPMI_DELL_LCD_CAPS lcd_caps;
@@ -1367,7 +1364,6 @@ ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
* Input: intf - ipmi interface
* lcdquallifier- lcd quallifier
* errordisp - error number
* line_number-line number
* text - lcd string
* Output:
* Return: -1 on error
@@ -1375,12 +1371,12 @@ ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
*/
static int
ipmi_lcd_configure_wh(struct ipmi_intf * intf, uint32_t mode,
uint16_t lcdquallifier, uint8_t errordisp, int8_t line_number, char * text)
uint16_t lcdquallifier, uint8_t errordisp, char * text)
{
int rc = 0;
if (IPMI_DELL_LCD_CONFIG_USER_DEFINED == mode) {
/* Any error was reported earlier. */
rc = ipmi_lcd_set_text(intf, text, line_number);
rc = ipmi_lcd_set_text(intf, text);
}
if (rc == 0) {
rc = ipmi_lcd_set_configure_command_wh(intf, mode ,lcdquallifier,errordisp);
@@ -1393,19 +1389,17 @@ ipmi_lcd_configure_wh(struct ipmi_intf * intf, uint32_t mode,
* Description: This function updates the current lcd configuration
* Input: intf - ipmi interface
* command- lcd command
* line_number-line number
* text - lcd string
* Output:
* Return: -1 on error
* 0 if successful
*/
static int
ipmi_lcd_configure(struct ipmi_intf * intf, int command,
int8_t line_number, char * text)
ipmi_lcd_configure(struct ipmi_intf * intf, int command, char * text)
{
int rc = 0;
if (IPMI_DELL_LCD_CONFIG_USER_DEFINED == command) {
rc = ipmi_lcd_set_text(intf, text, line_number);
rc = ipmi_lcd_set_text(intf, text);
}
if (rc == 0) {
rc = ipmi_lcd_set_configure_command(intf, command);
@@ -1948,7 +1942,7 @@ ipmi_mac_usage(void)
*
* Description: This function processes the delloem lan command
* Input: intf - ipmi interface
* argc - no of arguments
* argc - no of arguments (unused, left in for calling consistency)
* argv - argument string array
* Output:
*
@@ -1956,7 +1950,7 @@ ipmi_mac_usage(void)
* -1 - failure
*/
static int
ipmi_delloem_lan_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_delloem_lan_main(struct ipmi_intf * intf, int __UNUSED__(argc), char ** argv)
{
int rc = 0;
int nic_selection = 0;
@@ -3741,7 +3735,7 @@ ipmi_powermonitor_usage(void)
*
* Description: This function processes the delloem vFlash command
* Input: intf - ipmi interface
* argc - no of arguments
* argc - no of arguments (unused)
* argv - argument string array
* Output:
*
@@ -3749,7 +3743,7 @@ ipmi_powermonitor_usage(void)
* -1 - failure
*/
static int
ipmi_delloem_vFlash_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_delloem_vFlash_main(struct ipmi_intf * intf, int __UNUSED__(argc), char ** argv)
{
int rc = 0;
current_arg++;

View File

@@ -218,8 +218,7 @@ static void ipmi_ek_add_record2list( struct ipmi_ek_multi_header ** record,
struct ipmi_ek_multi_header ** list_last );
static void ipmi_ek_display_record( struct ipmi_ek_multi_header * record,
struct ipmi_ek_multi_header * list_head,
struct ipmi_ek_multi_header * list_last );
struct ipmi_ek_multi_header * list_head);
static void ipmi_ek_remove_record_from_list(
struct ipmi_ek_multi_header * record,
@@ -236,7 +235,7 @@ static int ipmi_ekanalyzer_fru_file2structure( char * filename,
*****************************************************************************/
static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
struct ipmi_ek_multi_header ** list_head,
struct ipmi_ek_multi_header ** list_last, char * opt,
char * opt,
struct ipmi_ek_multi_header * pphysical );
static int ipmi_ek_get_resource_descriptor( int port_count, int index,
@@ -456,7 +455,7 @@ ipmi_ek_get_file_type(char *argument)
*
***************************************************************************/
int
ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
ipmi_ekanalyzer_main(struct ipmi_intf *__UNUSED__(intf), int argc, char **argv)
{
int rc = ERROR_STATUS;
int file_type[MAX_FILE_NUMBER];
@@ -513,7 +512,7 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
/* Convert from binary data into multi record structure */
rc = ipmi_ekanalyzer_fru_file2structure (filename[type_offset],
&list_head, &list_record, &list_last );
ipmi_ek_display_record(list_record, list_head, list_last);
ipmi_ek_display_record(list_record, list_head);
/* Remove record of list */
while (list_head) {
ipmi_ek_remove_record_from_list(list_head,
@@ -1188,7 +1187,7 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
}
return_value = ipmi_ek_matching_process( file_type,
match_pair, num_file, list_head,
list_last, opt, pcarrier_p2p);
opt, pcarrier_p2p);
}
}
}
@@ -1224,8 +1223,6 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
* index2: position of the second record in the list of the record
* ipmi_ek_multi_header ** list_head: pointer to the header of a
* linked list that contain FRU multi record
* ipmi_ek_multi_header ** list_last: pointer to the tale of a
* linked list that contain FRU multi record
* opt: string that contain display option such as "match", "unmatch", or
* "all".
* pphysical: a pointer that contain a carrier p2p connectivity record
@@ -1241,7 +1238,7 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
***************************************************************************/
static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
struct ipmi_ek_multi_header ** list_head,
struct ipmi_ek_multi_header ** list_last, char * opt,
char * opt,
struct ipmi_ek_multi_header * pphysical )
{
int result = ERROR_STATUS;
@@ -2951,7 +2948,6 @@ ipmi_ek_display_product_info_area(FILE *input_file, long offset)
*
* Input: record: a pointer to current record
* list_head: a pointer to header of the list
* list_last: a pointer to tale of the list
*
* Output: None
*
@@ -2962,8 +2958,7 @@ ipmi_ek_display_product_info_area(FILE *input_file, long offset)
***************************************************************************/
static void
ipmi_ek_display_record(struct ipmi_ek_multi_header *record,
struct ipmi_ek_multi_header *list_head,
struct ipmi_ek_multi_header *list_last)
struct ipmi_ek_multi_header *list_head)
{
if (!list_head) {
printf("***empty list***\n");

View File

@@ -1573,10 +1573,11 @@ typedef struct OemKontronInformationRecordV1{
*/
static void ipmi_fru_oemkontron_get( int argc, char ** argv,uint8_t * fru_data,
int off,int len,
struct fru_multirec_header *h,
struct fru_multirec_oem_header *oh)
static void ipmi_fru_oemkontron_get(int argc,
char ** argv,
uint8_t * fru_data,
int off,
struct fru_multirec_oem_header *oh)
{
static int badParams=FALSE;
int start = off;
@@ -3703,15 +3704,15 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
if( suppliedIana == iana ) {
lprintf(LOG_DEBUG, "Matching record found" );
if( iana == IPMI_OEM_KONTRON ) {
ipmi_fru_oemkontron_get( argc,argv,fru_data,
i + sizeof(struct fru_multirec_header),
h->len, h, oh );
if( iana == IPMI_OEM_KONTRON ) {
ipmi_fru_oemkontron_get(argc, argv, fru_data,
i + sizeof(struct fru_multirec_header),
oh);
}
/* FIXME: Add OEM record support here */
else{
printf(" OEM IANA (%s) Record not supported in this mode\n",
val2str( iana, ipmi_oem_info));
val2str( iana, ipmi_oem_info));
error = 1;
}
}

View File

@@ -71,7 +71,6 @@ typedef struct gendev_eeprom_info
static int
ipmi_gendev_get_eeprom_size(
struct ipmi_intf *intf,
struct sdr_record_generic_locator *dev,
t_gendev_eeprom_info *info
)
@@ -191,7 +190,7 @@ ipmi_gendev_read_file(
int eeprom_size;
t_gendev_eeprom_info eeprom_info;
eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
eeprom_size = ipmi_gendev_get_eeprom_size(dev, &eeprom_info);
if(eeprom_size > 0)
{
@@ -362,7 +361,7 @@ ipmi_gendev_write_file(
int eeprom_size;
t_gendev_eeprom_info eeprom_info;
eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
eeprom_size = ipmi_gendev_get_eeprom_size(dev, &eeprom_info);
if(eeprom_size > 0)
{

View File

@@ -113,7 +113,7 @@ int HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
int option,
int *pFlagColdReset);
int
HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf,
HpmfwupgPreUpgradeCheck(
struct HpmfwupgUpgradeCtx *pFwupgCtx,
int componentMask, int option);
@@ -503,10 +503,9 @@ HpmfwupgUpgrade(struct ipmi_intf *intf, char *imageFilename, int activate,
lprintf(LOG_NOTICE, "\nPerforming upgrade stage:");
}
if (option & VIEW_MODE) {
rc = HpmfwupgPreUpgradeCheck(intf,
&fwupgCtx,componentMask, VIEW_MODE);
rc = HpmfwupgPreUpgradeCheck(&fwupgCtx,componentMask, VIEW_MODE);
} else {
rc = HpmfwupgPreUpgradeCheck(intf, &fwupgCtx,
rc = HpmfwupgPreUpgradeCheck(&fwupgCtx,
componentMask, option);
if (rc == HPMFWUPG_SUCCESS) {
if (verbose) {
@@ -830,7 +829,7 @@ HpmfwupgValidateActionRecordChecksum(struct HpmfwupgActionRecord *pActionRecord)
* is same as target version.
*/
int
HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf,
HpmfwupgPreUpgradeCheck(
struct HpmfwupgUpgradeCtx *pFwupgCtx,
int componentMask, int option)
{

View File

@@ -60,8 +60,7 @@ static void ipmi_kontron_help(void);
static int ipmi_kontron_set_serial_number(struct ipmi_intf *intf);
static int ipmi_kontron_set_mfg_date (struct ipmi_intf *intf);
static void ipmi_kontron_nextboot_help(void);
static int ipmi_kontron_nextboot_set(struct ipmi_intf *intf, int argc,
char **argv);
static int ipmi_kontron_nextboot_set(struct ipmi_intf *intf, char **argv);
static int ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf *intf,
unsigned char channel, unsigned char size);
@@ -107,7 +106,7 @@ ipmi_kontronoem_main(struct ipmi_intf *intf, int argc, char **argv)
ipmi_kontron_nextboot_help();
return (-1);
}
rc = ipmi_kontron_nextboot_set(intf, (argc - 1), (argv + 1));
rc = ipmi_kontron_nextboot_set(intf, (argv + 1));
if (rc == 0) {
printf("Nextboot set successfully\n");
} else {
@@ -656,7 +655,7 @@ ipmi_kontron_nextboot_help(void)
* returns 1 if successful
*/
static int
ipmi_kontron_nextboot_set(struct ipmi_intf *intf, int argc, char **argv)
ipmi_kontron_nextboot_set(struct ipmi_intf *intf, char **argv)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;

View File

@@ -37,9 +37,9 @@
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_sel.h>
static int ipmi_oem_supermicro(struct ipmi_intf * intf);
static int ipmi_oem_ibm(struct ipmi_intf * intf);
static int ipmi_oem_quanta(struct ipmi_intf * intf);
static int ipmi_oem_supermicro(struct ipmi_intf *intf);
static int ipmi_oem_ibm(struct ipmi_intf *intf);
static int ipmi_oem_quanta(struct ipmi_intf *intf);
static struct ipmi_oem_handle ipmi_oem_list[] = {
{
@@ -82,16 +82,16 @@ static struct ipmi_oem_handle ipmi_oem_list[] = {
/* Supermicro IPMIv2 BMCs use OEM authtype */
static int
ipmi_oem_supermicro(struct ipmi_intf * intf)
ipmi_oem_supermicro(struct ipmi_intf *intf)
{
ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM);
return 0;
}
static int
ipmi_oem_ibm(struct ipmi_intf * intf)
ipmi_oem_ibm(struct ipmi_intf *__UNUSED__(intf))
{
char * filename = getenv("IPMI_OEM_IBM_DATAFILE");
char *filename = getenv("IPMI_OEM_IBM_DATAFILE");
if (!filename) {
lprintf(LOG_ERR, "Unable to read IPMI_OEM_IBM_DATAFILE from environment");
return -1;
@@ -101,7 +101,7 @@ ipmi_oem_ibm(struct ipmi_intf * intf)
/* Quanta IPMIv2 BMCs use OEM authtype */
static int
ipmi_oem_quanta(struct ipmi_intf * intf)
ipmi_oem_quanta(struct ipmi_intf *intf)
{
ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM);
return 0;
@@ -112,7 +112,7 @@ ipmi_oem_quanta(struct ipmi_intf * intf)
void
ipmi_oem_print(void)
{
struct ipmi_oem_handle * oem;
struct ipmi_oem_handle *oem;
lprintf(LOG_NOTICE, "\nOEM Support:");
for (oem=ipmi_oem_list; oem->name && oem->desc; oem++) {
lprintf(LOG_NOTICE, "\t%-12s %s", oem->name, oem->desc);

View File

@@ -603,7 +603,8 @@ _ipmi_set_pef_policy_entry(struct ipmi_intf *intf, uint8_t policy_id,
}
static void
ipmi_pef_print_oem_lan_dest(struct ipmi_intf *intf, uint8_t ch, uint8_t dest)
ipmi_pef_print_oem_lan_dest(struct ipmi_intf *intf,
uint8_t dest)
{
char address[128];
int len;
@@ -866,7 +867,7 @@ ipmi_pef_print_serial_dest(struct ipmi_intf *intf, uint8_t ch, uint8_t dest)
if (!dest || tbl_size == 0) /* Page alerting not supported */
return;
if (dest > tbl_size) {
ipmi_pef_print_oem_lan_dest(intf, ch, dest - tbl_size);
ipmi_pef_print_oem_lan_dest(intf, dest - tbl_size);
return;
}
@@ -904,7 +905,7 @@ ipmi_pef_print_serial_dest(struct ipmi_intf *intf, uint8_t ch, uint8_t dest)
}
static void
ipmi_pef_print_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
ipmi_pef_print_dest(uint8_t dest)
{ /*
// print generic alert destination info
*/
@@ -1330,7 +1331,7 @@ ipmi_pef2_list_policies(struct ipmi_intf *intf)
dest);
break;
default:
ipmi_pef_print_dest(intf, channel_info.channel, dest);
ipmi_pef_print_dest(dest);
break;
}
printf("\n");

View File

@@ -656,7 +656,7 @@ ipmi_picmg_properties(struct ipmi_intf * intf, int show )
#define PICMG_FRU_ACTIVATE (unsigned char) 0x01
int
ipmi_picmg_fru_activation(struct ipmi_intf * intf, int argc, char ** argv, unsigned char state)
ipmi_picmg_fru_activation(struct ipmi_intf * intf, char ** argv, unsigned char state)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -690,7 +690,7 @@ ipmi_picmg_fru_activation(struct ipmi_intf * intf, int argc, char ** argv, unsig
int
ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -729,7 +729,7 @@ ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, int argc, char **
}
int
ipmi_picmg_fru_activation_policy_set(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_picmg_fru_activation_policy_set(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1153,7 +1153,7 @@ ipmi_picmg_amc_portstate_set(struct ipmi_intf * intf, uint8_t channel,
int
ipmi_picmg_get_led_properties(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_picmg_get_led_properties(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1192,7 +1192,7 @@ ipmi_picmg_get_led_properties(struct ipmi_intf * intf, int argc, char ** argv)
}
int
ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, char ** argv)
{
int i;
struct ipmi_rs * rsp;
@@ -1242,7 +1242,7 @@ ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv)
}
int
ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_picmg_get_led_state(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1329,7 +1329,7 @@ ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
}
int
ipmi_picmg_set_led_state(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_picmg_set_led_state(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1405,7 +1405,7 @@ ipmi_picmg_set_led_state(struct ipmi_intf * intf, int argc, char ** argv)
}
int
ipmi_picmg_get_power_level(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_picmg_get_power_level(struct ipmi_intf * intf, char ** argv)
{
int i;
struct ipmi_rs * rsp;
@@ -1456,7 +1456,7 @@ 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)
ipmi_picmg_set_power_level(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1560,7 +1560,7 @@ ipmi_picmg_bused_resource(struct ipmi_intf * intf, t_picmg_bused_resource_mode m
}
int
ipmi_picmg_fru_control(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_picmg_fru_control(struct ipmi_intf * intf, char ** argv)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@@ -1807,7 +1807,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
/* fru control command */
else if (!strncmp(argv[0], "frucontrol", 10)) {
if (argc > 2) {
rc = ipmi_picmg_fru_control(intf, argc-1, &(argv[1]));
rc = ipmi_picmg_fru_control(intf, &(argv[1]));
}
else {
lprintf(LOG_NOTICE, "usage: frucontrol <FRU-ID> <OPTION>");
@@ -1827,7 +1827,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
/* fru activation command */
else if (!strncmp(argv[0], "activate", 8)) {
if (argc > 1) {
rc = ipmi_picmg_fru_activation(intf, argc-1, &(argv[1]), PICMG_FRU_ACTIVATE);
rc = ipmi_picmg_fru_activation(intf, &(argv[1]), PICMG_FRU_ACTIVATE);
}
else {
lprintf(LOG_ERR, "Specify the FRU to activate.");
@@ -1838,7 +1838,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
/* fru deactivation command */
else if (!strncmp(argv[0], "deactivate", 10)) {
if (argc > 1) {
rc = ipmi_picmg_fru_activation(intf, argc-1, &(argv[1]), PICMG_FRU_DEACTIVATE);
rc = ipmi_picmg_fru_activation(intf, &(argv[1]), PICMG_FRU_DEACTIVATE);
}else {
lprintf(LOG_ERR, "Specify the FRU to deactivate.");
return -1;
@@ -1850,13 +1850,13 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
if (argc > 1) {
if (!strncmp(argv[1], "get", 3)) {
if (argc > 2) {
rc = ipmi_picmg_fru_activation_policy_get(intf, argc-1, &(argv[2]));
rc = ipmi_picmg_fru_activation_policy_get(intf, &(argv[2]));
} else {
lprintf(LOG_NOTICE, "usage: get <fruid>");
}
} else if (!strncmp(argv[1], "set", 3)) {
if (argc > 4) {
rc = ipmi_picmg_fru_activation_policy_set(intf, argc-1, &(argv[2]));
rc = ipmi_picmg_fru_activation_policy_set(intf, &(argv[2]));
} else {
lprintf(LOG_NOTICE, "usage: set <fruid> <lockmask> <lock>");
lprintf(LOG_NOTICE,
@@ -2095,7 +2095,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
if (argc > 1) {
if (!strncmp(argv[1], "prop", 4)) {
if (argc > 2) {
rc = ipmi_picmg_get_led_properties(intf, argc-1, &(argv[2]));
rc = ipmi_picmg_get_led_properties(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "led prop <FRU-ID>");
@@ -2103,7 +2103,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
else if (!strncmp(argv[1], "cap", 3)) {
if (argc > 3) {
rc = ipmi_picmg_get_led_capabilities(intf, argc-1, &(argv[2]));
rc = ipmi_picmg_get_led_capabilities(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "led cap <FRU-ID> <LED-ID>");
@@ -2111,7 +2111,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
else if (!strncmp(argv[1], "get", 3)) {
if (argc > 3) {
rc = ipmi_picmg_get_led_state(intf, argc-1, &(argv[2]));
rc = ipmi_picmg_get_led_state(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "led get <FRU-ID> <LED-ID>");
@@ -2119,7 +2119,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
else if (!strncmp(argv[1], "set", 3)) {
if (argc > 6) {
rc = ipmi_picmg_set_led_state(intf, argc-1, &(argv[2]));
rc = ipmi_picmg_set_led_state(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE,
@@ -2163,7 +2163,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
if (argc > 1) {
if (!strncmp(argv[1], "get", 3)) {
if (argc > 3) {
rc = ipmi_picmg_get_power_level(intf, argc-1, &(argv[2]));
rc = ipmi_picmg_get_power_level(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "power get <FRU-ID> <type>");
@@ -2178,7 +2178,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
}
else if (!strncmp(argv[1], "set", 3)) {
if (argc > 4) {
rc = ipmi_picmg_set_power_level(intf, argc-1, &(argv[2]));
rc = ipmi_picmg_set_power_level(intf, &(argv[2]));
}
else {
lprintf(LOG_NOTICE, "power set <FRU-ID> <level> <present-desired>");

View File

@@ -194,7 +194,7 @@ int ipmi_sel_oem_init(const char * filename)
return 0;
}
static void ipmi_sel_oem_message(struct sel_event_record * evt, int verbose)
static void ipmi_sel_oem_message(struct sel_event_record * evt)
{
/*
* Note: although we have a verbose argument, currently the output
@@ -425,14 +425,15 @@ static struct ipmi_event_sensor_types __UNUSED__(oem_kontron_event_reading_types
{ 0x71 , 0x00 , 0xff, "Code Assert" },
{ 0, 0, 0xFF, NULL }
};
/* NOTE: unused paramter kept in for consistency. */
char *
get_kontron_evt_desc(struct ipmi_intf *intf, struct sel_event_record * rec)
get_kontron_evt_desc(struct ipmi_intf *__UNUSED__(intf), struct sel_event_record *rec)
{
char * description = NULL;
char *description = NULL;
/*
* Kontron OEM events are described in the product's user manual, but are limited in favor of
* sensor specific
* sensor specific
*/
/* Only standard records are defined so far */
@@ -1861,7 +1862,7 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
}
ipmi_sel_oem_message(evt, 0);
ipmi_sel_oem_message(evt);
printf ("\n");
return;
}
@@ -2055,7 +2056,7 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
printf(" [%s]\n\n",hex2ascii (evt->sel_type.oem_nots_type.oem_defined, SEL_OEM_NOTS_DATA_LEN));
ipmi_sel_oem_message(evt, 1);
ipmi_sel_oem_message(evt);
}
return;
}

View File

@@ -648,13 +648,14 @@ ipmi_print_sol_info(struct ipmi_intf * intf, uint8_t channel)
*
* function will return -1 if value is not valid, or
* will return 0 if valid.
*
* base parameter currently unused, left in for extension.
*/
int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
const char *name,
int base,
uint8_t minval,
uint8_t maxval,
uint8_t *out_value)
int ipmi_sol_set_param_isvalid_uint8_t(const char *strval,
const char *name,
uint8_t minval,
uint8_t maxval,
uint8_t *out_value)
{
if (str2uchar(strval, out_value) != 0 || (*out_value < minval)
|| (*out_value > maxval)) {
@@ -866,7 +867,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
data[1] = SOL_PARAMETER_CHARACTER_INTERVAL;
/* validate user-supplied input */
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 1, 255, &data[2]))
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 1, 255, &data[2]))
return -1;
/* We need other values to complete the request */
@@ -892,7 +893,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
data[1] = SOL_PARAMETER_CHARACTER_INTERVAL;
/* validate user-supplied input */
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 255, &data[3]))
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 255, &data[3]))
return -1;
/* We need other values to complete the request */
@@ -918,7 +919,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
data[1] = SOL_PARAMETER_SOL_RETRY;
/* validate user input, 7 is max value */
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 7, &data[2]))
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 7, &data[2]))
return -1;
/* We need other values to complete the request */
@@ -944,7 +945,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
data[1] = SOL_PARAMETER_SOL_RETRY;
/* validate user-supplied input */
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 255, &data[3]))
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 255, &data[3]))
return -1;
/* We need other values to complete the request */