diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2008-03-27 20:46:49 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2008-03-27 20:46:49 +0000 |
commit | a0c0093a09f0a7115ce73abe00b8b75afab4a08c (patch) | |
tree | 2fcc35b0529584285087b8ec091f22465fa8545a /payloads/coreinfo/coreinfo.c | |
parent | 408c4e1784a35ce9c2920e7cf17d78450515b1d2 (diff) |
Various tiny fixes (trivial):
- Show PCI IDs as 4-digit numbers always.
- Cosmetic changes to make UI look more consistent.
- Drop MODULE_COUNT #define and use ARRAY_SIZE() where needed.
- Small fix to improve build system (create build/ when not there).
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3191 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/coreinfo/coreinfo.c')
-rw-r--r-- | payloads/coreinfo/coreinfo.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/payloads/coreinfo/coreinfo.c b/payloads/coreinfo/coreinfo.c index c81e9b3895..09a405d83b 100644 --- a/payloads/coreinfo/coreinfo.c +++ b/payloads/coreinfo/coreinfo.c @@ -26,12 +26,10 @@ extern struct coreinfo_module cpuinfo_module; extern struct coreinfo_module pci_module; extern struct coreinfo_module coreboot_module; -#define MODULE_COUNT 3 - -struct coreinfo_module *modules[MODULE_COUNT] = { +struct coreinfo_module *modules[] = { &cpuinfo_module, &pci_module, - &coreboot_module + &coreboot_module, }; static WINDOW *modwin; @@ -61,7 +59,7 @@ static void print_menu(void) for (j = 0; j < SCREEN_X; j++) waddch(stdscr, ' '); - for (i = 0; i < MODULE_COUNT; i++) + for (i = 0; i < ARRAY_SIZE(modules); i++) ptr += sprintf(ptr, "F%d: %s ", i + 1, modules[i]->name); mvprintw(23, 0, menu); @@ -127,7 +125,7 @@ static void loop(void) if (key >= KEY_F(1) && key <= KEY_F(9)) { unsigned char ch = key - KEY_F(1); - if (ch < MODULE_COUNT) { + if (ch < ARRAY_SIZE(modules)) { curwin = ch; redraw_module(); continue; @@ -167,7 +165,7 @@ int main(void) refresh(); - for (i = 0; i < MODULE_COUNT; i++) + for (i = 0; i < ARRAY_SIZE(modules); i++) modules[i]->init(); loop(); |