From nobody Sat Feb 25 15:34:14 2023 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 4PP9m63YVgz3tJ16; Sat, 25 Feb 2023 15:34:14 +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 4PP9m632Lsz3Gmw; Sat, 25 Feb 2023 15:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677339254; 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=z4ZCpi2q+/D/ZfpXZKZxYxPF6238F8MUVkGl8G5/3To=; b=EYh354UUfzNdPhC6nGQWnjQRv7YoWqOPNMvnmij9lUIjts0+Tnp4YtE05aL42LpNIMvujX UDGOYLrIkhrJYXn2cbsGNqDoiWk3m4zcDjzFLNv3AwbCm+YYyRY+9dJPplmDgvZH66++3z dj5UjOsL55zdY0u2FLNVn3H+xy2EnXFo6O8fRTrmK6UwT2ncyYYpuQw4ZdaKfD3V46BZ49 Jc0XNy3POBTol3HogNXp1EvpgEA/qtZlzOe6YZmOneMNf8F1YDX17E0+5c8yPVlRFx0xJw ipmSz+oqhr/b6I4JRxtkb//+EOfSwd+LvDbDmjXv1DibRXban0hv3N0OMJNj4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677339254; 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=z4ZCpi2q+/D/ZfpXZKZxYxPF6238F8MUVkGl8G5/3To=; b=VKpyRDjAuHCyI05Leo3Ii/Oak1RiHJwqlmn/azqd8RykuXMIOIi0X/ge30eqeCFN4p0ubJ TpnwhpHN8FqfpKYP2SWTy6BJx2W4HCGGPcuF8+XjRW1d+L7uuKv4zjoR2L73AoaVHdCKOi rqBC9iRqz4kuHgFxB9iS9HBeGyeUNIll2fkvSt41++ToZbQLXbrACWuJP+Xm/75BVrJe6b 7QCpkNY423qvZaj5wircTUFJusaeUY4plZtVelyLaZbWuntDwfIMkvSbTqgK0fXjPCG6jc V5YtMTJk3Hc0XnD1ssxqLZGwUOk6FJsKDXAjlgL6quq7a7cMB3PcKhnmHNLG4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677339254; a=rsa-sha256; cv=none; b=okrOHQQTWsNAF0AV2q0cctd/CUAPNAGWr9q9Z7qvs974to3JaYyl3RY3adeBYVYarjU8Uq dJ2mWrVt4LstxG6lWehh3x9lWuorzm20iAvYr66prVJ0cT8XRAc9WB+eUAVGNEnGTf7cKg noQ68zU4zX23vU7VeOeYgAhLPRl/kzNBJfRM92th9Dov5S88Ez7VF5NzS8i1qeObqyjvNq lYO9e56T9Z1VyqeFH77+CQ/Ow+s4dsK5QVLzdv2t2Vz/zz84UPjQB6erWH2cQpyzAh7tP6 XchMWrXmoEr4klRNqiHu8B7lAJTtKMIemLNZP7fuoO0Ml97205ZAYxrHJ46IOA== 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 4PP9m624mBz18k3; Sat, 25 Feb 2023 15:34:14 +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 31PFYEwj080929; Sat, 25 Feb 2023 15:34:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PFYEST080928; Sat, 25 Feb 2023 15:34:14 GMT (envelope-from git) Date: Sat, 25 Feb 2023 15:34:14 GMT Message-Id: <202302251534.31PFYEST080928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6f48a4acbeb8 - main - ck_queue: add CK_*_FOREACH_FROM List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f48a4acbeb86ebbef90290ad73ea6be83507aa9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6f48a4acbeb86ebbef90290ad73ea6be83507aa9 commit 6f48a4acbeb86ebbef90290ad73ea6be83507aa9 Author: Mark Johnston AuthorDate: 2023-02-25 15:21:19 +0000 Commit: Mark Johnston CommitDate: 2023-02-25 15:34:06 +0000 ck_queue: add CK_*_FOREACH_FROM This is a variant of CK_*_FOREACH from FreeBSD queue.h which starts iteration at the specified item. If the item pointer is NULL, iteration starts from the beginning of the list. Upstream commit 74366be35a6f4635f248a3c62d2d23245a4eb0f4. MFC after: 2 weeks Sponsored by: Klara, Inc. --- sys/contrib/ck/include/ck_queue.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/contrib/ck/include/ck_queue.h b/sys/contrib/ck/include/ck_queue.h index fd38d8a583fa..3472b0e40ad9 100644 --- a/sys/contrib/ck/include/ck_queue.h +++ b/sys/contrib/ck/include/ck_queue.h @@ -153,6 +153,11 @@ struct { \ (var); \ (var) = CK_SLIST_NEXT((var), field)) +#define CK_SLIST_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) != NULL ? (var) : CK_SLIST_FIRST((head))); \ + (var); \ + (var) = CK_SLIST_NEXT((var), field)) + #define CK_SLIST_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = CK_SLIST_FIRST(head); \ (var) && ((tvar) = CK_SLIST_NEXT(var, field), 1); \ @@ -262,6 +267,11 @@ struct { \ (var); \ (var) = CK_STAILQ_NEXT((var), field)) +#define CK_STAILQ_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) != NULL ? (var) : CK_STAILQ_FIRST((head))); \ + (var); \ + (var) = CK_STAILQ_NEXT((var), field)) + #define CK_STAILQ_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = CK_STAILQ_FIRST((head)); \ (var) && ((tvar) = \ @@ -374,6 +384,11 @@ struct { \ (var); \ (var) = CK_LIST_NEXT((var), field)) +#define CK_LIST_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) != NULL ? (var) : CK_LIST_FIRST((head))); \ + (var); \ + (var) = CK_LIST_NEXT((var), field)) + #define CK_LIST_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = CK_LIST_FIRST((head)); \ (var) && ((tvar) = CK_LIST_NEXT((var), field), 1); \