Add a __witness_used for variables only used under #ifdef WITNESS.
__diagused is now solely used for variables only used under INVARIANTS. Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D35085
This commit is contained in:
parent
e140d551b7
commit
1431239494
@ -98,8 +98,8 @@ crossmp_vop_lock1(struct vop_lock1_args *ap)
|
||||
{
|
||||
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 @@ crossmp_vop_lock1(struct vop_lock1_args *ap)
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -554,13 +554,16 @@ void _gone_in_dev(device_t dev, int major, const char *msg);
|
||||
#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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user