From nobody Mon Jun 05 08:36:02 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 4QZRlR1fHWz4bLs1; Mon, 5 Jun 2023 08:36:03 +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 4QZRlQ6t4Mz3wqG; Mon, 5 Jun 2023 08:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954163; 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=B6MP1IziZYdmJXzPIWDn6y1T8kuiBk6a86rL3gMNGVk=; b=MUt9x7O0k205K9KxoQgBz5aRzeJCl6tbFk+5dFRG2AyVx0yDMCl6gDDwzWcQTpGbvoSEtF zncNbDx1xej9pPZ+cZZpyHmMbTIov9d8A7rl6y9NtvOW7HLUXtq6kfolADLMa1jBeZ4RdA Wr1PY0VugFAc9S8b4mlI3aBT2y9S1Q+EkBiuHFNXJcUSOgb/gjuFp2+AiF3aBi0bVNYpSM b421uNQRUaUN8PV79YN92dTLhkbug8kN8Up5EPDow+8D5tkG/LhCeTG2/db/4WzSZMWcE5 oOeq3cW4OF+HVHC0k4oD7daA10Z9YaWt9Uxk3c+VVtda5flllR1JkKYr6tE0kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954163; 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=B6MP1IziZYdmJXzPIWDn6y1T8kuiBk6a86rL3gMNGVk=; b=LNGGrhtdy1p3W6Moq9UKUqsS5lAb54K4jzq4Qj3b7TDg2izvChAIU57EV6mQZ3fZyUHIDL 1DF+3KU4E6GYfa33OD7HkX8gVVWf1NsOvGvr+sHaeGHYBMgMLW+rpRxYlLkip0z8ibshJO AOr4Jovam2FIvQCKeL0mEjv3DRvQDvSzKmzblGsjKqr+2nLhRoC2i91TdzeDaV0wwufwXi jwqlBid/iOUklgAiXgNzk8wcnsI7/Oicsw1vY7Ptx8sVOCL5M/T+77Lthew5nwJ020r4F/ NF0oCv/+gh6R8XYfdfwwwPuK/ArCk2vqLj5Q5K0YIHm9e20i8h3Ubv31nHGibQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954163; a=rsa-sha256; cv=none; b=EFGzvCV+EKmwZbrfXL1NGFsurqYwTM4nc+GIzFytfUCLGVIJ+7Rg0MfMgpAQ0P0o+iMWMH 5U4XvAOKSiSQDll+gfMb05RYYmpQw2N2ylJ7vlkIEoBZVsQ8Duun0AAjs0sFd5nQyqmc42 FWGFkJitV7yQYXMdBkRnC9t22eM/NTTZWitH0TUDBDaDdBDs4Vf/EyvtLbH2aWaX7wMEjN tEH8chDYXMd2E672RRlel43J8JpZhO0k05eBo5CdV/pfOhwk+9mYeFw/JJSrkr8GrORQc4 hB859O7kpWAIWPeb+ecP4l8WaLOWlqzJ4jTTFLVGlaSf2hczB+0NLYUMOoN1Fw== 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 4QZRlQ5kHkzgPr; Mon, 5 Jun 2023 08:36:02 +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 3558a2oQ024373; Mon, 5 Jun 2023 08:36:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a2JG024372; Mon, 5 Jun 2023 08:36:02 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:02 GMT Message-Id: <202306050836.3558a2JG024372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 23af3ca2d418 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 23af3ca2d4183c298435297b2e0aca226e2277dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=23af3ca2d4183c298435297b2e0aca226e2277dd commit 23af3ca2d4183c298435297b2e0aca226e2277dd Author: Konstantin Belousov AuthorDate: 2023-05-12 22:39:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 kern/subr_unit.c: more uses for is_bitmap() (cherry picked from commit 36b1f8a81ef96b42ce446efb79cffd577f1819f7) --- 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 fd9425e95dd5..6c1368c64e00 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -207,6 +207,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) { @@ -246,7 +252,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", @@ -409,12 +415,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.