Make kassert_printf use __printflike.

Fix associated errors/warnings while I'm here.

Requested by: avg
This commit is contained in:
alfred 2013-07-07 21:39:37 +00:00
parent 229a41531c
commit 89aac2b3a1
4 changed files with 10 additions and 6 deletions

View File

@ -1138,12 +1138,16 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
iclass = LOCK_CLASS(interlock); iclass = LOCK_CLASS(interlock);
lock1 = find_instance(lock_list, interlock); lock1 = find_instance(lock_list, interlock);
if (lock1 == NULL) if (lock1 == NULL)
kassert_panic("interlock (%s) %s not locked @ %s:%d", kassert_panic(
"interlock (%s) %s not locked while locking"
" %s @ %s:%d",
iclass->lc_name, interlock->lo_name, iclass->lc_name, interlock->lo_name,
flags & LOP_EXCLUSIVE ? "exclusive" : "shared", flags & LOP_EXCLUSIVE ? "exclusive" : "shared",
fixup_filename(file), line); fixup_filename(file), line);
else if ((lock1->li_flags & LI_RECURSEMASK) != 0) else if ((lock1->li_flags & LI_RECURSEMASK) != 0)
kassert_panic("interlock (%s) %s recursed @ %s:%d", kassert_panic(
"interlock (%s) %s recursed while locking %s"
" @ %s:%d",
iclass->lc_name, interlock->lo_name, iclass->lc_name, interlock->lo_name,
flags & LOP_EXCLUSIVE ? "exclusive" : "shared", flags & LOP_EXCLUSIVE ? "exclusive" : "shared",
fixup_filename(file), line); fixup_filename(file), line);

View File

@ -4485,8 +4485,8 @@ bdata2bio(struct buf *bp, struct bio *bip)
bip->bio_flags |= BIO_UNMAPPED; bip->bio_flags |= BIO_UNMAPPED;
KASSERT(round_page(bip->bio_ma_offset + bip->bio_length) / KASSERT(round_page(bip->bio_ma_offset + bip->bio_length) /
PAGE_SIZE == bp->b_npages, PAGE_SIZE == bp->b_npages,
("Buffer %p too short: %d %d %d", bp, bip->bio_ma_offset, ("Buffer %p too short: %d %lld %d", bp, bip->bio_ma_offset,
bip->bio_length, bip->bio_ma_n)); (long long)bip->bio_length, bip->bio_ma_n));
} else { } else {
bip->bio_data = bp->b_data; bip->bio_data = bp->b_data;
bip->bio_ma = NULL; bip->bio_ma = NULL;

View File

@ -1022,7 +1022,7 @@ ieee80211_mbuf_adjust(struct ieee80211vap *vap, int hdrsize,
return NULL; return NULL;
} }
KASSERT(needed_space <= MHLEN, KASSERT(needed_space <= MHLEN,
("not enough room, need %u got %zu\n", needed_space, MHLEN)); ("not enough room, need %u got %d\n", needed_space, MHLEN));
/* /*
* Setup new mbuf to have leading space to prepend the * Setup new mbuf to have leading space to prepend the
* 802.11 header and any crypto header bits that are * 802.11 header and any crypto header bits that are

View File

@ -74,7 +74,7 @@ extern int vm_guest; /* Running as virtual machine guest? */
enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN };
#if defined(WITNESS) || defined(INVARIANTS) #if defined(WITNESS) || defined(INVARIANTS)
void kassert_panic(const char *fmt, ...); void kassert_panic(const char *fmt, ...) __printflike(1, 2);
#endif #endif
#ifdef INVARIANTS /* The option is always available */ #ifdef INVARIANTS /* The option is always available */