From nobody Mon May 06 18:36:33 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 4VY99G1dHRz5J2rH; Mon, 06 May 2024 18:36:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VY99F73fZz4sBZ; Mon, 6 May 2024 18:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715020594; 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=jnyLPjEkSEKPrXGM0DZFBMMws5izdoDaxGUUx+ibuSo=; b=Ydo7sbkJcbXZy+3Pb+7evUpuuf01Y25aCcHBsk7CkDOXKgE9ROg8bXzq2+Irwxq+AQ8mXW qaKaYU9s27nZhPv5vDeDJ0FdACXnlnm7R+r6RjIfVsvVui/X7h/+eCQCcyMsnjk1GyJIEo 2FyuMfdqnZTTtSR/U3bhPwQDoOPgVNKG1TM0wKGSuLAtc/8E6kIYafSaDw+kd8ryfSQpvs AG9pTbFcsGIXZIkIRWlb10F2w8pDaVainclgHdgCj87ZdaiUyVofY139O8MGyw7Q2WD2UQ R+PkSEnP/YaKw/KWL/qGWKfZRdoeP7BfMsra+FDLCsg9Y4pfOBXwB4oRxI2v4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715020594; a=rsa-sha256; cv=none; b=kz/mq+ikiPKoID3tRMrIm4HF6uj2rdUt/uWx2Iunr5xtRGB8fKZKkq5GmDMTHeSrcMf+pZ 2BHhXUi3Etji6L7XCHOolqPwRE1FAjP8En/CBy/UOe++GGui10agpROlRU3bbGznnn20cX UrIsLbcbnVdVNAbObC7FYo22asB1VC9cW/U0qaIOohoM49txvn/kN5xeC5fEoUZ548Q2Px EYrKyMwWQnDHFUagcjB/1DFIpOxquHNsvrdmDf8KmHW83Hy6RPDFIODyxVub9cFd1Hfk5r aOLOw5o4mgMKGj79AXODuHRMY+3LHpuIbNKYDQOWkXt4YxL1863n0LbZ53oQBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715020594; 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=jnyLPjEkSEKPrXGM0DZFBMMws5izdoDaxGUUx+ibuSo=; b=kSKwqZK2cy8Lygi8n6BooLo1quL+S66JCDIDcfrua7IETtdd38GDnn9g/YYvzew8SVUTf5 21DOEifv/92l/PTrILaLv+KoyOtFhBSHR3HeKF0/D/Y64VOVOmwGG/uij5WeUiGR7OIP/F gqJ4znnX9GuwnHbN5hUdq6Nnj7WSTK73knuBsrbFN+t0xYwYqHMsYZf2/3Dn/6qAMqEDb9 k733yA8BKLvfhfcxXvNo7HDIhSDpiTL5XKul2mSrrwSL02d/RD+ZLZu5fwulGKhb1lwinB p9515hd38WmV7yJIiroHsNlFy4e6TaZ2Yymca5BkiMj4q2Kfv+APn1hYuEk6uA== 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 4VY99F6QvGz17qm; Mon, 6 May 2024 18:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 446IaXCY060031; Mon, 6 May 2024 18:36:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 446IaXBu060028; Mon, 6 May 2024 18:36:33 GMT (envelope-from git) Date: Mon, 6 May 2024 18:36:33 GMT Message-Id: <202405061836.446IaXBu060028@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: 139bcec852cf - main - sound: Convert pcm_chn_add() to void 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: 139bcec852cf2786ca839ca0bddbb2b78a23d6fa Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=139bcec852cf2786ca839ca0bddbb2b78a23d6fa commit 139bcec852cf2786ca839ca0bddbb2b78a23d6fa Author: Christos Margiolis AuthorDate: 2024-05-06 18:27:18 +0000 Commit: Christos Margiolis CommitDate: 2024-05-06 18:27:18 +0000 sound: Convert pcm_chn_add() to void It always returns 0. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44998 --- sys/dev/sound/pcm/sound.c | 14 +++----------- sys/dev/sound/pcm/sound.h | 2 +- sys/dev/sound/pcm/vchan.c | 8 ++------ 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 2787c0ee126d..9b4de948eac4 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -379,7 +379,7 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, sysctl_hw_snd_maxautovchans, "I", "maximum virtual channel"); -int +void pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) { PCM_BUSYASSERT(d); @@ -405,8 +405,6 @@ pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch) default: __assert_unreachable(); } - - return (0); } int @@ -454,7 +452,6 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) { struct snddev_info *d = device_get_softc(dev); struct pcm_channel *ch; - int err; PCM_BUSYASSERT(d); @@ -467,15 +464,10 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) return (ENODEV); } - err = pcm_chn_add(d, ch); + pcm_chn_add(d, ch); PCM_UNLOCK(d); - if (err) { - device_printf(d->dev, "pcm_chn_add(%s) failed, err=%d\n", - ch->name, err); - chn_kill(ch); - } - return (err); + return (0); } static void diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 09e739ea5c20..6c9f4c8f18b2 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -297,7 +297,7 @@ int pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num); int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction, pid_t pid, char *comm); -int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch); +void pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch); int pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch); int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo); diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index ccac08891220..1a21b7049b77 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -706,13 +706,8 @@ vchan_create(struct pcm_channel *parent, int num) } /* add us to our grandparent's channel list */ - ret = pcm_chn_add(d, ch); + pcm_chn_add(d, ch); PCM_UNLOCK(d); - if (ret != 0) { - chn_kill(ch); - CHN_LOCK(parent); - return (ret); - } CHN_LOCK(parent); /* @@ -727,6 +722,7 @@ vchan_create(struct pcm_channel *parent, int num) parent->flags |= CHN_F_HAS_VCHAN; + ret = 0; parent_caps = chn_getcaps(parent); if (parent_caps == NULL) ret = EINVAL;