summaryrefslogtreecommitdiff
path: root/sys/kern/kern_malloc.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-02-09 20:56:36 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-02-09 20:56:36 +0000
commitad03c03bcca73d79a2dda4f17e6a4cde6117094f (patch)
treeeaf574e6650e0838692e2d7f1d8fb1b0b63e42a0 /sys/kern/kern_malloc.c
parentafb845ac48481b9c6e6b3d43d8169de7f11b1bee (diff)
Add explicit __attribute__ ((__format__(__kprintf__)))) to the functions and
function pointer arguments which are {used as,} wrappers around the kernel printf function. No functional change.
Diffstat (limited to 'sys/kern/kern_malloc.c')
-rw-r--r--sys/kern/kern_malloc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index bd5ce1f38b6..3873e20c03a 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.92 2012/03/30 23:03:42 pirofti Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.93 2013/02/09 20:56:35 miod Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
@@ -328,11 +328,11 @@ malloc(unsigned long size, int type, int flags)
vm_map_unlock(kmem_map);
if (!rv) {
- printf("%s %d of object %p size 0x%lx %s %s"
+ printf("%s %zd of object %p size 0x%lx %s %s"
" (invalid addr %p)\n",
"Data modified on freelist: word",
(int32_t *)&kbp->kb_next - (int32_t *)kbp, va, size,
- "previous type", savedtype, addr);
+ "previous type", savedtype, (void *)addr);
kbp->kb_next = NULL;
}
}
@@ -355,7 +355,7 @@ malloc(unsigned long size, int type, int flags)
for (lp = (int32_t *)va; lp < end; lp++) {
if (*lp == WEIRD_ADDR)
continue;
- printf("%s %d of object %p size 0x%lx %s %s"
+ printf("%s %zd of object %p size 0x%lx %s %s"
" (0x%x != 0x%x)\n",
"Data modified on freelist: word",
lp - (int32_t *)va, va, size,
@@ -710,7 +710,8 @@ malloc_roundup(size_t sz)
#include <ddb/db_output.h>
void
-malloc_printit(int (*pr)(const char *, ...))
+malloc_printit(
+ int (*pr)(const char *, ...) __attribute__((__format__(__kprintf__,1,2))))
{
#ifdef KMEMSTATS
struct kmemstats *km;