From nobody Tue Jan 28 14:05:07 2025 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 4Yj6Vq6YHvz5lVHG; Tue, 28 Jan 2025 14:05:07 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yj6Vq3ZYpz3Sj8; Tue, 28 Jan 2025 14:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738073107; 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=kuAeCHuUtrtsY7shEc3mcmU+jVBEOii/OABrZVPAiN0=; b=IMUhp9I8hMtTnvByWpQ1GxU0VHVfAzbCUt1XVJIAvrIaoNYTe5twVtJLPfdsLCnsyvAjMi xq8r/GVsXnezmCKN2WQ/cvBbgBDgrGvWwt0aRTtaEUMGPbktJxGy20HWlJWK+AsG6wekkL IRCbP7dOxutwk4jzNpBi00Enwifdw44F65485SeGAgn74lkYballl6G9pfdX8dWF9Wc7fj UqOSSYfzKgRfUkUcGqhJsQvYgGpFe98ALhp5oBUJuQ87hI3osYjgDuY3c7WdERZNXFEGNk P64Vj4ncuiWAGzaOZMBscM5xmUlCGBykU7C56yoZ14R6FjYZGNRRR72tI+Q+dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738073107; 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=kuAeCHuUtrtsY7shEc3mcmU+jVBEOii/OABrZVPAiN0=; b=k9uCDk/8FOczLqUYfxpBgCQOtr/gK3bEhszBB+xWmL8JAVxG1GK5H9E+QnQlbcMgizBxTe ONiq+oSEUe6L2Yf0HybwfH7hjGvm5WAIY/hREXv/Rhqv6SReelmoesuw0te0hG+fkPirue 9Jj9fpQKRb00919zV7U3ywHmrbpNblYf5Ld+miopbp2fE0/A0pM20lw+KrwCoAeO1gZPr8 4f4YfM91yjRtCxMcAWfYGSggbi68z1JnEz9W3pxyzGmyMrd1VmWf46TDMsnA83HXBPszsJ SitdH2m09uZuuYSmBB5wAeISZLQfhHsO/Lv3ETPgxnhPh0RZ+fr7v37BGejcug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738073107; a=rsa-sha256; cv=none; b=JkZKRsPucCfRALIec8sRD6mn1xo7iA+yOwvnMSiZH1MBZHjdPmqDKV8NlUR7MSI9HnYf6B /coL1kx7Xf6HXx9sQX3jz/JftpkRVdnfszVBHAeJReRh43xeCXQA3TnmXAxkNVdVPkXAna eplB4sVsGJ38MAZIdYqJWbj8MRCws8DVbsGY9ij8pFMGLJwe82YsiVmMTSZeCOATo3dycL BLH6fKE7CZXZPEPxcu+bVz5T8yEvjeOdu7jfohjHBp56HnYbm6qkBJ/0fZqGc6KNfnpJ2A SMM9l2ZYgc9eodcp06ILD56G3QeyZcQUQXpGLADM7zvNUg1ShVBHvDBa8/IJnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4Yj6Vq1yR9z2Zf; Tue, 28 Jan 2025 14:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50SE57Rl020821; Tue, 28 Jan 2025 14:05:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50SE57Aa020818; Tue, 28 Jan 2025 14:05:07 GMT (envelope-from git) Date: Tue, 28 Jan 2025 14:05:07 GMT Message-Id: <202501281405.50SE57Aa020818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: e4458d4d71c4 - stable/14 - sound: Make CHN_REMOVE_SAFE() the default 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e4458d4d71c4c533712ca8417251f0dff6d3168e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e4458d4d71c4c533712ca8417251f0dff6d3168e commit e4458d4d71c4c533712ca8417251f0dff6d3168e Author: Christos Margiolis AuthorDate: 2025-01-21 12:00:17 +0000 Commit: Christos Margiolis CommitDate: 2025-01-28 14:04:52 +0000 sound: Make CHN_REMOVE_SAFE() the default Commit 27b932e32fab ("sound: Safely remove channel from list in one pass") optimized CHN_REMOVE_SAFE() to perform almost equally to CHN_REMOVE(), so we can turn CHN_REMOVE_SAFE() into CHN_REMOVE() without fears of performance regressions, while also being more robust. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48249 (cherry picked from commit ffcefe5310e084415a2f292a00f4637d4059c40f) --- sys/dev/sound/pcm/channel.c | 2 +- sys/dev/sound/pcm/channel.h | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 925a82bb170f..4b0ca128391b 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2291,7 +2291,7 @@ chn_trigger(struct pcm_channel *c, int go) break; case PCMTRIG_STOP: case PCMTRIG_ABORT: - CHN_REMOVE_SAFE(d, c, channels.pcm.busy); + CHN_REMOVE(d, c, channels.pcm.busy); PCM_UNLOCK(d); break; default: diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 58fedd284ecb..6eaad8cc2c0b 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -189,9 +189,6 @@ struct pcm_channel { #define CHN_INSERT_AFTER(x, y, z) \ SLIST_INSERT_AFTER(x, y, CHN_LINK(z)) -#define CHN_REMOVE(holder, elm, list) \ - SLIST_REMOVE(CHN_HEAD(holder, list), elm, pcm_channel, CHN_LINK(list)) - #define CHN_INSERT_HEAD_SAFE(x, y, z) do { \ struct pcm_channel *t = NULL; \ CHN_FOREACH(t, x, z) { \ @@ -212,7 +209,7 @@ struct pcm_channel { CHN_INSERT_AFTER(x, y, z); \ } while (0) -#define CHN_REMOVE_SAFE(holder, elm, list) do { \ +#define CHN_REMOVE(holder, elm, list) do { \ if (CHN_FIRST(holder, list) == (elm)) { \ SLIST_REMOVE_HEAD(CHN_HEAD(holder, list), CHN_LINK(list)); \ } else { \