All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] iio: magnetometer: rm3100: Modernize locking and control flow
@ 2026-04-28  2:43 Maxwell Doose
  2026-04-28  2:43 ` [PATCH 1/4] iio: magnetometer: rm3100: Use scoped_guard() in rm3100_read_mag() Maxwell Doose
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Maxwell Doose @ 2026-04-28  2:43 UTC (permalink / raw)
  To: songqiang1304521, jic23; +Cc: dlechner, nuno.sa, andy, linux-iio, linux-kernel

The goal of this patch series is to replace the manual mutex_lock() and
mutex_unlock() calls in rm3100-core.c with their more modern
counterparts, guard(mutex)() and scoped_guard(). I've also done some
minor cleanups, removing what are now redundant gotos, and enabling
direct returns.

Following feedback on recent commits, I've learned that it's a better
idea to split changes to be more atomic, and I've done that here in
case any particular change *somehow* causes a build regression. The
changes have been test-compiled however, and according to make, smatch,
and sparse, should be sound.

Maxwell Doose (4):
  iio: magnetometer: rm3100: Use scoped_guard() in rm3100_read_mag()
  iio: magnetometer: rm3100: Use scoped_guard() in
    rm3100_get_samp_freq()
  iio: magnetometer: rm3100: Use guard(mutex)() in
    rm3100_set_samp_freq()
  iio: magnetometer: rm3100: Use scoped_guard in
    rm3100_trigger_handler()

 drivers/iio/magnetometer/rm3100-core.c | 129 +++++++++++--------------
 1 file changed, 56 insertions(+), 73 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH 0/4] iio: magnetometer: rm3100: Modernize locking and control flow
@ 2026-04-28 12:46 Maxwell Doose
  0 siblings, 0 replies; 12+ messages in thread
From: Maxwell Doose @ 2026-04-28 12:46 UTC (permalink / raw)
  To: songqiang1304521, jic23; +Cc: dlechner, nuno.sa, andy, linux-iio, linux-kernel

The goal of this patch series is to replace the manual mutex_lock() and
mutex_unlock() calls in rm3100-core.c with their more modern
counterparts, guard(mutex)() and scoped_guard(). I've also done some
minor cleanups, removing what are now redundant gotos, and enabling
direct returns.

Following feedback on recent commits, I've learned that it's a better
idea to split changes to be more atomic, and I've done that here in
case any particular change *somehow* causes a build regression. The
changes have been test-compiled however, and according to make, smatch,
and sparse, should be sound.

=== Changelog ===
v2:
 - Added small style fixes per Andy's suggestions (Adding blank lines,
   moving an if statement in a scoped_guard block).
 - Switched out scoped_guard() for guard(mutex)() in certain commits.
 - Fixed error in commit 4 where deadlocks could occur, as goto ignores
   __attribute__((cleanup)). This has been fixed by the above.

Maxwell Doose (4):
  iio: magnetometer: rm3100: Use guard(mutex)() in rm3100_read_mag()
  iio: magnetometer: rm3100: Use scoped_guard() in
    rm3100_get_samp_freq()
  iio: magnetometer: rm3100: Use guard(mutex)() in
    rm3100_set_samp_freq()
  iio: magnetometer: rm3100: Use guard(mutex)() in
    rm3100_trigger_handler()

 drivers/iio/magnetometer/rm3100-core.c | 63 ++++++++++----------------
 1 file changed, 24 insertions(+), 39 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-04-28 12:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28  2:43 [PATCH 0/4] iio: magnetometer: rm3100: Modernize locking and control flow Maxwell Doose
2026-04-28  2:43 ` [PATCH 1/4] iio: magnetometer: rm3100: Use scoped_guard() in rm3100_read_mag() Maxwell Doose
2026-04-28  8:27   ` Andy Shevchenko
2026-04-28  2:43 ` [PATCH 2/4] iio: magnetometer: rm3100: Use scoped_guard() in rm3100_get_samp_freq() Maxwell Doose
2026-04-28  8:24   ` Andy Shevchenko
2026-04-28  2:43 ` [PATCH 3/4] iio: magnetometer: rm3100: Use guard(mutex)() in rm3100_set_samp_freq() Maxwell Doose
2026-04-28  8:28   ` Andy Shevchenko
2026-04-28 11:18     ` Maxwell Doose
2026-04-28  2:43 ` [PATCH 4/4] iio: magnetometer: rm3100: Use scoped_guard in rm3100_trigger_handler() Maxwell Doose
2026-04-28 10:05   ` Andy Shevchenko
2026-04-28 11:17     ` Maxwell Doose
  -- strict thread matches above, loose matches on Subject: below --
2026-04-28 12:46 [PATCH 0/4] iio: magnetometer: rm3100: Modernize locking and control flow Maxwell Doose

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.