Author: uwe Date: 2008-03-20 21:05:22 +0100 (Thu, 20 Mar 2008) New Revision: 3181
Modified: trunk/payloads/coreinfo/Makefile trunk/payloads/coreinfo/coreboot_module.c trunk/payloads/coreinfo/coreinfo.c trunk/payloads/coreinfo/cpuinfo_module.c trunk/payloads/coreinfo/pci_module.c Log: Smaller fixes to allow using -Wall (trivial).
Signed-off-by: Uwe Hermann uwe@hermann-uwe.de Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: trunk/payloads/coreinfo/Makefile =================================================================== --- trunk/payloads/coreinfo/Makefile 2008-03-20 19:54:59 UTC (rev 3180) +++ trunk/payloads/coreinfo/Makefile 2008-03-20 20:05:22 UTC (rev 3181) @@ -25,7 +25,7 @@
LIBPAYLOAD = ../libpayload/libpayload.a LIBGCC := $(shell $(CC) $(CROSS_CFLAGS) -print-libgcc-file-name) -CFLAGS := -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES) +CFLAGS := -Wall -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
MODULES = cpuinfo_module.o cpuid.o pci_module.o coreboot_module.o OBJECTS = coreinfo.o
Modified: trunk/payloads/coreinfo/coreboot_module.c =================================================================== --- trunk/payloads/coreinfo/coreboot_module.c 2008-03-20 19:54:59 UTC (rev 3180) +++ trunk/payloads/coreinfo/coreboot_module.c 2008-03-20 20:05:22 UTC (rev 3181) @@ -114,6 +114,8 @@ UNPACK_CB64(cb_info.range[i].start) + UNPACK_CB64(cb_info.range[i].size) - 1); } + + return 0; }
static void parse_memory(unsigned char *ptr) @@ -139,8 +141,8 @@ { struct cb_mainboard *mb = (struct cb_mainboard *)ptr;
- strncpy(cb_info.vendor, MB_VENDOR_STRING(mb), 31); - strncpy(cb_info.part, MB_PART_STRING(mb), 31); + strncpy(cb_info.vendor, (const char *)MB_VENDOR_STRING(mb), 31); + strncpy(cb_info.part, (const char *)MB_PART_STRING(mb), 31); }
static void parse_strings(unsigned char *ptr) @@ -148,7 +150,7 @@ struct cb_string *string = (struct cb_string *)ptr; int index = string->tag - CB_TAG_VERSION;
- strncpy(cb_info.strings[index], string->string, 63); + strncpy(cb_info.strings[index], (const char *)string->string, 63); cb_info.strings[index][63] = 0; }
@@ -173,7 +175,7 @@ for (i = 0; i < len; i += 16, ptr += 16) { header = (struct cb_header *)ptr;
- if (!strncmp(header->signature, "LBIO", 4)) + if (!strncmp((const char *)header->signature, "LBIO", 4)) break; }
Modified: trunk/payloads/coreinfo/coreinfo.c =================================================================== --- trunk/payloads/coreinfo/coreinfo.c 2008-03-20 19:54:59 UTC (rev 3180) +++ trunk/payloads/coreinfo/coreinfo.c 2008-03-20 20:05:22 UTC (rev 3181) @@ -52,7 +52,7 @@
void print_menu(void) { - int i, j, len; + int i, j; char menu[80]; char *ptr = menu;
@@ -105,7 +105,7 @@ refresh(); }
-int loop(void) +void loop(void) { int key;
@@ -168,4 +168,6 @@ modules[i]->init();
loop(); + + return 0; }
Modified: trunk/payloads/coreinfo/cpuinfo_module.c =================================================================== --- trunk/payloads/coreinfo/cpuinfo_module.c 2008-03-20 19:54:59 UTC (rev 3180) +++ trunk/payloads/coreinfo/cpuinfo_module.c 2008-03-20 20:05:22 UTC (rev 3181) @@ -92,7 +92,6 @@
void decode_flags(WINDOW *win, unsigned long reg, const char **flags, int *row) { - int index = 0; int i; int lrow = *row;
@@ -117,7 +116,6 @@ static void get_features(WINDOW *win, int *row) { unsigned long eax, ebx, ecx, edx; - int index = 0; int lrow = *row;
wmove(win, lrow++, 1); @@ -152,7 +150,7 @@
static void do_name(WINDOW *win, int row) { - char str[80], name[49], *p; + char name[49], *p; unsigned long eax, ebx, ecx, edx; int i, t;
@@ -177,11 +175,11 @@ mvwprintw(win, row, 1, "Processor: %s", name); }
-int cpuinfo_module_redraw(WINDOW * win) +int cpuinfo_module_redraw(WINDOW *win) { unsigned long eax, ebx, ecx, edx; unsigned int brand; - char str[80], *vstr; + char *vstr; int row = 2;
print_module_title(win, "CPU Information"); @@ -210,6 +208,10 @@ break; case VENDOR_SIS: vstr = "SiS"; + break; + default: + vstr = "Unknown"; + break; }
mvwprintw(win, row++, 1, "Vendor: %s", vstr); @@ -238,6 +240,8 @@
row++; get_features(win, &row); + + return 0; }
unsigned int getticks(void) @@ -255,6 +259,7 @@ int cpuinfo_module_init(void) { cpu_khz = getticks(); + return 0; }
struct coreinfo_module cpuinfo_module = {
Modified: trunk/payloads/coreinfo/pci_module.c =================================================================== --- trunk/payloads/coreinfo/pci_module.c 2008-03-20 19:54:59 UTC (rev 3180) +++ trunk/payloads/coreinfo/pci_module.c 2008-03-20 20:05:22 UTC (rev 3181) @@ -106,7 +106,7 @@ *val = inb(0xcfc + (reg & 3)); }
-static int show_config_space(WINDOW *win, int row, int col, int index) +static void show_config_space(WINDOW *win, int row, int col, int index) { unsigned char cspace[64]; int bus, devfn; @@ -116,7 +116,7 @@ devfn = devices[index].device & 0xff;
for (i = 0; i < 64; i += 4) - pci_read_dword(bus, devfn, i, ((int *)&cspace[i])); + pci_read_dword(bus, devfn, i, ((unsigned int *)&cspace[i]));
for (y = 0; y < 4; y++) { for (x = 0; x < 16; x++) @@ -272,11 +272,7 @@
int pci_module_init(void) { - unsigned int val; - int bus = 0; - pci_scan_bus(0); - return 0; }