mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-01-22 22:52:20 +08:00
ID: 65 - Fixes for configure.in for cross compilation
Changes to ipmi_ek_display_board_info_area() in order to get rid off warnings. Commit for Dan Gora
This commit is contained in:
parent
977c587fde
commit
04ba23bc5d
@ -2711,6 +2711,7 @@ ipmi_ek_display_board_info_area(FILE * input_file, char * board_type,
|
|||||||
unsigned int * board_length)
|
unsigned int * board_length)
|
||||||
{
|
{
|
||||||
size_t file_offset;
|
size_t file_offset;
|
||||||
|
int ret = 0;
|
||||||
unsigned char len = 0;
|
unsigned char len = 0;
|
||||||
unsigned int size_board = 0;
|
unsigned int size_board = 0;
|
||||||
if (input_file == NULL || board_type == NULL
|
if (input_file == NULL || board_type == NULL
|
||||||
@ -2718,16 +2719,15 @@ ipmi_ek_display_board_info_area(FILE * input_file, char * board_type,
|
|||||||
return (size_t)(-1);
|
return (size_t)(-1);
|
||||||
}
|
}
|
||||||
file_offset = ftell(input_file);
|
file_offset = ftell(input_file);
|
||||||
|
|
||||||
/* Board length*/
|
/* Board length*/
|
||||||
if (!feof(input_file)) {
|
ret = fread(&len, 1, 1, input_file);
|
||||||
fread(&len, 1, 1, input_file);
|
if ((ret != 1) || ferror(input_file)) {
|
||||||
(*board_length)--;
|
lprintf(LOG_ERR, "Invalid Length!");
|
||||||
}
|
|
||||||
/* Board Data */
|
|
||||||
if (feof(input_file)) {
|
|
||||||
printf("No Board Data found!\n");
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
(*board_length)--;
|
||||||
|
|
||||||
/* Bit 5:0 of Board Mfg type represent legnth */
|
/* Bit 5:0 of Board Mfg type represent legnth */
|
||||||
size_board = (len & 0x3f);
|
size_board = (len & 0x3f);
|
||||||
if (size_board == 0) {
|
if (size_board == 0) {
|
||||||
@ -2742,7 +2742,11 @@ ipmi_ek_display_board_info_area(FILE * input_file, char * board_type,
|
|||||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||||
return (size_t)(-1);
|
return (size_t)(-1);
|
||||||
}
|
}
|
||||||
fread(data, size_board, 1, input_file);
|
ret = fread(data, size_board, 1, input_file);
|
||||||
|
if ((ret != 1) || ferror(input_file)) {
|
||||||
|
lprintf(LOG_ERR, "Invalid board type size!");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
printf("%s type: 0x%02x\n", board_type, len);
|
printf("%s type: 0x%02x\n", board_type, len);
|
||||||
printf("%s: ", board_type);
|
printf("%s: ", board_type);
|
||||||
for (i = 0; i < size_board; i++) {
|
for (i = 0; i < size_board; i++) {
|
||||||
@ -2763,6 +2767,7 @@ ipmi_ek_display_board_info_area(FILE * input_file, char * board_type,
|
|||||||
while (!feof(input_file)) {
|
while (!feof(input_file)) {
|
||||||
if (len == NO_MORE_INFO_FIELD) {
|
if (len == NO_MORE_INFO_FIELD) {
|
||||||
unsigned char padding;
|
unsigned char padding;
|
||||||
|
unsigned char checksum = 0;
|
||||||
/* take the rest of data in the area minus 1 byte of
|
/* take the rest of data in the area minus 1 byte of
|
||||||
* checksum
|
* checksum
|
||||||
*/
|
*/
|
||||||
@ -2772,11 +2777,12 @@ ipmi_ek_display_board_info_area(FILE * input_file, char * board_type,
|
|||||||
printf("Unused space: %d (bytes)\n", padding);
|
printf("Unused space: %d (bytes)\n", padding);
|
||||||
fseek(input_file, padding, SEEK_CUR);
|
fseek(input_file, padding, SEEK_CUR);
|
||||||
}
|
}
|
||||||
if (!feof(input_file)) {
|
ret = fread(&checksum, 1, 1, input_file);
|
||||||
unsigned char checksum = 0;
|
if ((ret != 1) || ferror(input_file)) {
|
||||||
fread(&checksum, 1, 1, input_file);
|
lprintf(LOG_ERR, "Invalid Checksum!");
|
||||||
printf("Checksum: 0x%02x\n", checksum);
|
goto out;
|
||||||
}
|
}
|
||||||
|
printf("Checksum: 0x%02x\n", checksum);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
printf("Additional Custom Mfg. length: 0x%02x\n", len);
|
printf("Additional Custom Mfg. length: 0x%02x\n", len);
|
||||||
@ -2789,7 +2795,11 @@ ipmi_ek_display_board_info_area(FILE * input_file, char * board_type,
|
|||||||
return (size_t)(-1);
|
return (size_t)(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(additional_data, size_board, 1, input_file);
|
ret = fread(additional_data, size_board, 1, input_file);
|
||||||
|
if ((ret != 1) || ferror(input_file)) {
|
||||||
|
lprintf(LOG_ERR, "Invalid Additional Data!");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
printf("Additional Custom Mfg. Data: %02x",
|
printf("Additional Custom Mfg. Data: %02x",
|
||||||
additional_data[0]);
|
additional_data[0]);
|
||||||
for (i = 1; i < size_board; i++) {
|
for (i = 1; i < size_board; i++) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user