From nobody Wed Jul 10 16:49:06 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 4WK3jH4Qfzz5QmmR; Wed, 10 Jul 2024 16:49:07 +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 4WK3jH0WZ4z4gbF; Wed, 10 Jul 2024 16:49:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630147; 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=NmosO1knnICuZhcWvOcLhEFAkouiADwKS1MwQ05G4/M=; b=fwTgGBfIvMeqTOkP2nq/RhCetCRD6Q43YX4DidoGnII5lDrzX9CE9V+6ql4e6yDAttxMJc AdfzKaGPEBf7OoogzXwYjQyAigtJghIAdWMzyQ051n1+LUs+lVrgdTpalQoVxMwbMDAmMA 1MpT7XpQtYge/6uAnvKqU/ntzvXGUMq70pcimqaattspiyX3XuDk9Ss5sugHQZp4ZjWWTA EPgTZOw5dAimfUaC+YEXATyrJpzt5mjPHvevLH5XMQeiV0Jzm79yHSy9ShDBnsrNYGMw14 hXm6RffQF5vb4JmJJGOShqiW5ukgkEtrhomWOp+V3MhcSdNEO3/qoaQnMXDTOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630147; a=rsa-sha256; cv=none; b=UE/19wFCAVzggNJ7ScmvVNJBu42MoAgI2TxoqDSSKo8aFXpbRc6c4L9gwP9mHR+SxcahPm KeRNv54vG6uK88+bNhb2MFT7Od402gOPX5rYgusgcm3jquNBHz6rrAS1Stj8/Ki4XSsU9f /QmzTHGjb3jJIMrhi4ElqH86ZmerSxf0IfATEL0BRsAbJVFZa5jE781S9SOBPVpJdOajPH DGG9yBMMGp4X5wQClkpSBXh9FqQal1pNr3+En8PAruTzxqeWHEbSshoQirWIODREumkTsL cAeH0DY7hS/JiooAQ8GXah8QZjVe9IKGhaAEqbp+3nFbXK4tq/HMcJEIF2NjnQ== 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=1720630147; 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=NmosO1knnICuZhcWvOcLhEFAkouiADwKS1MwQ05G4/M=; b=lMQCOt1ZRiItwworVZAHL1Qb9oU4sXI0j8wGJP0C4Z/XGhACcbrCRgept/b3FfW1+fVPsi mExS7c1cO/n+EWeEAEFc1u7Ek4YdGZ02rL9NwRZkEQz6OyDv+/zwqY3BsMdKNTdF6gUW98 gmRShv/q2+vDQJ96tNw7ZHGjK2zZ51dyol0tXDvKRGk2wF9waNG7aw/b8CxIb1KVkfnDx6 9gF46ldX6aAoRN25a4nNhMsuJRjwSSf3M4L4+Bla8XwCPetA6/31Rwk5QZINuMzmz0jBbW CkpdDfcAudLQSlwuxDoHY5+vaCBwDDgenU8YEpjU4aUvzVAzdG/LMnJ2FUYlqQ== 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 4WK3jH070KzQ0Y; Wed, 10 Jul 2024 16:49:07 +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 46AGn6Db034984; Wed, 10 Jul 2024 16:49:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGn6MU034981; Wed, 10 Jul 2024 16:49:06 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:06 GMT Message-Id: <202407101649.46AGn6MU034981@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: d4b65f3f53ee - stable/14 - sound: Make DSP_FIXUP_ERROR() regular code 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: d4b65f3f53ee84a1f744bc74111911d61e86304d Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d4b65f3f53ee84a1f744bc74111911d61e86304d commit d4b65f3f53ee84a1f744bc74111911d61e86304d Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:50 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Make DSP_FIXUP_ERROR() regular code No reason to have this as a macro. While here, change the second case to an "else if" as there is no reason to check it if the open flags are invalid. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45776 (cherry picked from commit adc1713fb13f89a6eb33f5de840c981d0e17e4b7) --- sys/dev/sound/pcm/dsp.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 26a2919ed1da..27c89c3231b7 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -287,15 +287,6 @@ skip: priv = NULL; } -#define DSP_FIXUP_ERROR() do { \ - if (!DSP_F_VALID(flags)) \ - error = EINVAL; \ - if (!DSP_F_DUPLEX(flags) && \ - ((DSP_F_READ(flags) && d->reccount == 0) || \ - (DSP_F_WRITE(flags) && d->playcount == 0))) \ - error = ENOTSUP; \ -} while (0) - static int dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) { @@ -330,7 +321,12 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) PCM_WAIT(d); error = 0; - DSP_FIXUP_ERROR(); + if (!DSP_F_VALID(flags)) + error = EINVAL; + else if (!DSP_F_DUPLEX(flags) && + ((DSP_F_READ(flags) && d->reccount == 0) || + (DSP_F_WRITE(flags) && d->playcount == 0))) + error = ENOTSUP; if (pcm_getflags(d->dev) & SD_F_SIMPLEX) { if (DSP_F_DUPLEX(flags)) { /*