Author: stepan
Date: 2007-08-11 20:38:24 +0200 (Sat, 11 Aug 2007)
New Revision: 466

Modified:
   LinuxBIOSv3/arch/x86/linuxbios_table.c
   LinuxBIOSv3/device/device.c
   LinuxBIOSv3/device/device_util.c
   LinuxBIOSv3/device/pci_device.c
   LinuxBIOSv3/device/pci_rom.c
   LinuxBIOSv3/device/pnp_device.c
   LinuxBIOSv3/lib/elfboot.c
   LinuxBIOSv3/northbridge/intel/i440bxemulation/i440bx.c
   LinuxBIOSv3/superio/winbond/w83627hf/superio.c
   LinuxBIOSv3/util/x86emu/vm86.c
Log:
This patch removes all printk format warnings from my LBv3 build (Qemu
x86 config). This was tested with gcc 4.1.0 on x86 and gcc 4.2.1 on x86_64.

Signed-off-by: Carl-Daniel Hailfinger <[EMAIL PROTECTED]>
Acked-by: Stefan Reinauer <[EMAIL PROTECTED]>



Modified: LinuxBIOSv3/arch/x86/linuxbios_table.c
===================================================================
--- LinuxBIOSv3/arch/x86/linuxbios_table.c      2007-08-10 13:48:59 UTC (rev 
465)
+++ LinuxBIOSv3/arch/x86/linuxbios_table.c      2007-08-11 18:38:24 UTC (rev 
466)
@@ -177,8 +177,8 @@
 {
        int entries;
 
-       printk(BIOS_DEBUG, "%s: start 0x%lx size 0x%lx\n", 
-                       __func__, (u32)start, (u32)size);
+       printk(BIOS_DEBUG, "%s: start 0x%Lx size 0x%Lx\n", 
+                       __func__, start, size);
 
        entries = (mem->size - sizeof(*mem))/sizeof(mem->map[0]);
        mem->map[entries].start = pack_lb64(start);
@@ -231,7 +231,7 @@
        head->table_checksum = compute_ip_checksum(first_rec, 
head->table_bytes);
        head->header_checksum = 0;
        head->header_checksum = compute_ip_checksum(head, sizeof(*head));
-       printk(BIOS_DEBUG,"Wrote LinuxBIOS table at: %p - %p  checksum %lx\n",
+       printk(BIOS_DEBUG,"Wrote LinuxBIOS table at: %p - %p  checksum %x\n",
                head, rec, head->table_checksum);
        return (unsigned long)rec;
 }
@@ -243,8 +243,8 @@
        entries = (mem->size - sizeof(*mem))/sizeof(mem->map[0]);
        printk(BIOS_DEBUG, "%s: # entries %d\n", __func__, entries);
        for(i = 0; i < entries; i++)
-               printk(BIOS_INFO, "  #%d: base 0x%x size 0x%x\n", 
-                               i, (u32)mem->map[i].start.lo, 
mem->map[i].size.lo);
+               printk(BIOS_INFO, "  #%d: base 0x%08x size 0x%x\n", 
+                               i, mem->map[i].start.lo, mem->map[i].size.lo);
        
        /* Sort the lb memory ranges */
        for(i = 0; i < entries; i++) {

Modified: LinuxBIOSv3/device/device.c
===================================================================
--- LinuxBIOSv3/device/device.c 2007-08-10 13:48:59 UTC (rev 465)
+++ LinuxBIOSv3/device/device.c 2007-08-11 18:38:24 UTC (rev 466)
@@ -130,10 +130,10 @@
        int i;
        printk(BIOS_SPEW, "%s: find %s\n", __func__, dev_id_string(id));
        for (i = 0; all_constructors[i]; i++) {
-               printk(BIOS_SPEW, "%s: check all_constructors[i] 0x%lx\n",
+               printk(BIOS_SPEW, "%s: check all_constructors[i] %p\n",
                       __func__, all_constructors[i]);
                for (c = all_constructors[i]; c->ops; c++) {
-                       printk(BIOS_SPEW, "%s: cons 0x%lx, cons id %s\n",
+                       printk(BIOS_SPEW, "%s: cons %p, cons id %s\n",
                               __func__, c, dev_id_string(&c->id));
                        if ((!c->ops) || (!c->ops->constructor)) {
                                continue;
@@ -164,7 +164,7 @@
        struct constructor *c;
 
        c = find_constructor(id);
-       printk(BIOS_SPEW, "%s: constructor is 0x%lx\n", __func__, c);
+       printk(BIOS_SPEW, "%s: constructor is %p\n", __func__, c);
  
        if(c && c->ops && c->ops->constructor)
                c->ops->constructor(dev, c);
@@ -485,7 +485,7 @@
                        base += size;
 
                        printk(BIOS_SPEW,
-                              "%s %02x *  [0x%08Lx - 0x%08Lx] %s\n",
+                              "%s %02lx *  [0x%08Lx - 0x%08Lx] %s\n",
                               dev_path(dev),
                               resource->index,
                               resource->base,

Modified: LinuxBIOSv3/device/device_util.c
===================================================================
--- LinuxBIOSv3/device/device_util.c    2007-08-10 13:48:59 UTC (rev 465)
+++ LinuxBIOSv3/device/device_util.c    2007-08-11 18:38:24 UTC (rev 466)
@@ -602,7 +602,7 @@
 #endif
                }
                printk(BIOS_DEBUG,
-                      "%s %02x <- [0x%010Lx - 0x%010Lx] %s%s%s\n",
+                      "%s %02lx <- [0x%010Lx - 0x%010Lx] %s%s%s\n",
                       dev_path(dev),
                       resource->index,
                       base, end, buf, resource_type(resource), comment);
@@ -643,7 +643,7 @@
                             resource_search_t search, void *gp)
 {
        struct device *curdev;
-       printk(BIOS_SPEW, "%s: mask %x type %x \n", __func__, type_mask, type);
+       printk(BIOS_SPEW, "%s: mask %lx type %lx \n", __func__, type_mask, 
type);
        for (curdev = all_devices; curdev; curdev = curdev->next) {
                int i;
                printk(BIOS_SPEW,
@@ -656,9 +656,9 @@
                for (i = 0; i < curdev->resources; i++) {
                        struct resource *resource = &curdev->resource[i];
                        printk(BIOS_SPEW,
-                              "%s: dev %s, resource %d, flags %x base 0x%lx 
size 0x%lx\n",
+                              "%s: dev %s, resource %d, flags %lx base 0x%Lx 
size 0x%Lx\n",
                               __func__, curdev->dtsname, i, resource->flags,
-                              (u32) resource->base, (u32) resource->size);
+                              resource->base, resource->size);
                        /* If it isn't the right kind of resource ignore it. */
                        if ((resource->flags & type_mask) != type) {
                                continue;

Modified: LinuxBIOSv3/device/pci_device.c
===================================================================
--- LinuxBIOSv3/device/pci_device.c     2007-08-10 13:48:59 UTC (rev 465)
+++ LinuxBIOSv3/device/pci_device.c     2007-08-11 18:38:24 UTC (rev 466)
@@ -210,7 +210,7 @@
        if (moving == 0) {
                if (value != 0) {
                        printk(BIOS_DEBUG,
-                              "%s register %02x(%08x), read-only ignoring 
it\n",
+                              "%s register %02lx(%08lx), read-only ignoring 
it\n",
                               dev_path(dev), index, value);
                }
                resource->flags = 0;
@@ -309,7 +309,7 @@
        if (moving == 0) {
                if (value != 0) {
                        printk(BIOS_DEBUG,
-                              "%s register %02x(%08x), read-only ignoring 
it\n",
+                              "%s register %02lx(%08lx), read-only ignoring 
it\n",
                               dev_path(dev), index, value);
                }
                resource->flags = 0;
@@ -456,7 +456,7 @@
        /* Make certain the resource has actually been set. */
        if (!(resource->flags & IORESOURCE_ASSIGNED)) {
                printk(BIOS_ERR,
-                      "ERROR: %s %02x %s size: 0x%010Lx not assigned\n",
+                      "ERROR: %s %02lx %s size: 0x%010Lx not assigned\n",
                       dev_path(dev), resource->index, resource_type(resource),
                       resource->size);
                return;
@@ -537,7 +537,7 @@
        } else {
                /* Don't let me think I stored the resource. */
                resource->flags &= ~IORESOURCE_STORED;
-               printk(BIOS_ERR, "ERROR: invalid resource->index %x\n",
+               printk(BIOS_ERR, "ERROR: invalid resource->index %lx\n",
                       resource->index);
        }
        report_resource_stored(dev, resource, "");

Modified: LinuxBIOSv3/device/pci_rom.c
===================================================================
--- LinuxBIOSv3/device/pci_rom.c        2007-08-10 13:48:59 UTC (rev 465)
+++ LinuxBIOSv3/device/pci_rom.c        2007-08-11 18:38:24 UTC (rev 466)
@@ -47,7 +47,7 @@
                return NULL;
        }
 
-       printk(BIOS_DEBUG, "ROM address for %s = %x\n", dev_path(dev),
+       printk(BIOS_DEBUG, "ROM address for %s = %lx\n", dev_path(dev),
               rom_address);
 
        if (!dev->on_mainboard) {
@@ -131,7 +131,7 @@
                        return NULL;    // Only one VGA supported.
 #endif
                printk(BIOS_DEBUG,
-                      "Copying VGA ROM image from 0x%x to 0x%x, 0x%x bytes\n",
+                      "Copying VGA ROM image from %p to 0x%x, 0x%x bytes\n",
                       rom_header, PCI_VGA_RAM_IMAGE_START, rom_size);
                memcpy((void *)PCI_VGA_RAM_IMAGE_START, rom_header, rom_size);
                vga_inited = 1;
@@ -139,7 +139,7 @@
 #endif
        } else {
                printk(BIOS_DEBUG,
-                      "Copying non-VGA ROM image from 0x%x to 0x%x, 0x%x 
bytes\n",
+                      "Copying non-VGA ROM image from %p to %p, 0x%x bytes\n",
                       rom_header, pci_ram_image_start, rom_size);
                memcpy(pci_ram_image_start, rom_header, rom_size);
                pci_ram_image_start += rom_size;

Modified: LinuxBIOSv3/device/pnp_device.c
===================================================================
--- LinuxBIOSv3/device/pnp_device.c     2007-08-10 13:48:59 UTC (rev 465)
+++ LinuxBIOSv3/device/pnp_device.c     2007-08-11 18:38:24 UTC (rev 466)
@@ -87,7 +87,7 @@
 {
        if (!(resource->flags & IORESOURCE_ASSIGNED)) {
                printk(BIOS_ERR,
-                      "ERROR: %s %02x %s size: 0x%010Lx not assigned\n",
+                      "ERROR: %s %02lx %s size: 0x%010Lx not assigned\n",
                       dev_path(dev), resource->index, resource_type(resource),
                       resource->size);
                return;
@@ -101,7 +101,7 @@
        } else if (resource->flags & IORESOURCE_IRQ) {
                pnp_set_irq(dev, resource->index, resource->base);
        } else {
-               printk(BIOS_ERR, "ERROR: %s %02x unknown resource type\n",
+               printk(BIOS_ERR, "ERROR: %s %02lx unknown resource type\n",
                       dev_path(dev), resource->index);
                return;
        }

Modified: LinuxBIOSv3/lib/elfboot.c
===================================================================
--- LinuxBIOSv3/lib/elfboot.c   2007-08-10 13:48:59 UTC (rev 465)
+++ LinuxBIOSv3/lib/elfboot.c   2007-08-11 18:38:24 UTC (rev 466)
@@ -36,14 +36,14 @@
 #include <elf_boot.h>
 
 static int valid_area(struct lb_memory *mem, 
-       unsigned long start, unsigned long len)
+       u64 start, u64 len)
 {
        /* Check through all of the memory segments and ensure
         * the segment that was passed in is completely contained
         * in RAM.
         */
        int i;
-       unsigned long end = start + len;
+       u64 end = start + len;
        unsigned long mem_entries = (mem->size - 
sizeof(*mem))/sizeof(mem->map[0]);
 
        /* Walk through the table of valid memory ranges and see if I
@@ -61,7 +61,7 @@
        }
        if (i == mem_entries) {
                printk(BIOS_ERR, "No matching RAM area found for range:\n");
-               printk(BIOS_ERR, "  [0x%016lx, 0x%016lx)\n", start, end);
+               printk(BIOS_ERR, "  [0x%016Lx, 0x%016Lx)\n", start, end);
                printk(BIOS_ERR, "RAM areas\n");
                for(i = 0; i < mem_entries; i++) {
                        u64 mstart, mend;
@@ -69,10 +69,8 @@
                        mtype = mem->map[i].type;
                        mstart = unpack_lb64(mem->map[i].start);
                        mend = mstart + unpack_lb64(mem->map[i].size);
-                       printk(BIOS_ERR, "  [0x%016lx, 0x%016lx) %s\n",
-                               (unsigned long)mstart, 
-                               (unsigned long)mend, 
-                               (mtype == LB_MEM_RAM)?"RAM":"Reserved");
+                       printk(BIOS_ERR, "  [0x%016Lx, 0x%016Lx) %s\n",
+                               mstart, mend, (mtype == 
LB_MEM_RAM)?"RAM":"Reserved");
                        
                }
                return 0;
@@ -101,14 +99,14 @@
                        printk(BIOS_DEBUG, "Dropping empty segment\n");
                        continue;
                }
-               printk(BIOS_DEBUG, "New segment addr 0x%lx size 0x%lx offset 
0x%lx filesize 0x%lx\n",
+               printk(BIOS_DEBUG, "New segment addr 0x%x size 0x%x offset 0x%x 
filesize 0x%x\n",
                        phdr[i].p_paddr, phdr[i].p_memsz, phdr[i].p_offset, 
phdr[i].p_filesz);
                /* Clean up the values */
                size = phdr[i].p_filesz;
                if (phdr[i].p_filesz > phdr[i].p_memsz)  {
                        size = phdr[i].p_memsz;
                }
-               printk(BIOS_DEBUG, "(cleaned up) New segment addr 0x%lx size 
0x%lx offset 0x%lx\n",
+               printk(BIOS_DEBUG, "(cleaned up) New segment addr 0x%x size 
0x%x offset 0x%x\n",
                        phdr[i].p_paddr, size, phdr[i].p_offset);
 
                /* Verify the memory addresses in the segment are valid */
@@ -150,7 +148,7 @@
        /* what the hell is boot_successful? */
        //boot_successful();
 
-       printk(BIOS_DEBUG, "Jumping to boot code at 0x%x\n", entry);
+       printk(BIOS_DEBUG, "Jumping to boot code at %p\n", entry);
        post_code(0xfe);
 
        /* Jump to kernel */

Modified: LinuxBIOSv3/northbridge/intel/i440bxemulation/i440bx.c
===================================================================
--- LinuxBIOSv3/northbridge/intel/i440bxemulation/i440bx.c      2007-08-10 
13:48:59 UTC (rev 465)
+++ LinuxBIOSv3/northbridge/intel/i440bxemulation/i440bx.c      2007-08-11 
18:38:24 UTC (rev 466)
@@ -79,7 +79,7 @@
        resource->size = ((resource_t) sizek) << 10;
        resource->flags = IORESOURCE_MEM | IORESOURCE_CACHEABLE |
            IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED;
-       printk(BIOS_DEBUG, "%s: add ram resoource %d bytes\n", __func__,
+       printk(BIOS_DEBUG, "%s: add ram resoource %Ld bytes\n", __func__,
               resource->size);
 }
 

Modified: LinuxBIOSv3/superio/winbond/w83627hf/superio.c
===================================================================
--- LinuxBIOSv3/superio/winbond/w83627hf/superio.c      2007-08-10 13:48:59 UTC 
(rev 465)
+++ LinuxBIOSv3/superio/winbond/w83627hf/superio.c      2007-08-11 18:38:24 UTC 
(rev 466)
@@ -45,13 +45,13 @@
         outb(0xaa, dev->path.u.pnp.port);
 }
 
-static void pnp_write_index(unsigned long port_base, u8 reg, u8 value)
+static void pnp_write_index(u16 port_base, u8 reg, u8 value)
 {
         outb(reg, port_base);
         outb(value, port_base + 1);
 }
 
-static u8 pnp_read_index(unsigned long port_base, u8 reg)
+static u8 pnp_read_index(u16 port_base, u8 reg)
 {
         outb(reg, port_base);
         return inb(port_base + 1);
@@ -83,7 +83,7 @@
         pnp_exit_ext_func_mode(dev);  
 }
 
-static void init_hwm(unsigned long base)
+static void init_hwm(u16 base)
 {
        u8  reg, value;
        int i;

Modified: LinuxBIOSv3/util/x86emu/vm86.c
===================================================================
--- LinuxBIOSv3/util/x86emu/vm86.c      2007-08-10 13:48:59 UTC (rev 465)
+++ LinuxBIOSv3/util/x86emu/vm86.c      2007-08-11 18:38:24 UTC (rev 466)
@@ -543,14 +543,14 @@
                      eax, ebx, ecx, edx);
        printk(BIOS_DEBUG, "biosint: ebp 0x%lx esp 0x%lx edi 0x%lx esi 0x%lx\n",
                     ebp, esp, edi, esi);
-       printk(BIOS_DEBUG, "biosint:  ip 0x%x   cs 0x%x  flags 0x%x\n",
+       printk(BIOS_DEBUG, "biosint:  ip 0x%lx   cs 0x%lx  flags 0x%lx\n",
                     ip, cs, flags);
 
        // cases in a good compiler are just as good as your own tables. 
        switch (intnumber) {
        case 0 ... 15:
                // These are not BIOS service, but the CPU-generated exceptions
-               printk(BIOS_INFO, "biosint: Oops, exception %u\n", intnumber);
+               printk(BIOS_INFO, "biosint: Oops, exception %lu\n", intnumber);
                if (esp < 0x1000) {
                        printk(BIOS_DEBUG, "Stack contents: ");
                        while (esp < 0x1000) {
@@ -578,7 +578,7 @@
                                &ebx, &edx, &ecx, &eax, &flags);
                break;
        default:
-               printk(BIOS_INFO, "BIOSINT: Unsupport int #0x%x\n", 
+               printk(BIOS_INFO, "BIOSINT: Unsupport int #0x%lx\n", 
                            intnumber);
                break;
        }


-- 
linuxbios mailing list
[email protected]
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to