From: Jonathan Cameron <jic23@kernel.org>
To: Maxwell Doose <m32285159@gmail.com>
Cc: salih.erim@amd.com, conall.ogriofa@amd.com, michal.simek@amd.com,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org (open list:XILINX AMS DRIVER),
linux-arm-kernel@lists.infradead.org (moderated list:ARM/ZYNQ
ARCHITECTURE), linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH] iio: adc: xilinx-ams: Replace spin_lock() and unlock() calls with guard(spinlock*)()
Date: Wed, 6 May 2026 16:51:12 +0100 [thread overview]
Message-ID: <20260506165112.4425c378@jic23-huawei> (raw)
In-Reply-To: <20260504214613.121283-1-m32285159@gmail.com>
On Mon, 4 May 2026 16:46:12 -0500
Maxwell Doose <m32285159@gmail.com> wrote:
> Include linux/cleanup.h to take advantage of RAII macros.
>
> Replace spin_lock() and unlock() calls with their RAII macro
> counterparts. This will help modernize the code and increase readability.
>
> Remove "flags" variables where spin_lock_irqsave() has been replaced
> with guard(spinlock_irqsave)()
>
> Signed-off-by: Maxwell Doose <m32285159@gmail.com>
Hi Maxwell
One thing inline.
Thanks,
Jonathan
> static void ams_enable_channel_sequence(struct iio_dev *indio_dev)
> @@ -1060,9 +1058,8 @@ static void ams_unmask_worker(struct work_struct *work)
> {
> struct ams *ams = container_of(work, struct ams, ams_unmask_work.work);
>
> - spin_lock_irq(&ams->intr_lock);
> + guard(spinlock_irq)(&ams->intr_lock);
This increases the scope to include scheduling delayed work. Seems unwise
in general and should definitely be mentioned in the commit message.
Use a scoped_guard() here probably or leave it alone.
> ams_unmask(ams);
> - spin_unlock_irq(&ams->intr_lock);
>
> /* If still pending some alarm re-trigger the timer */
> if (ams->current_masked_alarm)
next prev parent reply other threads:[~2026-05-06 15:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 21:46 [PATCH] iio: adc: xilinx-ams: Replace spin_lock() and unlock() calls with guard(spinlock*)() Maxwell Doose
2026-05-06 15:51 ` Jonathan Cameron [this message]
2026-05-06 16:15 ` Maxwell Doose
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=20260506165112.4425c378@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=conall.ogriofa@amd.com \
--cc=dlechner@baylibre.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m32285159@gmail.com \
--cc=michal.simek@amd.com \
--cc=nuno.sa@analog.com \
--cc=salih.erim@amd.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