From: Mark Brown <broonie@kernel.org>
To: phucduc.bui@gmail.com
Cc: Olivier Moysan <olivier.moysan@foss.st.com>,
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] ASoC: stm: stm32_i2s: Use guard() for spin locks
Date: Thu, 14 May 2026 10:25:48 +0900 [thread overview]
Message-ID: <agUknFcDIfwrOCld@sirena.co.uk> (raw)
In-Reply-To: <20260513104329.81592-3-phucduc.bui@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 644 bytes --]
On Wed, May 13, 2026 at 05:43:27PM +0700, phucduc.bui@gmail.com wrote:
> @@ -1016,21 +1014,18 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
> I2S_IER_OVRIE,
> (unsigned int)~I2S_IER_OVRIE);
>
> - spin_lock(&i2s->lock_fd);
> - i2s->refcount--;
> - if (i2s->refcount) {
> - spin_unlock(&i2s->lock_fd);
> - break;
> - }
> + scoped_guard(spinlock, &i2s->lock_fd) {
> + i2s->refcount--;
> + if (i2s->refcount)
> + break;
How does scoped_guard interact with break statements - does this still
apply to the switch? I've not looked at how they're implemented...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-05-14 1:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 10:43 [PATCH 0/4] ASoC: stm: Use guard() for mutex & spin locks phucduc.bui
2026-05-13 10:43 ` [PATCH 1/4] ASoC: stm: stm32_adfsdm: Use guard() for mutex locks phucduc.bui
2026-05-13 10:43 ` [PATCH 2/4] ASoC: stm: stm32_i2s: Use guard() for spin locks phucduc.bui
2026-05-14 1:25 ` Mark Brown [this message]
2026-05-14 10:33 ` Bui Duc Phuc
2026-05-13 10:43 ` [PATCH 3/4] ASoC: stm: stm32_sai_sub: Use guard() for mutex & " phucduc.bui
2026-05-13 10:43 ` [PATCH 4/4] ASoC: stm: stm32_spdifrx: Use guard() for " phucduc.bui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=agUknFcDIfwrOCld@sirena.co.uk \
--to=broonie@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=arnaud.pouliquen@foss.st.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=olivier.moysan@foss.st.com \
--cc=perex@perex.cz \
--cc=phucduc.bui@gmail.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox