From nobody Wed Apr 27 18:47:54 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 529CF1991D5C; Wed, 27 Apr 2022 18:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KpSRv1rlLz3Blk; Wed, 27 Apr 2022 18:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651085275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wq6KehbIfnSQXwUsalHrjFp2miTBAC6v1meusJPouM=; b=ayHpZ6xEZQxVCw7EMZobyFks0Q59zkzHD1BlpJkPMGV0Jman0JcKfjf2yJe8a0ebBCtnTO SDn8/GzoEGoaSE1O1aim7pQluwgo4a7RWQson+vD+e9+VqcmlrmNFBrVIwcKIDLENAxLsR /Z3lWwYtQ6wm1zo782Gllf2KlYGpVDByi2MHn5+lqwoIVf2OjbSMCpI+d+C7lCB+b6tIew d7KIMS4D0iSEyFvTgpBaZtw51sSYHBeiiukXQPfPPS7j1MqvTDzBskleETeVlG7z9WIi5l 6Qvel5c6toeIjYL7RCuBimMPKfKnpv8pBAnAk/EHxpPSgB0bpudygp2og33Bag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14FDA11B5; Wed, 27 Apr 2022 18:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23RIlsOv093271; Wed, 27 Apr 2022 18:47:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23RIlsBb093270; Wed, 27 Apr 2022 18:47:54 GMT (envelope-from git) Date: Wed, 27 Apr 2022 18:47:54 GMT Message-Id: <202204271847.23RIlsBb093270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1431239494ee - main - Add a __witness_used for variables only used under #ifdef WITNESS. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1431239494ee15e7175474ddd562c5dec11e7c73 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651085275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wq6KehbIfnSQXwUsalHrjFp2miTBAC6v1meusJPouM=; b=q6YwfEFGSqjn1W8tqEAg8nfO98454FyMkJwq9obLFxhpK+GcuAXvPkiSUxR6oGKyxemrQv C76GFtLg7qLBmSGB6GXX83xqr1tdxRaRM/WQcettgfaHSj85jSsniXzQgB1ehNfUJpPezT X76WRAHVHaDtLd73DCRBGuQKGLo/bw0DOqa0b14oC1khFuve3I4E797jNV8XufBozcrzce jM/CCfK9IW0XvfdC1NX+dimTEBUQTp5WhB6pTk8TbiJ+UUEfXtPzIaYcgHc10BJ81tjODZ +vH2mgEWnh4+u6e/yBTCmTTDerUUb2PRfqzLitp91400Plb3ft/ACl8issENLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651085275; a=rsa-sha256; cv=none; b=dYQEXHYY1c8hO6l9h2LUaJTP424YGKvAF86lpe2nS0R7Gx7GxQ1FN7snXDagxnWWhwndwP Fl3N3Nsb84CvDmh2/lEiBh1W8zR/UWzxBbxL15ygxa82Frz0s184B1BN0Ftg60mco0LyEr McmoZ7+RSPQrn95WVDw/Z4WOu5CAbCuAHhWKsNLM7aSBhspPQFv8PAf1jrqgC4CfXjDLnV w66N0ZexPw2mQ2X0z5ix+y5sHPQmpdtpwnEQX+FhCabvrq+nGoisPd/0S+p7eqRfBL39re nfg5j1riZZm+Nc4QQg5JnibKf3WaUu0rY807wa0DpcE7SVPHf3XlJkQ5QuHLXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1431239494ee15e7175474ddd562c5dec11e7c73 commit 1431239494ee15e7175474ddd562c5dec11e7c73 Author: John Baldwin AuthorDate: 2022-04-27 18:46:16 +0000 Commit: John Baldwin CommitDate: 2022-04-27 18:46:16 +0000 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 --- sys/kern/vfs_lookup.c | 6 +++--- sys/sys/systm.h | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b1eae2a73859..cfaa12cfa8b9 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -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); } diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 6ca9ee886562..043f347ac0d6 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -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))) +#ifdef INVARIANTS +#define __diagused +#else #define __diagused __unused +#endif + +#ifdef WITNESS +#define __witness_used #else -#define __diagused +#define __witness_used __unused #endif #endif /* _KERNEL */