From nobody Fri Oct 18 08:44:50 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 4XVJDL3msTz5Ywgv; Fri, 18 Oct 2024 08:44:50 +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 4XVJDL2gKHz4lwt; Fri, 18 Oct 2024 08:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241090; 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=14wZoxqC2NMmrXGQ9wcCalX0YIDAUtzU2Y+R7X03b4k=; b=xTDbiGdUTyt77RH6+WKeQUclD+gTWM/YAN9DeE5FLX4J+PQcNw5pISxblkRbp/n8ZVOT0D wCAiiTo/gNmVg51EDM/JgSfTGKTkZR/2Qllo2u4TLkTVkMVgT7V1LIh9vDfsljvcBavVoG f6oXhEYVTqZ4C7OpEO1BY4uxpR1dGPY+c8Ve6rWAIpBk+tUmOIvaPqT9seJEYk6Jj/7aHn 6iH5Y1Z6OtCbi2eDwOp+QbU/p43X2FjjzLhdk8A+CgdsBY/1wj3u7CG4ccncvfXNmpX6i9 slZG5Tzazv0Y3e0lZOUUcLXCTYaXzlARK3uGLjC92rPALJteXB5wlmbJW379IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241090; 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=14wZoxqC2NMmrXGQ9wcCalX0YIDAUtzU2Y+R7X03b4k=; b=PagGZJLE/F/Goaz9yQDQBnw5tEQGBcN386LGHBRPDf+VLlumlq4kXPZKreixIZ8ReJgLpx l/qZ7V+G9S8bsECByu/F6SSSVJNHy+9LJ38jIyCM57psJ933mk294dFenQXuhnMe/asl80 bevHdlTdh/rmJsFa2usex1D5AgoMfhvo/rVdT1FF3tojFnC/nb120C0349mKt5s8Zc8TWV aRjprVtdQsMjkoeJ77uh3QMhhsF3kXukcBH8BH+Rw4uOJwGmCxsV1qgg9KAfD/Zn1VIbD+ qSjhRexXSrOlwCg4s7/Oa78RXFDOngUY4E95cvc4N3MfumWe/ZBFG8zZ9bGwtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729241090; a=rsa-sha256; cv=none; b=x0XzyNk9lmfSnRQELXYaDg9paJpQgokL0BCXVaL2uf9skSTq3D8EfnH7zuN/wNZ18+9cOe SgRvAvaJiN9pdAVf320qnPqrXRZ2dNyu6LMNRKXtFpk0AF69MMTgqQgZITWZvLfCdynbJo vkq7yCbXcdS9BauXX5B5urWV+mEXbIqysFADc9OdcnBrLB13ivTKxbNHZx3XC45HNloKot fYSG1RmYqKxR1q+gx3Z9l1Ttu36rkICwHjTm0pQ766ZPTSX6za2nOZTUI/fm5G1AlBHxRK /52NiwQCod9Exn6CAhRg4yNM23Ntb1GhLV+cXjlHzwOTLHYEmSyBj4g2qOXRKw== 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 4XVJDL1zWTzRnk; Fri, 18 Oct 2024 08:44:50 +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 49I8io86087695; Fri, 18 Oct 2024 08:44:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49I8ioZd087692; Fri, 18 Oct 2024 08:44:50 GMT (envelope-from git) Date: Fri, 18 Oct 2024 08:44:50 GMT Message-Id: <202410180844.49I8ioZd087692@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: de8ee333388b - main - 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/main X-Git-Reftype: branch X-Git-Commit: de8ee333388bf5e551e697b08823b3a6c262f609 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=de8ee333388bf5e551e697b08823b3a6c262f609 commit de8ee333388bf5e551e697b08823b3a6c262f609 Author: Christos Margiolis AuthorDate: 2024-10-18 08:38:41 +0000 Commit: Christos Margiolis CommitDate: 2024-10-18 08:38:41 +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 --- 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);