From: sf Date: Sun, 4 May 2014 20:09:15 +0000 (+0000) Subject: format string fixes for bus_addr_t and bus_size_t X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ffe7c397699ec6d03f9c1e7cecb9327687153899;p=openbsd format string fixes for bus_addr_t and bus_size_t bus_addr_t and bus_size_t are u_long everywhere ok kettenis@ --- diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c index 0f544b6b451..d625768a5d2 100644 --- a/sys/arch/amd64/amd64/bus_dma.c +++ b/sys/arch/amd64/amd64/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.42 2014/04/01 09:05:03 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.43 2014/05/04 20:09:15 sf Exp $ */ /* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -332,7 +332,7 @@ _bus_dmamap_load_raw(bus_dma_tag_t t, bus_dmamap_t map, bus_dma_segment_t *segs, sgsize = plen; if (paddr > dma_constraint.ucr_high) - panic("Non dma-reachable buffer at paddr %p(raw)", + panic("Non dma-reachable buffer at paddr %#lx(raw)", paddr); /* @@ -595,7 +595,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, pmap_extract(pmap, vaddr, (paddr_t *)&curaddr); if (curaddr > dma_constraint.ucr_high) - panic("Non dma-reachable buffer at curaddr %p(raw)", + panic("Non dma-reachable buffer at curaddr %#lx(raw)", curaddr); /* diff --git a/sys/arch/i386/pci/pci_addr_fixup.c b/sys/arch/i386/pci/pci_addr_fixup.c index 96dd3060f62..1757109c31e 100644 --- a/sys/arch/i386/pci/pci_addr_fixup.c +++ b/sys/arch/i386/pci/pci_addr_fixup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_addr_fixup.c,v 1.24 2013/10/02 21:06:17 sf Exp $ */ +/* $OpenBSD: pci_addr_fixup.c,v 1.25 2014/05/04 20:09:15 sf Exp $ */ /* $NetBSD: pci_addr_fixup.c,v 1.7 2000/08/03 20:10:45 nathanw Exp $ */ /*- @@ -137,7 +137,7 @@ pci_addr_fixup(struct pcibios_softc *sc, pci_chipset_tag_t pc, int maxbus) sc->mem_alloc_start = (start + 0x100000 + 1) & ~(0x100000 - 1); sc->port_alloc_start = PCIADDR_ISAPORT_RESERVE; PCIBIOS_PRINTV((" Physical memory end: 0x%08lx\n PCI memory mapped I/O " - "space start: 0x%08x\n", avail_end, sc->mem_alloc_start)); + "space start: 0x%08lx\n", avail_end, sc->mem_alloc_start)); /* * 4. do fixup @@ -298,10 +298,10 @@ pciaddr_do_resource_allocate(struct pcibios_softc *sc, pci_chipset_tag_t pc, if (pciaddr_ioaddr(pci_conf_read(pc, tag, mapreg)) != *addr) { pci_conf_write(pc, tag, mapreg, 0); /* clear */ - PCIBIOS_PRINTV(("fixup failed. (new address=%#x)\n", *addr)); + PCIBIOS_PRINTV(("fixup failed. (new address=%#lx)\n", *addr)); return (1); } - PCIBIOS_PRINTV(("new address 0x%08x\n", *addr)); + PCIBIOS_PRINTV(("new address 0x%08lx\n", *addr)); return (0); } @@ -354,7 +354,7 @@ pciaddr_do_resource_reserve_disabled(struct pcibios_softc *sc, (val & PCI_COMMAND_IO_ENABLE) == PCI_COMMAND_IO_ENABLE) return (0); - PCIBIOS_PRINTV(("disabled %s space at addr 0x%lx size 0x%x\n", + PCIBIOS_PRINTV(("disabled %s space at addr 0x%lx size 0x%lx\n", type == PCI_MAPREG_TYPE_MEM ? "mem" : "io", *addr, size)); error = extent_alloc_region(ex, *addr, size, EX_NOWAIT | EX_MALLOCOK); diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index 05a52d3c6be..cb8412eec15 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfi.c,v 1.151 2014/02/20 11:13:44 kettenis Exp $ */ +/* $OpenBSD: mfi.c,v 1.152 2014/05/04 20:09:15 sf Exp $ */ /* * Copyright (c) 2006 Marco Peereboom * @@ -733,7 +733,7 @@ mfi_attach(struct mfi_softc *sc, enum mfi_iop iop) } /* XXX hack, fix this */ if (MFIMEM_DVA(sc->sc_frames) & 0x3f) { - printf("%s: improper frame alignment (%#x) FIXME\n", + printf("%s: improper frame alignment (%#lx) FIXME\n", DEVNAME(sc), MFIMEM_DVA(sc->sc_frames)); goto noframe; } diff --git a/sys/dev/pci/bktr/bktr_core.c b/sys/dev/pci/bktr/bktr_core.c index 58cee989a0a..c518c28b94d 100644 --- a/sys/dev/pci/bktr/bktr_core.c +++ b/sys/dev/pci/bktr/bktr_core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bktr_core.c,v 1.32 2013/11/26 20:33:18 deraadt Exp $ */ +/* $OpenBSD: bktr_core.c,v 1.33 2014/05/04 20:09:15 sf Exp $ */ /* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.114 2000/10/31 13:09:56 roger Exp $ */ /* @@ -386,7 +386,7 @@ common_bktr_attach( bktr_ptr_t bktr, int unit, u_int pci_id, u_int rev ) buf = 0; if ( bootverbose ) { - printf("%s: buffer size %d, addr 0x%x\n", + printf("%s: buffer size %d, addr 0x%lx\n", bktr_name(bktr), BROOKTREE_ALLOC, bktr->dm_prog->dm_segs->ds_addr); } diff --git a/sys/dev/pci/gdt_pci.c b/sys/dev/pci/gdt_pci.c index 5441b56e244..87004b36c27 100644 --- a/sys/dev/pci/gdt_pci.c +++ b/sys/dev/pci/gdt_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_pci.c,v 1.22 2009/03/29 21:53:52 sthen Exp $ */ +/* $OpenBSD: gdt_pci.c,v 1.23 2014/05/04 20:09:15 sf Exp $ */ /* * Copyright (c) 1999, 2000 Niklas Hallqvist. All rights reserved. @@ -445,7 +445,7 @@ gdt_pci_attach(struct device *parent, struct device *self, void *aux) bus_space_write_4(dpmemt, dpmemh, GDT_MPR_IC, GDT_MPR_MAGIC); if (bus_space_read_4(dpmemt, dpmemh, GDT_MPR_IC) != GDT_MPR_MAGIC) { - printf("cannot access DPMEM at 0x%x (shadowed?)\n", + printf("cannot access DPMEM at 0x%lx (shadowed?)\n", dpmembase); goto bail_out; } diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index b217c8c54e9..80265afb75e 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.101 2013/12/06 21:03:04 deraadt Exp $ */ +/* $OpenBSD: pci.c,v 1.102 2014/05/04 20:09:15 sf Exp $ */ /* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */ /* @@ -846,7 +846,7 @@ pci_reserve_resources(struct pci_attach_args *pa) } if (pa->pa_memex && extent_alloc_region(pa->pa_memex, base, size, EX_NOWAIT)) { - printf("%d:%d:%d: mem address conflict 0x%x/0x%x\n", + printf("%d:%d:%d: mem address conflict 0x%lx/0x%lx\n", bus, dev, func, base, size); pci_conf_write(pc, tag, reg, 0); if (type & PCI_MAPREG_MEM_TYPE_64BIT) @@ -856,7 +856,7 @@ pci_reserve_resources(struct pci_attach_args *pa) case PCI_MAPREG_TYPE_IO: if (pa->pa_ioex && extent_alloc_region(pa->pa_ioex, base, size, EX_NOWAIT)) { - printf("%d:%d:%d: io address conflict 0x%x/0x%x\n", + printf("%d:%d:%d: io address conflict 0x%lx/0x%lx\n", bus, dev, func, base, size); pci_conf_write(pc, tag, reg, 0); } @@ -883,7 +883,7 @@ pci_reserve_resources(struct pci_attach_args *pa) size = 0; if (pa->pa_ioex && base > 0 && size > 0) { if (extent_alloc_region(pa->pa_ioex, base, size, EX_NOWAIT)) { - printf("%d:%d:%d: bridge io address conflict 0x%x/0x%x\n", + printf("%d:%d:%d: bridge io address conflict 0x%lx/0x%lx\n", bus, dev, func, base, size); blr &= 0xffff0000; blr |= 0x000000f0; @@ -901,7 +901,7 @@ pci_reserve_resources(struct pci_attach_args *pa) size = 0; if (pa->pa_memex && base > 0 && size > 0) { if (extent_alloc_region(pa->pa_memex, base, size, EX_NOWAIT)) { - printf("%d:%d:%d: bridge mem address conflict 0x%x/0x%x\n", + printf("%d:%d:%d: bridge mem address conflict 0x%lx/0x%lx\n", bus, dev, func, base, size); pci_conf_write(pc, tag, PPB_REG_MEM, 0x0000fff0); } @@ -917,13 +917,13 @@ pci_reserve_resources(struct pci_attach_args *pa) size = 0; if (pa->pa_pmemex && base > 0 && size > 0) { if (extent_alloc_region(pa->pa_pmemex, base, size, EX_NOWAIT)) { - printf("%d:%d:%d: bridge mem address conflict 0x%x/0x%x\n", + printf("%d:%d:%d: bridge mem address conflict 0x%lx/0x%lx\n", bus, dev, func, base, size); pci_conf_write(pc, tag, PPB_REG_PREFMEM, 0x0000fff0); } } else if (pa->pa_memex && base > 0 && size > 0) { if (extent_alloc_region(pa->pa_memex, base, size, EX_NOWAIT)) { - printf("%d:%d:%d: bridge mem address conflict 0x%x/0x%x\n", + printf("%d:%d:%d: bridge mem address conflict 0x%lx/0x%lx\n", bus, dev, func, base, size); pci_conf_write(pc, tag, PPB_REG_PREFMEM, 0x0000fff0); } diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c index abb20a84648..e9f765e6719 100644 --- a/sys/dev/pci/ubsec.c +++ b/sys/dev/pci/ubsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsec.c,v 1.156 2013/12/22 11:05:58 sf Exp $ */ +/* $OpenBSD: ubsec.c,v 1.157 2014/05/04 20:09:15 sf Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -2470,12 +2470,12 @@ ubsec_kprocess_rsapriv(struct ubsec_softc *sc, struct cryptkop *krp) #ifdef DIAGNOSTIC if (rp->rpr_msgin.dma_paddr & 3 || rp->rpr_msgin.dma_size & 3) { - panic("%s: rsapriv: invalid msgin %08x(0x%x)", + panic("%s: rsapriv: invalid msgin %08x(0x%lx)", sc->sc_dv.dv_xname, rp->rpr_msgin.dma_paddr, rp->rpr_msgin.dma_size); } if (rp->rpr_msgout.dma_paddr & 3 || rp->rpr_msgout.dma_size & 3) { - panic("%s: rsapriv: invalid msgout %08x(0x%x)", + panic("%s: rsapriv: invalid msgout %08x(0x%lx)", sc->sc_dv.dv_xname, rp->rpr_msgout.dma_paddr, rp->rpr_msgout.dma_size); } diff --git a/sys/dev/pcmcia/if_ep_pcmcia.c b/sys/dev/pcmcia/if_ep_pcmcia.c index a4136762d3c..dcc55a0dbf8 100644 --- a/sys/dev/pcmcia/if_ep_pcmcia.c +++ b/sys/dev/pcmcia/if_ep_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_pcmcia.c,v 1.42 2013/08/07 01:06:39 bluhm Exp $ */ +/* $OpenBSD: if_ep_pcmcia.c,v 1.43 2014/05/04 20:09:15 sf Exp $ */ /* $NetBSD: if_ep_pcmcia.c,v 1.16 1998/08/17 23:20:40 thorpej Exp $ */ /*- @@ -331,7 +331,7 @@ ep_pcmcia_attach(parent, self, aux) return; } - printf(" port 0x%lx/%d", psc->sc_pcioh.addr, psc->sc_pcioh.size); + printf(" port 0x%lx/%ld", psc->sc_pcioh.addr, psc->sc_pcioh.size); switch (pa->product) { case PCMCIA_PRODUCT_3COM_3C562: diff --git a/sys/dev/pcmcia/if_malo.c b/sys/dev/pcmcia/if_malo.c index 8d8afb6f555..2f9808994be 100644 --- a/sys/dev/pcmcia/if_malo.c +++ b/sys/dev/pcmcia/if_malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_malo.c,v 1.76 2013/12/06 21:03:04 deraadt Exp $ */ +/* $OpenBSD: if_malo.c,v 1.77 2014/05/04 20:09:15 sf Exp $ */ /* * Copyright (c) 2007 Marcus Glocker @@ -193,7 +193,7 @@ malo_pcmcia_attach(struct device *parent, struct device *self, void *aux) sc->sc_iot = psc->sc_pcioh.iot; sc->sc_ioh = psc->sc_pcioh.ioh; - printf(" port 0x%x/%d", psc->sc_pcioh.addr, psc->sc_pcioh.size); + printf(" port 0x%lx/%ld", psc->sc_pcioh.addr, psc->sc_pcioh.size); /* establish interrupt */ psc->sc_ih = pcmcia_intr_establish(psc->sc_pf, IPL_NET, cmalo_intr, sc,