mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Gabriel Rondon <grondon@gmail.com>
Cc: jic23@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, andy@kernel.org,
	nuno.sa@analog.com, dlechner@baylibre.com, sozdayvek@gmail.com
Subject: Re: [PATCH v3] iio: accel: bmc150: use guard(mutex) for mutex handling
Date: Fri, 5 Jun 2026 20:56:52 +0300	[thread overview]
Message-ID: <aiMN5N8LJ_m1rdUa@ashevche-desk.local> (raw)
In-Reply-To: <20260525110130.61284-1-grondon@gmail.com>

On Mon, May 25, 2026 at 12:01:27PM +0100, Gabriel Rondon wrote:
> Replace manual mutex_lock()/mutex_unlock() pairs with guard(mutex)
> and scoped_guard() from cleanup.h. This simplifies error paths by
> removing the need for explicit unlock calls before returning.
> 
> Most converted functions hold the lock for their entire body, so
> guard(mutex) applies directly. bmc150_accel_trigger_handler() only
> holds the lock around a single register read, so scoped_guard() is
> used there to keep the lock scope unchanged.

The last paragraph is matter of the comment block or cover letter
(but currently it's a single patch, however with the below it becomes
 a series).

...

>  #include <linux/module.h>
>  #include <linux/i2c.h>
>  #include <linux/interrupt.h>
> +#include <linux/cleanup.h>
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/acpi.h>

Please, add a preparatory patch to sort headers alphabetically first.

-- 
With Best Regards,
Andy Shevchenko



      parent reply	other threads:[~2026-06-05 17:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 11:01 Gabriel Rondon
2026-05-25 20:34 ` Maxwell Doose
2026-05-27 17:15   ` Jonathan Cameron
2026-06-05 17:56 ` Andy Shevchenko [this message]

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=aiMN5N8LJ_m1rdUa@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=grondon@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=sozdayvek@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

all inboxes | Powered by JetHome®