Re: [PATCH v3] iio: magnetometer: rm3100: Modernize locking and refactor control flow

Andy Shevchenko
2026-04-29T19:12:35Z

On Wed, Apr 29, 2026 at 02:00:05PM -0500, Maxwell Doose wrote:
> On Wed, Apr 29, 2026 at 1:26 PM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> >
> > 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,
>
> Was just a thought. Even if it were to be implemented, it certainly
> wouldn't be a macro.

Still the locking wrapper that takes function as a parameter doesn't smell good
to me. The reason is the same, hiding important details of critical section,
decreases readability. Also long term maintenance might suffer if one needs to
alter that piece of code.

--
With Best Regards,
Andy Shevchenko