From nobody Wed Dec 29 08:22:57 2021 X-Original-To: dev-commits-src-branches@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 6EB231911F60; Wed, 29 Dec 2021 08:22:58 +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 4JP4Ck1DRYz4bHD; Wed, 29 Dec 2021 08:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 09FED216F1; Wed, 29 Dec 2021 08:22:58 +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 1BT8MvHB013628; Wed, 29 Dec 2021 08:22:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BT8Mv3D013627; Wed, 29 Dec 2021 08:22:57 GMT (envelope-from git) Date: Wed, 29 Dec 2021 08:22:57 GMT Message-Id: <202112290822.1BT8Mv3D013627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 7963d46bb8cb - stable/12 - sys/queue.h: move trashing from SLIST_REMOVE to REMOVE_AFTER, REMOVE_HEAD List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7963d46bb8cbe709c61081f7bf24093f1160b240 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640766178; 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=YE9Wh8ROUFPIKiFZODZxZZzJVEibzmDXt2AcU5d/E1U=; b=rNKT5Ge8TnLE0VILePa+6RiMlfokfEZKW6BHhx/MF4b1oOX+oAEy9dRsaiNoc2Xt8ubRuT tXwh0nTrCP3ezFNkDWvAsqXEikbpJSVjO1atETgOkZ6l+O1kXrCKHv0OKoZgoVyy2qi3LR LuvlkB5BdmEcltAGlfwJrLCdf2TLLfLOnPtXiUwM6RPotohDbzF7C2xU3A3dnCULWcCrGQ NuTTE1ncGf9t4fpmp7rt7TbQBRSQXyrnXifITh7YikVcC8cB4YqLxKFkXb/acXhAjF7HTA wGzMskHk3FXFSsD/cl14b29D0FTgduwOIf9zKhPZErr6R8AYDGp7N/9ji2AFHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640766178; a=rsa-sha256; cv=none; b=PGeM9g7H0baG9tTdYD/w5U2vgPbR1CtomwL+eEmlbh7jhol9zwhyr3Okmy7ZqlD4NKl2ZL R4wrh5bMOps3lspFTLOCTy1t32iCMwSj/fBua9F1vCDy59ko69oxl9W2k5dULd/D36G9je l5qU8xODxSSz/6C9L4PIWLfa8sKlkXBRTVuOA1BR3esFELSW/RTcR8oXg0b4/He4Ly92HS f+46qklB/oWbclwDQYDaZzdq5Q1+D7KB7RbTZrtMi1s4xcSpe6L2XuzDfx7gBpxGgIKn8D 33QOSnt1r1M3dW74eO+OH5tA/DsHejappb4nZOLU9KsplYLfKhdZ0+8bceXPJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=7963d46bb8cbe709c61081f7bf24093f1160b240 commit 7963d46bb8cbe709c61081f7bf24093f1160b240 Author: Andriy Gapon AuthorDate: 2021-12-15 11:27:49 +0000 Commit: Andriy Gapon CommitDate: 2021-12-29 08:22:52 +0000 sys/queue.h: move trashing from SLIST_REMOVE to REMOVE_AFTER, REMOVE_HEAD SLIST_REMOVE calls either REMOVE_AFTER or REMOVE_HEAD to do the job. But those two macros can be used independently as well. (cherry picked from commit 5dab06a003189ebb017810bdbf3b3c2f074afd3e) --- sys/sys/queue.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 5e12299e01c6..d4eab4642992 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -275,7 +275,6 @@ struct { \ #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) #define SLIST_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ if (SLIST_FIRST((head)) == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ @@ -285,16 +284,19 @@ struct { \ curelm = SLIST_NEXT(curelm, field); \ SLIST_REMOVE_AFTER(curelm, field); \ } \ - TRASHIT(*oldnext); \ } while (0) #define SLIST_REMOVE_AFTER(elm, field) do { \ + QMD_SAVELINK(oldnext, SLIST_NEXT(elm, field)->field.sle_next); \ SLIST_NEXT(elm, field) = \ SLIST_NEXT(SLIST_NEXT(elm, field), field); \ + TRASHIT(*oldnext); \ } while (0) #define SLIST_REMOVE_HEAD(head, field) do { \ + QMD_SAVELINK(oldnext, SLIST_FIRST(head)->field.sle_next); \ SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ + TRASHIT(*oldnext); \ } while (0) #define SLIST_REMOVE_PREVPTR(prevp, elm, field) do { \