Index: sys/kern/vfs_lookup.c =================================================================== --- sys/kern/vfs_lookup.c +++ sys/kern/vfs_lookup.c @@ -98,8 +98,8 @@ { struct vnode *vp; struct lock *lk __diagused; - const char *file __diagused; - int flags, line __diagused; + const char *file __witness_used; + int flags, line __witness_used; vp = ap->a_vp; lk = vp->v_vnlock; @@ -115,7 +115,7 @@ WITNESS_LOCK(&lk->lock_object, 0, file, line); if ((flags & LK_INTERLOCK) != 0) VI_UNLOCK(vp); - LOCK_LOG_LOCK("SLOCK", &lk->lock_object, 0, 0, ap->a_file, line); + LOCK_LOG_LOCK("SLOCK", &lk->lock_object, 0, 0, ap->a_file, ap->a_line); return (0); } Index: sys/sys/systm.h =================================================================== --- sys/sys/systm.h +++ sys/sys/systm.h @@ -554,13 +554,16 @@ #define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg) #define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg) -#if !defined(INVARIANTS) && !defined(WITNESS) -#define __diagused __unused -#elif ((defined(INVARIANTS) && !defined(WITNESS)) || \ - (!defined(INVARIANTS) && defined(WITNESS))) -#define __diagused __unused -#else +#ifdef INVARIANTS #define __diagused +#else +#define __diagused __unused +#endif + +#ifdef WITNESS +#define __witness_used +#else +#define __witness_used __unused #endif #endif /* _KERNEL */