From nobody Tue Jan 21 12:03:59 2025 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 4Ycm8J6s4vz5l0wT; Tue, 21 Jan 2025 12:04:00 +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 4Ycm8J0tCHz3gBV; Tue, 21 Jan 2025 12:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737461040; 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=2w2b3uIaBTWLoGwIScIF9CRB7pn4JGymsrgwNmCEC2E=; b=SlPXTaJ+Qa9i539URS5hKerk1/IZ4b38dIrWcWddJntsiUvoKaWmprekKqMQnV2smnZobQ qKyIogPhN/EpWUkVrUGhBoJvzGfARt1bodUNLolQck1wGgJYrTtB0bzBOoVr11iWheN0CK joYjpNwLSTa/e1vqGaztEcZFkorijMAYf1/jcVQekj2yB8mEyzQUTXW+ZNROdSGGFvlsAX 1vMTzDc5VS0dTLoUU5T1gCceBnYOcdRO8naPseS+tmE2LP+NT3qYs4vNEAeaBi+JSRYDsT Dc32Q6RlY9NePrFP3dIuotH0l2Ic0PH+v7YKmZi1a2rXOgK6bAFV/rmLXCXMew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737461040; 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=2w2b3uIaBTWLoGwIScIF9CRB7pn4JGymsrgwNmCEC2E=; b=fNC37OFGk9MQsHnregfFXluTLKZhJb2xjPXMJHd6pe3hMfsWFVxQildFzMoTY3tUlUG1cq W5+RknGvBCJUWMZMP7dVBS7bG9Wql9nnp98spw4Te4W4aRIFCKP6huzwTT0sE5V0RklHAU fJoYFbkHdYRyyona4XMO0tlNNxAwfvGLATdzA4ckFlgNylkJbm169oic5sbUucJXJ0JO0m bz/rQu8XicxUhnNjlU4UkLU/5Z4nKUWfBAqabs/wjnB8moW1VLreKUIyQpX4VbRnKhBdrD /Crvgvf48pLPfmDm0XG2ATgQy+HTOafXd5JKzIKmxJ/GL9rwAsublLN0AJeQ4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737461040; a=rsa-sha256; cv=none; b=VFyvtvw91sWPdK1zXLQgQSlJNYuAfhSScN03OhUHHRfgiBkRAQjFQfqG2SOfAnraqqBzYq F//QbWOGpUILtV2vFsORf41edX64/ipvlz5Xy+Gxja/kzsV/wT6fHz1vjKUTm9yNaEYTaw zgUR8L8yBWAz3bjnG/2tjwd/eylYOBRlfbSMUqT8qzBkDcZGj7pMtYzq69PFuqgChMnhMn pPHd7OG9sXxVVb4vD+YOe9ttdm8dok7H7T8mTV5hzT2FmNQccZILEEktpgmV4UyxmWj753 xGrk13bDJznTkeUgPFM6hyK8GvQEIms2prWENgxyBXDWlk/g6cGRB5Yqslb7Cg== 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 4Ycm8H1S1Qz15KK; Tue, 21 Jan 2025 12:03:59 +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 50LC3xVg023336; Tue, 21 Jan 2025 12:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LC3xJD023333; Tue, 21 Jan 2025 12:03:59 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:03:59 GMT Message-Id: <202501211203.50LC3xJD023333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ffcefe5310e0 - main - sound: Make CHN_REMOVE_SAFE() the default 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: ffcefe5310e084415a2f292a00f4637d4059c40f Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ffcefe5310e084415a2f292a00f4637d4059c40f commit ffcefe5310e084415a2f292a00f4637d4059c40f Author: Christos Margiolis AuthorDate: 2025-01-21 12:00:17 +0000 Commit: Christos Margiolis CommitDate: 2025-01-21 12:02:55 +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 --- 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 { \