mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 02:16:17 +00:00
tools/intel_bios_reader: fixup new warnings
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
74b70baf14
commit
24a33db7f0
@ -78,12 +78,12 @@ static struct bdb_block *find_section(int section_id)
|
|||||||
{
|
{
|
||||||
struct bdb_block *block;
|
struct bdb_block *block;
|
||||||
unsigned char *base = (unsigned char *)bdb;
|
unsigned char *base = (unsigned char *)bdb;
|
||||||
int index = 0;
|
int idx = 0;
|
||||||
uint16_t total, current_size;
|
uint16_t total, current_size;
|
||||||
unsigned char current_id;
|
unsigned char current_id;
|
||||||
|
|
||||||
/* skip to first section */
|
/* skip to first section */
|
||||||
index += bdb->header_size;
|
idx += bdb->header_size;
|
||||||
total = bdb->bdb_size;
|
total = bdb->bdb_size;
|
||||||
|
|
||||||
block = malloc(sizeof(*block));
|
block = malloc(sizeof(*block));
|
||||||
@ -93,18 +93,18 @@ static struct bdb_block *find_section(int section_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* walk the sections looking for section_id */
|
/* walk the sections looking for section_id */
|
||||||
while (index < total) {
|
while (idx < total) {
|
||||||
current_id = *(base + index);
|
current_id = *(base + idx);
|
||||||
index++;
|
idx++;
|
||||||
current_size = *((uint16_t *) (base + index));
|
current_size = *((uint16_t *) (base + idx));
|
||||||
index += 2;
|
idx += 2;
|
||||||
if (current_id == section_id) {
|
if (current_id == section_id) {
|
||||||
block->id = current_id;
|
block->id = current_id;
|
||||||
block->size = current_size;
|
block->size = current_size;
|
||||||
block->data = base + index;
|
block->data = base + idx;
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
index += current_size;
|
idx += current_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(block);
|
free(block);
|
||||||
@ -829,7 +829,7 @@ int main(int argc, char **argv)
|
|||||||
int fd;
|
int fd;
|
||||||
struct vbt_header *vbt = NULL;
|
struct vbt_header *vbt = NULL;
|
||||||
int vbt_off, bdb_off, i;
|
int vbt_off, bdb_off, i;
|
||||||
char *filename = "bios";
|
const char *filename = "bios";
|
||||||
struct stat finfo;
|
struct stat finfo;
|
||||||
struct bdb_block *block;
|
struct bdb_block *block;
|
||||||
char signature[17];
|
char signature[17];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user