svn commit: r253007 - in head/sys: kern net80211 sys

Alfred Perlstein alfred at FreeBSD.org
Sun Jul 7 21:39:38 UTC 2013


Author: alfred
Date: Sun Jul  7 21:39:37 2013
New Revision: 253007
URL: http://svnweb.freebsd.org/changeset/base/253007

Log:
  Make kassert_printf use __printflike.
  
  Fix associated errors/warnings while I'm here.
  
  Requested by: avg

Modified:
  head/sys/kern/subr_witness.c
  head/sys/kern/vfs_bio.c
  head/sys/net80211/ieee80211_output.c
  head/sys/sys/systm.h

Modified: head/sys/kern/subr_witness.c
==============================================================================
--- head/sys/kern/subr_witness.c	Sun Jul  7 21:23:58 2013	(r253006)
+++ head/sys/kern/subr_witness.c	Sun Jul  7 21:39:37 2013	(r253007)
@@ -1138,12 +1138,16 @@ witness_checkorder(struct lock_object *l
 		iclass = LOCK_CLASS(interlock);
 		lock1 = find_instance(lock_list, interlock);
 		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,
 			    flags & LOP_EXCLUSIVE ? "exclusive" : "shared",
 			    fixup_filename(file), line);
 		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,
 			    flags & LOP_EXCLUSIVE ? "exclusive" : "shared",
 			    fixup_filename(file), line);

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Sun Jul  7 21:23:58 2013	(r253006)
+++ head/sys/kern/vfs_bio.c	Sun Jul  7 21:39:37 2013	(r253007)
@@ -4485,8 +4485,8 @@ bdata2bio(struct buf *bp, struct bio *bi
 		bip->bio_flags |= BIO_UNMAPPED;
 		KASSERT(round_page(bip->bio_ma_offset + bip->bio_length) /
 		    PAGE_SIZE == bp->b_npages,
-		    ("Buffer %p too short: %d %d %d", bp, bip->bio_ma_offset,
-		    bip->bio_length, bip->bio_ma_n));
+		    ("Buffer %p too short: %d %lld %d", bp, bip->bio_ma_offset,
+		    (long long)bip->bio_length, bip->bio_ma_n));
 	} else {
 		bip->bio_data = bp->b_data;
 		bip->bio_ma = NULL;

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Sun Jul  7 21:23:58 2013	(r253006)
+++ head/sys/net80211/ieee80211_output.c	Sun Jul  7 21:39:37 2013	(r253007)
@@ -1022,7 +1022,7 @@ ieee80211_mbuf_adjust(struct ieee80211va
 			return NULL;
 		}
 		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
 		 * 802.11 header and any crypto header bits that are

Modified: head/sys/sys/systm.h
==============================================================================
--- head/sys/sys/systm.h	Sun Jul  7 21:23:58 2013	(r253006)
+++ head/sys/sys/systm.h	Sun Jul  7 21:39:37 2013	(r253007)
@@ -74,7 +74,7 @@ extern int vm_guest;		/* Running as virt
 enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN };
 
 #if defined(WITNESS) || defined(INVARIANTS)
-void	kassert_panic(const char *fmt, ...);
+void	kassert_panic(const char *fmt, ...)  __printflike(1, 2);
 #endif
 
 #ifdef	INVARIANTS		/* The option is always available */


More information about the svn-src-head mailing list