From nobody Fri Oct 25 11:37:05 2024 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 4XZgjt01Wdz5ZcwF; Fri, 25 Oct 2024 11:37:05 +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 4XZgjs5Zp8z48vR; Fri, 25 Oct 2024 11:37:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729856225; 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=xzTTOX5PAMB2/+IHI24vegaeucU+LagTPstKwfgjAfo=; b=aGWLHA8xzm52zXu33TMBDjO7xzVo8uXdndhp6QIviGGKU2VM8497vtygC5S/fDz3ul+ICK zXebBYxF/72ao5kr/QdOBoGL5WduhL0dDRZdq0U8OCT4T7e5hxtWLT0Zplm3mLdluNGRrl 31BO4QvX1sAYbXz4DVX3szsJUVGpdZ/VKnxF81HUfdRC1QaEEu/4oiNrB00UlsTQVRdFt0 qe2qHWgoYWKQe1ofVPLUY5Z3ZmEKaxfSuJJJWPs/1mi1xw2sd0hM2qqTtrlUV7y8yk+6fN YJF6O5jFsMLfTm0Ki2hfdBhYItB7KxTcsEbc8UNBnxWLWkQS/2Bx1QMERXTafg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729856225; 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=xzTTOX5PAMB2/+IHI24vegaeucU+LagTPstKwfgjAfo=; b=jEfPQMnKaWG+ATYrDxrxJUYQEa+biq9sIzD1dMXwJT9yJ1MGbeoRhkWCEmG5HTB1weWb81 Mbv5GjLw2+4oBjIbmNb2TvUUN8g0NwhMledItbNQy5KbLqIgpnQVMVCciagB6ISLpirsd5 wwvKFZy0tZGppE0R+RawbH20FqU1FeGrRP6qR9hvTd+gy7qRI+sB28qt+r4YavcGorumLF AYLrXr3I5GCLj7kaIqaZxTIq/MofkHWMZ4NieZRSoUGug3aTCOza3DmdQT1Mnh1Ot+LL4L p23tQFXtpuG4TOKl21OY5PHJ9JePHzkRIwkzyXz+sytWTLdaWodCEFO2cAE3VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729856225; a=rsa-sha256; cv=none; b=fngroCsaA1xVgfEJY2Bs9i66NkcXsgFENDb7DWWqLimrmQEuz2lYyxJNIlZQoi4U1YYIH6 WCfkfMT6bxdM3J9zQPHkUn63IV0Xfxs3HHF6PfojNFAuP8SXW6HXYYsNjTQoqH/eLscL66 9VZDDR6aWY84cMXogowr59g2gcVR54c/0HhjXO4RZveHUZpFrAXviQVQw5b6nR/TI/FrDI mj9kKjA4kEOfn322+he350wmXYnlXNnlcddOCyZdlB4NmCzTmoPSSFFd1Bqb+8GFfgBI38 Rovyecccz0BjASFY/z2UmEgonq1N9yvUuBl/yA9dFhkk31NR+G/qc+Xm6HceSA== 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 4XZgjs4tvTzPhN; Fri, 25 Oct 2024 11:37:05 +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 49PBb5Cv039284; Fri, 25 Oct 2024 11:37:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49PBb5ol039280; Fri, 25 Oct 2024 11:37:05 GMT (envelope-from git) Date: Fri, 25 Oct 2024 11:37:05 GMT Message-Id: <202410251137.49PBb5ol039280@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: 9a6cf27583ff - main - sound: Retire channel refcount 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9a6cf27583ffc13bb0a7c5be0704ba0d2f3b834d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9a6cf27583ffc13bb0a7c5be0704ba0d2f3b834d commit 9a6cf27583ffc13bb0a7c5be0704ba0d2f3b834d Author: Christos Margiolis AuthorDate: 2024-10-25 11:36:59 +0000 Commit: Christos Margiolis CommitDate: 2024-10-25 11:36:59 +0000 sound: Retire channel refcount No longer used. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D47269 --- sys/dev/sound/pcm/channel.c | 13 ------------- sys/dev/sound/pcm/channel.h | 2 -- sys/dev/sound/pcm/dsp.c | 29 ++++------------------------- 3 files changed, 4 insertions(+), 40 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 7bcd841d541f..eb70e910f51d 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1435,19 +1435,6 @@ chn_release(struct pcm_channel *c) return (0); } -int -chn_ref(struct pcm_channel *c, int ref) -{ - PCM_BUSYASSERT(c->parentsnddev); - CHN_LOCKASSERT(c); - KASSERT((c->refcount + ref) >= 0, - ("%s(): new refcount will be negative", __func__)); - - c->refcount += ref; - - return (c->refcount); -} - int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center) diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 6c6692fa8bc2..0788fbe42a5a 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -84,7 +84,6 @@ struct pcm_channel { kobj_t methods; pid_t pid; - int refcount; struct pcm_feeder *feeder; u_int32_t align; @@ -266,7 +265,6 @@ struct pcm_channel *chn_init(struct snddev_info *d, struct pcm_channel *parent, void chn_kill(struct pcm_channel *c); void chn_shutdown(struct pcm_channel *c); int chn_release(struct pcm_channel *c); -int chn_ref(struct pcm_channel *c, int ref); int chn_reset(struct pcm_channel *c, u_int32_t fmt, u_int32_t spd); int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center); diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 7d80a82d31c8..6a59bcfc1ade 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -168,9 +168,9 @@ static void dsp_close(void *data) { struct dsp_cdevpriv *priv = data; - struct pcm_channel *rdch, *wrch, *volch; + struct pcm_channel *rdch, *wrch; struct snddev_info *d; - int sg_ids, rdref, wdref; + int sg_ids; if (priv == NULL) return; @@ -188,22 +188,6 @@ dsp_close(void *data) rdch = priv->rdch; wrch = priv->wrch; - volch = priv->volch; - - rdref = -1; - wdref = -1; - - if (volch != NULL) { - if (volch == rdch) - rdref--; - else if (volch == wrch) - wdref--; - else { - CHN_LOCK(volch); - chn_ref(volch, -1); - CHN_UNLOCK(volch); - } - } if (rdch != NULL) CHN_REMOVE(d, rdch, channels.pcm.opened); @@ -231,7 +215,6 @@ dsp_close(void *data) free_unr(pcmsg_unrhdr, sg_ids); CHN_LOCK(rdch); - chn_ref(rdch, rdref); chn_abort(rdch); /* won't sleep */ rdch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | CHN_F_DEAD | CHN_F_EXCLUSIVE); @@ -249,7 +232,6 @@ dsp_close(void *data) free_unr(pcmsg_unrhdr, sg_ids); CHN_LOCK(wrch); - chn_ref(wrch, wdref); chn_flush(wrch); /* may sleep */ wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MMAP | CHN_F_DEAD | CHN_F_EXCLUSIVE); @@ -382,7 +364,6 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) rdch->flags |= CHN_F_NBIO; if (flags & O_EXCL) rdch->flags |= CHN_F_EXCLUSIVE; - chn_ref(rdch, 1); chn_vpc_reset(rdch, SND_VOL_C_PCM, 0); CHN_UNLOCK(rdch); } @@ -402,11 +383,10 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (!DSP_F_DUPLEX(flags)) { if (rdch != NULL) { /* - * Lock, deref and release previously - * created record channel + * Lock, and release previously created + * record channel */ CHN_LOCK(rdch); - chn_ref(rdch, -1); chn_release(rdch); } PCM_RELEASE_QUICK(d); @@ -419,7 +399,6 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) wrch->flags |= CHN_F_NBIO; if (flags & O_EXCL) wrch->flags |= CHN_F_EXCLUSIVE; - chn_ref(wrch, 1); chn_vpc_reset(wrch, SND_VOL_C_PCM, 0); CHN_UNLOCK(wrch); }