summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsf <sf@openbsd.org>2014-06-15 11:43:24 +0000
committersf <sf@openbsd.org>2014-06-15 11:43:24 +0000
commit2f436acaf52cf41aa7ea1ab156cc11d974d48456 (patch)
treeb7876975c7cebd7d14cdc9e2d96b273165980b4d
parentFix hang with virtio event_idx feature (diff)
downloadwireguard-openbsd-2f436acaf52cf41aa7ea1ab156cc11d974d48456.tar.xz
wireguard-openbsd-2f436acaf52cf41aa7ea1ab156cc11d974d48456.zip
Fix a few format string bugs with -DDEBUG
-rw-r--r--sys/arch/amd64/amd64/disksubr.c4
-rw-r--r--sys/arch/amd64/amd64/machdep.c4
-rw-r--r--sys/arch/amd64/amd64/pmap.c4
-rw-r--r--sys/arch/amd64/amd64/trap.c6
-rw-r--r--sys/arch/i386/i386/disksubr.c4
-rw-r--r--sys/arch/i386/i386/machdep.c6
-rw-r--r--sys/dev/isa/fd.c4
-rw-r--r--sys/dev/pci/amas.c4
-rw-r--r--sys/kern/dma_alloc.c4
-rw-r--r--sys/kern/init_main.c6
-rw-r--r--sys/nfs/nfs_kq.c4
11 files changed, 25 insertions, 25 deletions
diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c
index b90d5da342e..e2f1c1a5e61 100644
--- a/sys/arch/amd64/amd64/disksubr.c
+++ b/sys/arch/amd64/amd64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.65 2013/10/19 09:32:12 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.66 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -76,7 +76,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
RAW_PART));
if (pdi != NULL && pdi->bios_heads > 0 && pdi->bios_sectors > 0) {
#ifdef DEBUG
- printf("Disk GEOM %u/%u/%u -> BIOS GEOM %u/%u/%u\n",
+ printf("Disk GEOM %u/%u/%u -> BIOS GEOM %u/%u/%llu\n",
lp->d_ntracks, lp->d_nsectors, lp->d_ncylinders,
pdi->bios_heads, pdi->bios_sectors,
DL_GETDSIZE(lp) / (pdi->bios_heads * pdi->bios_sectors));
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index b4fb77e2ab3..77c1a645824 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.179 2014/05/31 15:49:28 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.180 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -616,7 +616,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type,
#ifdef DEBUG
if ((sigdebug & SDB_FOLLOW) && (!sigpid || p->p_pid == sigpid))
- printf("sendsig(%d): pc 0x%x, catcher 0x%x\n", p->p_pid,
+ printf("sendsig(%d): pc 0x%llx, catcher 0x%llx\n", p->p_pid,
tf->tf_rip, tf->tf_rax);
#endif
}
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index b35066d202f..da0e70b754e 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.69 2014/03/27 10:24:40 dlg Exp $ */
+/* $OpenBSD: pmap.c,v 1.70 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
@@ -2379,7 +2379,7 @@ pmap_dump(struct pmap *pmap, vaddr_t sva, vaddr_t eva)
for (/* null */; sva < blkendva ; sva += PAGE_SIZE, pte++) {
if (!pmap_valid_entry(*pte))
continue;
- printf("va %#lx -> pa %#lx (pte=%#lx)\n",
+ printf("va %#lx -> pa %#llx (pte=%#llx)\n",
sva, *pte, *pte & PG_FRAME);
}
}
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index 590f68c01cb..5c336f7704a 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.39 2014/05/11 00:12:43 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.40 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@@ -162,8 +162,8 @@ trap(struct trapframe *frame)
#ifdef DEBUG
if (trapdebug) {
- printf("trap %d code %lx rip %lx cs %lx rflags %lx cr2 %lx "
- "cpl %x\n",
+ printf("trap %d code %llx rip %llx cs %llx rflags %llx "
+ "cr2 %llx cpl %x\n",
type, frame->tf_err, frame->tf_rip, frame->tf_cs,
frame->tf_rflags, rcr2(), curcpu()->ci_ilevel);
printf("curproc %p\n", curproc);
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index 8d0ce0c37b0..6da9f77a7bd 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.105 2013/10/19 09:32:13 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.106 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -78,7 +78,7 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
RAW_PART));
if (pdi != NULL && pdi->bios_heads > 0 && pdi->bios_sectors > 0) {
#ifdef DEBUG
- printf("Disk GEOM %u/%u/%u -> BIOS GEOM %u/%u/%u\n",
+ printf("Disk GEOM %u/%u/%u -> BIOS GEOM %u/%u/%llu\n",
lp->d_ntracks, lp->d_nsectors, lp->d_ncylinders,
pdi->bios_heads, pdi->bios_sectors,
DL_GETDSIZE(lp) / (pdi->bios_heads * pdi->bios_sectors));
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index fe8df0f45bb..502895f4e36 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.538 2014/05/31 15:49:28 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.539 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -3301,7 +3301,7 @@ init386(paddr_t first_avail)
if (kb > atop(IOM_END)) {
paddr_t lim = atop(IOM_END);
#ifdef DEBUG
- printf(" %x-%x (<16M)", lim, kb);
+ printf(" %lx-%x (<16M)", lim, kb);
#endif
uvm_page_physload(lim, kb, lim, kb, 0);
}
@@ -3318,7 +3318,7 @@ init386(paddr_t first_avail)
if (a < e) {
#ifdef DEBUG
- printf(" %x-%x", a, e);
+ printf(" %lx-%lx", a, e);
#endif
uvm_page_physload(a, e, a, e, 0);
}
diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c
index 496249126f3..7527427742a 100644
--- a/sys/dev/isa/fd.c
+++ b/sys/dev/isa/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.98 2013/12/28 03:39:16 deraadt Exp $ */
+/* $OpenBSD: fd.c,v 1.99 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: fd.c,v 1.90 1996/05/12 23:12:03 mycroft Exp $ */
/*-
@@ -1105,7 +1105,7 @@ fdformat(dev_t dev, struct fd_formb *finfo, struct proc *p)
bp->b_data = (caddr_t)finfo;
#ifdef DEBUG
- printf("fdformat: blkno %x count %x\n", bp->b_blkno, bp->b_bcount);
+ printf("fdformat: blkno %llx count %lx\n", bp->b_blkno, bp->b_bcount);
#endif
/* now do the format */
diff --git a/sys/dev/pci/amas.c b/sys/dev/pci/amas.c
index a1eeb8decb0..98658f73e41 100644
--- a/sys/dev/pci/amas.c
+++ b/sys/dev/pci/amas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amas.c,v 1.4 2009/05/07 22:25:31 ariane Exp $ */
+/* $OpenBSD: amas.c,v 1.5 2014/06/15 11:43:24 sf Exp $ */
/*
* Copyright (c) 2009 Ariane van der Steldt <ariane@stack.nl>
@@ -183,7 +183,7 @@ amas_attach(struct device *parent, struct device *self, void *aux)
amas_get_pagerange(amas, i, &start_pg, &end_pg);
if (!(start_pg == 0 && end_pg == 0))
- printf(" [%p, %p]", start_pg, end_pg);
+ printf(" [%#lx, %#lx]", start_pg, end_pg);
}
}
#endif /* DEBUG */
diff --git a/sys/kern/dma_alloc.c b/sys/kern/dma_alloc.c
index 599dc862f0c..3892bed5676 100644
--- a/sys/kern/dma_alloc.c
+++ b/sys/kern/dma_alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dma_alloc.c,v 1.10 2014/03/28 17:57:11 mpi Exp $ */
+/* $OpenBSD: dma_alloc.c,v 1.11 2014/06/15 11:43:24 sf Exp $ */
/*
* Copyright (c) 2010 Theo de Raadt <deraadt@openbsd.org>
@@ -54,7 +54,7 @@ dma_alloc_index(size_t sz)
if (sz <= (1 << (b + DMA_BUCKET_OFFSET)))
return (b);
#ifdef DEBUG
- printf("dma_alloc/free: object %d too large\n", sz);
+ printf("dma_alloc/free: object %zd too large\n", sz);
#endif
return (-1);
}
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index fba69020a84..41a9116f707 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.213 2014/05/15 03:52:25 guenther Exp $ */
+/* $OpenBSD: init_main.c,v 1.214 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -654,7 +654,7 @@ start_init(void *arg)
*flagsp++ = '\0';
i = flagsp - flags;
#ifdef DEBUG
- printf("init: copying out flags `%s' %d\n", flags, i);
+ printf("init: copying out flags `%s' %ld\n", flags, i);
#endif
#ifdef MACHINE_STACK_GROWS_UP
arg1 = ucp;
@@ -671,7 +671,7 @@ start_init(void *arg)
*/
i = strlen(path) + 1;
#ifdef DEBUG
- printf("init: copying out path `%s' %d\n", path, i);
+ printf("init: copying out path `%s' %ld\n", path, i);
#endif
#ifdef MACHINE_STACK_GROWS_UP
arg0 = ucp;
diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c
index 39c947f37c3..a3035d4c9b8 100644
--- a/sys/nfs/nfs_kq.c
+++ b/sys/nfs/nfs_kq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_kq.c,v 1.17 2014/03/28 17:57:11 mpi Exp $ */
+/* $OpenBSD: nfs_kq.c,v 1.18 2014/06/15 11:43:24 sf Exp $ */
/* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */
/*-
@@ -230,7 +230,7 @@ filt_nfsread(struct knote *kn, long hint)
kn->kn_data = np->n_size - kn->kn_fp->f_offset;
#ifdef DEBUG
- printf("nfsread event. %d\n", kn->kn_data);
+ printf("nfsread event. %lld\n", kn->kn_data);
#endif
return (kn->kn_data != 0);
}