From nobody Mon May 29 22:11:19 2023 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 4QVV9M5ZMsz4XFw1; Mon, 29 May 2023 22:11:19 +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 4QVV9M4dTjz3Jv6; Mon, 29 May 2023 22:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685398279; 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=2k+e/pLRrvm2RuxJSP8E5TXj3hgUVcMCE9SUEV6GnbY=; b=woKBaVvOvxSMKMNGJ5Fx/sDwymHObfzAb6c/mU3UTcCi03Nn5p28JkMhuLLvYY/RjYXHbM SFrKywyvAs/70ZM6KaCxg/PZaaMn1VpIlZJFoO4hHAI04dFbxtvwcZxSx3ID/VrGmXcsuY snDHRFZhv1nEtuAdaQjVeIHLBkBvJe51RGZcEwPUMybvBQsFXYJqFClQEU2g9C5ac5YgHU Lulm/poZ14IkxML7e/4tZrQDvHc/mxu+XXSchJbxd3phH4jbmYVsGCAZjXoZRZrZL/pCi9 LKr6FPuN8mBUyvabu6522xz2nx+XqIvi+66N3ZPz/BnEs5XlmTzq0l84UPRqGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685398279; 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=2k+e/pLRrvm2RuxJSP8E5TXj3hgUVcMCE9SUEV6GnbY=; b=VTHGWfUbIHtNMGz2tkK2wmd1kdWDBtKcgpR7k0z0GnELe/I5CxpHqmEcar7qFpD5AdWm4L ArHNz+1vtseZTwRwGHmzCadUtnyuzbYI1VURhZWvD6w+crUkrZHF4c+CLJbd1yjzRJZuLv hLkB8J2s5aX1aGh7KD7prIxD8Dfxb5XOqMjHAgmK2CCyzlq4kbM9c9ri7nIS9wQlI1GNga +IfnDncU0ToU027xJRIYwmOMdDBtFWX681RFrTc3vREydlZ4ZfiOrQzzQexd6ndbirL0CZ n510kQd+PeIEzUQObUQSCkzC/gmoM34NNyX/sTJ0SHxJd16ideAoSgwos8xt8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685398279; a=rsa-sha256; cv=none; b=vAcIakrdDomJTjYSD4K3p6wrU/KCBKDYBVIXYv6BwiZlZmUvjCeapOSS3nR6l79Z315OaP Miulo/9sfTq0q/+uYio0XdhE0N9v4ZCJR7+a9xe21LSrRV8Sg5zzdrjq6JIr0g/VL3JmYD KzMKKM1/8aRMOMTqYlEhO54CY7p1KkoCMGrLVxo29UQjPYQBj27oFLSYJ3nyG0CzjQj0Uj F9SfVD8LS1nTeekuXlqQiumKF8Mn4pqcQ73fkDH7B7KgdsDO89YDIF+90TPC5sG269ccbn kX+BvbjDqaTI6rrYZg5P0KFi9h7jLvZbdGwxsgRCUK7l/5hzqFLxuh8qwzSy3g== 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 4QVV9M3g50zTDl; Mon, 29 May 2023 22:11:19 +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 34TMBJWF043806; Mon, 29 May 2023 22:11:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34TMBJ2P043805; Mon, 29 May 2023 22:11:19 GMT (envelope-from git) Date: Mon, 29 May 2023 22:11:19 GMT Message-Id: <202305292211.34TMBJ2P043805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 36b1f8a81ef9 - main - kern/subr_unit.c: more uses for is_bitmap() 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36b1f8a81ef96b42ce446efb79cffd577f1819f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=36b1f8a81ef96b42ce446efb79cffd577f1819f7 commit 36b1f8a81ef96b42ce446efb79cffd577f1819f7 Author: Konstantin Belousov AuthorDate: 2023-05-12 22:39:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-29 22:10:35 +0000 kern/subr_unit.c: more uses for is_bitmap() To facilitate it, move the is_bitmap() definition earlier. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40089 --- sys/kern/subr_unit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 22710f546d4f..a1878ea4b144 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -194,6 +194,12 @@ CTASSERT((sizeof(struct unr) % sizeof(bitstr_t)) == 0); /* Number of bits we can store in the bitmap */ #define NBITS (NBBY * sizeof(((struct unrb *)NULL)->map)) +static inline bool +is_bitmap(struct unrhdr *uh, struct unr *up) +{ + return (up->ptr != uh && up->ptr != NULL); +} + /* Is the unrb empty in at least the first len bits? */ static inline bool ub_empty(struct unrb *ub, int len) { @@ -233,7 +239,7 @@ check_unrhdr(struct unrhdr *uh, int line) z = 0; TAILQ_FOREACH(up, &uh->head, list) { z++; - if (up->ptr != uh && up->ptr != NULL) { + if (is_bitmap(uh, up)) { ub = up->ptr; KASSERT (up->len <= NBITS, ("UNR inconsistency: len %u max %zd (line %d)\n", @@ -396,12 +402,6 @@ clear_unrhdr(struct unrhdr *uh) check_unrhdr(uh, __LINE__); } -static __inline int -is_bitmap(struct unrhdr *uh, struct unr *up) -{ - return (up->ptr != uh && up->ptr != NULL); -} - /* * Look for sequence of items which can be combined into a bitmap, if * multiple are present, take the one which saves most memory.