Re: [PATCH v4] iio: magnetometer: bmc150_magn: cleanup mutex usage and coding style
From: Andy Shevchenko
Date: Sun Feb 08 2026 - 08:20:01 EST
On Fri, Feb 06, 2026 at 12:18:14PM -0500, Neel Bullywon wrote:
> Replace manual mutex lock/unlock calls with guard() to simplify error
>
> handling and reduce goto usage. This ensures RAII-style cleanup where
>
> the mutex is always released automatically.
>
> Replace msleep(5) with usleep_range(5000, 6000) to avoid checkpatch
>
> warnings about short msleep delays.
>
> Also fix several indentation and line wrapping style issues to verify
>
> cleanly with checkpatch.
You commit message is interleaved with unneeded blank lines. Something is wrong
on your side.
> Signed-off-by: Neel Bullywon <neelb2403@xxxxxxxxx>
> ---
> Changes in v4:
> - Replace scoped_guard() with guard() to avoid lexical scope issues with goto
> and return values which caused logic errors in previous versions.
> - Replace msleep(5) with usleep_range(5000, 6000) to avoid checkpatch
> warning.
No, please, fix checkpatch first, it should suggest fsleep() and that is
what you should use.
> - Fix indentation and line wrapping to cleanliness.
> - Extend guard() usage to all mutex_lock() instances in the driver.
--
With Best Regards,
Andy Shevchenko