public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: lauraarakaki <lauraarakaki23@gmail.com>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: temperature: tsys02d: Use guard(mutex) in tsys02d_write_raw()
Date: Wed, 22 Apr 2026 10:29:58 +0300	[thread overview]
Message-ID: <aeh49pjtFDNpgqCJ@ashevche-desk.local> (raw)
In-Reply-To: <20260421154007.1114389-1-lauraarakaki23@gmail.com>

On Tue, Apr 21, 2026 at 12:40:01PM -0300, lauraarakaki wrote:
> Replace the manual mutex_lock()/mutex_unlock() pair in
> tsys02d_write_raw() with guard(mutex)() from the scope-based
> cleanup helpers (include/linux/cleanup.h).
> 
> The previous code stored the return value of
> ms_sensors_write_resolution() in a local variable solely to
> bridge the gap between the manual mutex_unlock() call and the
> return statement. Using guard(mutex)() removes the need for
> both the intermediate variable and the explicit unlock call,
> since the mutex is released automatically when the function
> goes out of scope.
> 
> No functional change intended.

> Signed-off-by: lauraarakaki <lauraarakaki23@gmail.com>

Read documentation, you need to use real name (as in documents).

> ---
>  
> +#include <linux/cleanup.h>
>  #include <linux/init.h>
>  #include <linux/device.h>
>  #include <linux/kernel.h>

Preferable to get a prerequisite that sorts headers alphabetically and
(optionally) another patch to move to follow IWYU principle.

...

Now the most important point of this review. All of the above you may
get by helping in reviewing the patches in Linux IIO mailing list
(lore.kernel.org/linux-iio).

TL;DR: I will be glad to see a newcomer to participate in the reviewing
first.

-- 
With Best Regards,
Andy Shevchenko



      parent reply	other threads:[~2026-04-22  7:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 15:40 [PATCH] iio: temperature: tsys02d: Use guard(mutex) in tsys02d_write_raw() lauraarakaki
2026-04-21 17:50 ` Jonathan Cameron
     [not found]   ` <CAJN_CScSHkrXGsF9pjWna5eYnRsPiwj47+7NbVYSVBGkwL3AJw@mail.gmail.com>
2026-04-22  7:26     ` Andy Shevchenko
2026-04-22  7:29 ` 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=aeh49pjtFDNpgqCJ@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=lauraarakaki23@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.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