public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Raffael Raiel Trindade <raffaelraiel@usp.br>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, Kim Carvalho <kim.ca@usp.br>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH v3] iio: light: vcnl4000: use lock guard()
Date: Mon, 20 Apr 2026 23:26:29 +0300	[thread overview]
Message-ID: <aeaL9ZvMEFF2OK0n@ashevche-desk.local> (raw)
In-Reply-To: <aeaKP2vARF-Bv1-2@ashevche-desk.local>

On Mon, Apr 20, 2026 at 11:19:11PM +0300, Andy Shevchenko wrote:
> On Mon, Apr 20, 2026 at 04:59:33PM -0300, Raffael Raiel Trindade wrote:
> 
> > Use guard() for handling mutex lock instead of manually locking and
> > unlocking. Remove gotos in error handling logic. This prevents forgotten
> > locks on early exits.

...

> >  	regval = (ret & ~VCNL4040_PS_CONF2_PS_IT) |
> >  	    FIELD_PREP(VCNL4040_PS_CONF2_PS_IT, index);
> 
> Side note: This can be simplified with FIELD_MODIFY().

To be clear, the patch LGTM, the above is a material for another if you
wish/have time to do so.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-04-20 20:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 19:59 [PATCH v3] iio: light: vcnl4000: use lock guard() Raffael Raiel Trindade
2026-04-20 20:19 ` Andy Shevchenko
2026-04-20 20:26   ` Andy Shevchenko [this message]
2026-04-20 20:40     ` Raffael Raiel Trindade
2026-04-21 14:49 ` Jonathan Cameron

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=aeaL9ZvMEFF2OK0n@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=kim.ca@usp.br \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=raffaelraiel@usp.br \
    /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