From nobody Sun Oct 20 11:21:29 2024 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 4XWbc95Y5lz5YvJS; Sun, 20 Oct 2024 11:21:29 +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 4XWbc94tXjz4WpS; Sun, 20 Oct 2024 11:21:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423289; 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=+madErfrGessyY7EkC3y4dEqp2kDUzfLSgFBshdhhFg=; b=KwGoVJul70aK41RcCiYgqKA+bHGBLJ2uK1uT7Vp+gI3KUBaiTNQryG7DhWjvtSTexonk7u 43ai44l6th0E0u+7t8yFuwzbI9/m9KTma6IjZYM22K/1NX8p1eXj8n0XOjaF89FB0kbkIJ PxbMAkmK8gTo/iS3cpR9PNgXSHP9RfBhAQ9iPt3+JaV461YsdatWdAJ5VHVu0ZtlH4ZvrM nOzTbArjhi/U23M1/vdoIEuG3seEPjBGoi8XK4VvSUa8bXnx8ux6wfSC76vvOL4xnQTZrz Pt9V8PtkWomgfs9NxqD6Mk5hch8d1DwKsQ2wivPDG5O1o1wB2iWqSPzVj5biyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423289; 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=+madErfrGessyY7EkC3y4dEqp2kDUzfLSgFBshdhhFg=; b=TFp0iRqx7loI2L4XTQsotHP1nasr0Bm9m6q5ZvuD2E4An6MWmFxCXKaw9bxK6mUiZ4XATq eqIp8bwhSZb6oRtwVZGrWl4T+r3rgak/89QoEK2NMBirjEuh2X9emO5uElqXs4d1uTHHxb VzfIa86KbxRarQa04yQDfS6gwa7MRRf9R8Jn3uotXhq4WRYsplCqmy/CIUrfXUrwsRokzV sYNa9Tq5i9n08fXrFlqr4VUbGivbWEGfPohp2N7p6dIcY66+AO2wC3Gmy5sN79TH7hAA1J r926Aff4EJYVzYl05V8ZU5lGNncZ3/GRzVm2VaGxOcOHz8+3lvTNcgq3N78iFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729423289; a=rsa-sha256; cv=none; b=vEOSURFOgHtcot20hyKLZ9SkGRE+anXHNBA2KsOO6DwtO/8Vyhz3bBK9ltyXMDQ8fojoxb LrNZNXYSkIwQNrLMaQUiwNJ2MK9JYmdqIE5xiuJkegLcSu4ATb8GpZVl2B4ZqXtPgz2OJ4 4D1uN7qIQUeZOI7+Q6GTn9/2jDAqHFMu88vlVN+f4X+PdjsmLHNZDVNYtR9CXj1m58jffH yPA7ZhIQvvVNpZ87yikJbhkGVVvsQ1G6aSADLezdaszRrI1JvaLHLU7pKrvWyl9G8kwR+W kcmZjA7azEMRVtA0nyZNe8SXl5SdhT2PkkM4cIvQxPfepy9iEW/+jfhoIkWFXw== 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 4XWbc94Btqz10Dv; Sun, 20 Oct 2024 11:21:29 +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 49KBLTdB061385; Sun, 20 Oct 2024 11:21:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49KBLTwR061382; Sun, 20 Oct 2024 11:21:29 GMT (envelope-from git) Date: Sun, 20 Oct 2024 11:21:29 GMT Message-Id: <202410201121.49KBLTwR061382@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: 9834b6fc77ff - stable/14 - sound: Get rid of pnum and max variables in chn_init() 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9834b6fc77ff53e5303d142486de109d6b02219e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9834b6fc77ff53e5303d142486de109d6b02219e commit 9834b6fc77ff53e5303d142486de109d6b02219e Author: Christos Margiolis AuthorDate: 2024-10-18 08:38:41 +0000 Commit: Christos Margiolis CommitDate: 2024-10-20 11:21:04 +0000 sound: Get rid of pnum and max variables in chn_init() The VCHAN count is checked in vchan_setnew(), and there is no reason to cap the hardware channels in the first place. This is part of a series of follow-up patches. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46521 (cherry picked from commit de8ee333388bf5e551e697b08823b3a6c262f609) --- sys/dev/sound/pcm/channel.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index e0fd24805a21..bf9c74e2ed1d 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1165,7 +1165,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, struct feeder_class *fc; struct snd_dbuf *b, *bs; char *dirs, buf[CHN_NAMELEN]; - int i, direction, *pnum, max, type, unit; + int i, direction, type, unit; PCM_BUSYASSERT(d); PCM_LOCKASSERT(d); @@ -1174,30 +1174,22 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, case PCMDIR_PLAY: dirs = "play"; direction = PCMDIR_PLAY; - pnum = &d->playcount; type = SND_DEV_DSPHW_PLAY; - max = SND_MAXHWCHAN; break; case PCMDIR_PLAY_VIRTUAL: dirs = "virtual_play"; direction = PCMDIR_PLAY; - pnum = &d->pvchancount; type = SND_DEV_DSPHW_VPLAY; - max = SND_MAXVCHANS; break; case PCMDIR_REC: dirs = "record"; direction = PCMDIR_REC; - pnum = &d->reccount; type = SND_DEV_DSPHW_REC; - max = SND_MAXHWCHAN; break; case PCMDIR_REC_VIRTUAL: dirs = "virtual_record"; direction = PCMDIR_REC; - pnum = &d->rvchancount; type = SND_DEV_DSPHW_VREC; - max = SND_MAXVCHANS; break; default: device_printf(d->dev, @@ -1206,23 +1198,11 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, return (NULL); } - if (*pnum >= max) { - device_printf(d->dev, "%s(): cannot allocate more channels " - "(max=%d)\n", __func__, max); - return (NULL); - } - unit = 0; CHN_FOREACH(c, d, channels.pcm) { if (c->type != type) continue; unit++; - if (unit >= max) { - device_printf(d->dev, "%s(): cannot allocate more " - "channels for type=%d (max=%d)\n", - __func__, type, max); - return (NULL); - } } PCM_UNLOCK(d);