From nobody Fri Jan 28 21:26:09 2022
X-Original-To: dev-commits-src-main@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 E5D0E198D0BC;
	Fri, 28 Jan 2022 21:26:09 +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 4Jlr9Y5gz3z3GXZ;
	Fri, 28 Jan 2022 21:26:09 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1643405169;
	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=7HV4Anf6g0mEy3bH048mXOnmrRC5upl5oJ3T5SYnWkk=;
	b=oWxR5W6VuDyCDWbPg3V93qZ+eeffwZFqyohZrQaNmUV46Hr0WJkA+9zYZ8yu0lcG28Bsdn
	7lMYXyA93QsX6q7y7bQ1ConCIXwJ3zdtlsf8cpaEHvg3UBeCB/YX5DobjLhw7R55ogTZqZ
	8PUuSxlFjtY8LEVzZnUPZNUqEr128ysGj1TnhV1g/chTgWvskfPcv34985wD5BVDCoDRLY
	wvrUqCiDi4DCXIxGgKmvC27R/3GaKDZvZBuhXISE60NrPWCV0TKT39stAdFx2l+Src9yFJ
	mvZu9f00ZUQP0P5GC34iQzmYE+yqCCgvq3jnqTPmtRm0qF6NKHwDD7ySLbXXRA==
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 9D3E71790;
	Fri, 28 Jan 2022 21:26:09 +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 20SLQ9ae029907;
	Fri, 28 Jan 2022 21:26:09 GMT
	(envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
	by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20SLQ977029906;
	Fri, 28 Jan 2022 21:26:09 GMT
	(envelope-from git)
Date: Fri, 28 Jan 2022 21:26:09 GMT
Message-Id: <202201282126.20SLQ977029906@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
        dev-commits-src-main@FreeBSD.org
From: John Baldwin <jhb@FreeBSD.org>
Subject: git: 29d481ae6a19 - main - Make <vm/vm_extern.h> more self-contained.
List-Id: Commit messages for the main branch of the src repository <dev-commits-src-main.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main
List-Help: <mailto:dev-commits-src-main+help@freebsd.org>
List-Post: <mailto:dev-commits-src-main@freebsd.org>
List-Subscribe: <mailto:dev-commits-src-main+subscribe@freebsd.org>
List-Unsubscribe: <mailto:dev-commits-src-main+unsubscribe@freebsd.org>
Sender: owner-dev-commits-src-main@freebsd.org
X-BeenThere: dev-commits-src-main@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: 29d481ae6a197d000527c317641bbccdb4305d72
Auto-Submitted: auto-generated
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1643405169;
	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=7HV4Anf6g0mEy3bH048mXOnmrRC5upl5oJ3T5SYnWkk=;
	b=fzYkDtKDhKMIr6TmEMgaFudce1vKwSAybxVgAw1okC4cjmKPW/9Gr04LHNjLQNr2wCn4bv
	aKNXibBnnLucS/7D5Eprd4VdVsPKgNYory/T9Iqj01RNBKuHs32dGV7d15X++JA8um7865
	4nQ8E38eR/fUZvv5zl6T3Qz/2Ibn48+RNl9mCWcJ/kQHExpRaBUHUHvmHFLl7cQRtvEtPl
	fYMXZcq6uTQ8KkRY3N1oGZ2ZIYtZjAL9V/2E/5gm/l+cWHvv5XYNorbGg5a4DtHsAoK6d9
	w2C61bQj6E+NEz+K9quzRZ8cvOV+KmuBGX2vlkqXdtcFln/GYzuzo39sRiEbhQ==
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643405169; a=rsa-sha256; cv=none;
	b=p1lekaZL3IaESQ4sa+jFbhVxotGSKavIqmDkoI+EWIKXZJnYZKtGWxNidGpAJatSoVyv0n
	lbc7auFMIdOp+jLUDbsSBhZn0T73s40JB1Gs71EyF2xoiGI7B5nWIkxEHZlp6Z0e7IeXT5
	1nY7jiYGFcPyV3hCE4+vceY1MOsa4zPrdVStr+Yfj7c0/FghV+/BJoFUKC7ICkkVRDqvWU
	CYulxCAvcgXMgmMXJYv+bF9jU95rOVFWxaNlx2dDSMGHg081mPPeErdDNRXFP65IP23UD/
	IpAdex+bFSPY66S+Xre8oIkXB11ZsH0QwrnWIGwf4rbzPN1GPJncH4ayTnniXQ==
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=29d481ae6a197d000527c317641bbccdb4305d72

commit 29d481ae6a197d000527c317641bbccdb4305d72
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-01-28 21:14:03 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-01-28 21:14:03 +0000

    Make <vm/vm_extern.h> more self-contained.
    
    Add a nested include of <sys/systm.h> for recently added assertions.
    Without this, existing code (such as in drm-kmod) needs to be patched
    to add the newly required header.
    
    While here, rewrite the assertions using KASSERT().
    
    Reviewed by:    dougm, alc, imp, kib
    Differential Revision:  https://reviews.freebsd.org/D34070
---
 sys/vm/vm_extern.h | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h
index 9fac3403f787..ce733b92c87e 100644
--- a/sys/vm/vm_extern.h
+++ b/sys/vm/vm_extern.h
@@ -42,6 +42,8 @@ struct vnode;
 struct vmem;
 
 #ifdef _KERNEL
+#include <sys/systm.h>
+
 struct cdev;
 struct cdevsw;
 struct domainset;
@@ -140,11 +142,8 @@ u_int vm_wait_count(void);
 static inline bool
 vm_addr_align_ok(vm_paddr_t pa, u_long alignment)
 {
-#ifdef INVARIANTS
-	if (!powerof2(alignment))
-		panic("%s: alignment is not a power of 2: %#lx",
-		    __func__, alignment);
-#endif
+	KASSERT(powerof2(alignment), ("%s: alignment is not a power of 2: %#lx",
+	    __func__, alignment));
 	return ((pa & (alignment - 1)) == 0);
 }
 
@@ -155,11 +154,8 @@ vm_addr_align_ok(vm_paddr_t pa, u_long alignment)
 static inline bool
 vm_addr_bound_ok(vm_paddr_t pa, vm_paddr_t size, vm_paddr_t boundary)
 {
-#ifdef INVARIANTS
-	if (!powerof2(boundary))
-		panic("%s: boundary is not a power of 2: %#jx",
-		    __func__, (uintmax_t)boundary);
-#endif
+	KASSERT(powerof2(boundary), ("%s: boundary is not a power of 2: %#jx",
+	    __func__, (uintmax_t)boundary));
 	return (((pa ^ (pa + size - 1)) & -boundary) == 0);
 }