From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Maxwell Doose <m32285159@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
songqiang1304521@gmail.com, dlechner@baylibre.com,
nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] iio: magnetometer: rm3100: Modernize locking and refactor control flow
Date: Wed, 29 Apr 2026 21:26:14 +0300 [thread overview]
Message-ID: <afJNRnuQGnnQPA4w@ashevche-desk.local> (raw)
In-Reply-To: <CAKqfh0HnQADMZhxn0OEp0jV2BVGKP+wRyAMOS4g9OOm+QSv_6Q@mail.gmail.com>
On Wed, Apr 29, 2026 at 10:19:14AM -0500, Maxwell Doose wrote:
> On Wed, Apr 29, 2026 at 5:42 AM Jonathan Cameron <jic23@kernel.org> wrote:
...
> If I find other patterns that do this kind of:
> lock(&my_mutex);
> ret = my_function(params);
> unlock(&my_mutex);
> then it may be a good idea to consider writing a helper-wrapper in a
> header that takes in a function pointer and its params. It would take
> more thought, and we'd probably have to avoid variadic arguments, but
> it may be a good idea just so we can keep the same scope and keep the
> logic clean.
Won't fly. I am pretty sure most of the maintainers find that bad. The problem
is that the caller should be crystal clear to show what the critical section
is. Hiding that information behind macros drastically reduces understanding of
the code,
...
> I think that would be sound
> for a separate patch. I'd ordinarily include that in this patch, but I
> feel at that point we might be deviating from the original purpose of
> the patch.
I agree.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-04-29 18:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 22:26 [PATCH v3] iio: magnetometer: rm3100: Modernize locking and refactor control flow Maxwell Doose
2026-04-29 9:12 ` Andy Shevchenko
2026-04-29 14:26 ` Maxwell Doose
2026-04-29 18:22 ` Andy Shevchenko
2026-04-29 18:58 ` Maxwell Doose
2026-04-29 10:41 ` Jonathan Cameron
2026-04-29 15:19 ` Maxwell Doose
2026-04-29 18:26 ` Andy Shevchenko [this message]
2026-04-29 19:00 ` Maxwell Doose
2026-04-29 19:12 ` Andy Shevchenko
2026-04-29 20:38 ` 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=afJNRnuQGnnQPA4w@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m32285159@gmail.com \
--cc=nuno.sa@analog.com \
--cc=songqiang1304521@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