diff --git a/include/console.h b/include/console.h index eed2818c3a..a4384c493e 100644 --- a/include/console.h +++ b/include/console.h @@ -46,6 +46,7 @@ struct console_driver { }; // -int printk(int msg_level, const char *fmt, ...); +int printk(int msg_level, const char *fmt, ...) + __attribute__((format (printf, 2, 3))); #endif /* CONSOLE_H */ diff --git a/lib/elfboot.c b/lib/elfboot.c index f49a729568..455c0e98fd 100644 --- a/lib/elfboot.c +++ b/lib/elfboot.c @@ -88,7 +88,7 @@ static int load_elf_segments(struct lb_memory *mem,unsigned char *header, int he ehdr = (Elf_ehdr *)header; phdr = (Elf_phdr *)(&header[ehdr->e_phoff]); - printk(BIOS_DEBUG, "%s: header %p #headers %d\n", header, headers); + printk(BIOS_DEBUG, "%s: header %p #headers %d\n", __FUNCTION__, header, headers); int i; int size; for(i = 0; i < headers; i++) { diff --git a/lib/lar.c b/lib/lar.c index 7b969213fa..cb7920eeab 100644 --- a/lib/lar.c +++ b/lib/lar.c @@ -37,7 +37,7 @@ int find_file(struct mem_file *archive, char *filename, struct mem_file *result) struct lar_header *header; printk(BIOS_INFO, "LAR: Attempting to open '%s'.\n", filename); - printk(BIOS_SPEW, "LAR: Start 0x%x len 0x%x\n", archive->start, + printk(BIOS_SPEW, "LAR: Start %p len 0x%x\n", archive->start, archive->len); for (walk = archive->start; diff --git a/lib/vtxprintf.c b/lib/vtxprintf.c index 0a78200101..08f4bc92b6 100644 --- a/lib/vtxprintf.c +++ b/lib/vtxprintf.c @@ -211,6 +211,8 @@ int vtxprintf(void (*tx_byte)(unsigned char byte, void *arg), void *arg, const c field_width = 2*sizeof(void *); flags |= ZEROPAD; } + tx_byte('0', arg), count++; + tx_byte('x', arg), count++; count += number(tx_byte, arg, (unsigned long) va_arg(args, void *), 16, field_width, precision, flags); diff --git a/util/x86emu/vm86.c b/util/x86emu/vm86.c index 1269c95061..33e221e22a 100644 --- a/util/x86emu/vm86.c +++ b/util/x86emu/vm86.c @@ -310,8 +310,8 @@ void vga_enable_console(void) void do_vgabios(void) { struct device *dev; - unsigned long busdevfn; - unsigned int rom = 0; + unsigned int busdevfn; + unsigned long rom = 0; unsigned char *buf; unsigned int size = 64*1024; int i; @@ -334,7 +334,7 @@ void do_vgabios(void) #warning fix rom address rom = 0xc0000; pci_write_config32(dev, PCI_ROM_ADDRESS, rom|1); - printk(BIOS_DEBUG, "rom base, size: %x\n", rom); + printk(BIOS_DEBUG, "rom base, size: %p\n", (void *)rom); buf = (unsigned char *) rom; if ((buf[0] == 0x55) && (buf[1] == 0xaa)) {