flashrom: Little readability improvement in cbtable.c:coreboot_init()
Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3899 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
09c0b7c61d
commit
e03d84af69
|
@ -184,6 +184,7 @@ static void search_lb_records(struct lb_record *rec, struct lb_record *last,
|
||||||
int coreboot_init(void)
|
int coreboot_init(void)
|
||||||
{
|
{
|
||||||
uint8_t *low_1MB;
|
uint8_t *low_1MB;
|
||||||
|
unsigned long addr;
|
||||||
struct lb_header *lb_table;
|
struct lb_header *lb_table;
|
||||||
struct lb_record *rec, *last;
|
struct lb_record *rec, *last;
|
||||||
|
|
||||||
|
@ -194,13 +195,14 @@ int coreboot_init(void)
|
||||||
mmap_errmsg();
|
mmap_errmsg();
|
||||||
exit(-2);
|
exit(-2);
|
||||||
}
|
}
|
||||||
lb_table = 0;
|
|
||||||
if (!lb_table)
|
|
||||||
lb_table = find_lb_table(low_1MB, 0x00000, 0x1000);
|
lb_table = find_lb_table(low_1MB, 0x00000, 0x1000);
|
||||||
if (!lb_table)
|
if (!lb_table)
|
||||||
lb_table = find_lb_table(low_1MB, 0xf0000, 1024 * 1024);
|
lb_table = find_lb_table(low_1MB, 0xf0000, 1024 * 1024);
|
||||||
if (lb_table) {
|
if (!lb_table) {
|
||||||
unsigned long addr;
|
printf("No coreboot table found.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
addr = ((char *)lb_table) - ((char *)low_1MB);
|
addr = ((char *)lb_table) - ((char *)low_1MB);
|
||||||
printf_debug("Coreboot table found at %p.\n", lb_table);
|
printf_debug("Coreboot table found at %p.\n", lb_table);
|
||||||
rec = (struct lb_record *)(((char *)lb_table) + lb_table->header_bytes);
|
rec = (struct lb_record *)(((char *)lb_table) + lb_table->header_bytes);
|
||||||
|
@ -210,10 +212,6 @@ int coreboot_init(void)
|
||||||
lb_table->table_bytes, lb_table->table_checksum,
|
lb_table->table_bytes, lb_table->table_checksum,
|
||||||
lb_table->table_entries);
|
lb_table->table_entries);
|
||||||
search_lb_records(rec, last, addr + lb_table->header_bytes);
|
search_lb_records(rec, last, addr + lb_table->header_bytes);
|
||||||
} else {
|
|
||||||
printf("No coreboot table found.\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue