From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, kees@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] iio: ssp_sensors: ssp_spi: use guard() to release mutexes
Date: Mon, 16 Mar 2026 16:32:09 +0200 [thread overview]
Message-ID: <abgUaXpJOveAtAWF@ashevche-desk.local> (raw)
In-Reply-To: <20260315125509.857195-2-sanjayembedded@gmail.com>
On Sun, Mar 15, 2026 at 06:25:07PM +0530, Sanjay Chitroda wrote:
> Replace explicit mutex_lock() and mutex_unlock() with the guard() macro
> for cleaner and safer mutex handling.
TBH I don't see much benefit in this form. What I am thinking of is to refactor
to have the guard and timeout_cnt++ in the top level, and
static void ...(flag)
{
if (flag)
return;
guard(mutex)(&data->pending_lock);
list_add_tail(&msg->list, &data->pending_list);
}
helper for three (*yes, 3) repetitive code snippets.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-03-16 14:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-15 12:55 [PATCH v3 0/3] iio: ssp_sensors: improve resource cleanup with cleanup.h Sanjay Chitroda
2026-03-15 12:55 ` [PATCH v3 1/3] iio: ssp_sensors: ssp_spi: use guard() to release mutexes Sanjay Chitroda
2026-03-15 18:52 ` Jonathan Cameron
2026-03-16 14:32 ` Andy Shevchenko [this message]
2026-03-26 3:13 ` Sanjay Chitroda
2026-03-15 12:55 ` [PATCH v3 2/3] iio: ssp_sensors: simplify cleanup using __free Sanjay Chitroda
2026-03-15 18:54 ` Jonathan Cameron
2026-03-15 12:55 ` [PATCH v3 3/3] iio: ssp_sensors: cleanup codestyle warning Sanjay Chitroda
2026-03-15 18:55 ` Jonathan Cameron
2026-03-16 14:34 ` Andy Shevchenko
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=abgUaXpJOveAtAWF@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=kees@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=sanjayembeddedse@gmail.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