Linux IIO development
 help / color / mirror / Atom feed
From: Pedro Barletta Gennari <pedro.pbg@usp.br>
To: andy@kernel.org, dlechner@baylibre.com, jic23@kernel.org,
	nuno.sa@analog.com
Cc: pedro.pbg@usp.br, linux-iio@vger.kernel.org
Subject: [PATCH v3 0/2] iio: light: iqs621-als: use lock guards and prefer early error handling
Date: Tue, 28 Apr 2026 22:29:53 -0300	[thread overview]
Message-ID: <20260429013640.26870-1-pedro.pbg@usp.br> (raw)

Use guard(mutex)() for handling mutex lock instead of manually
locking and unlocking the mutex and flip 'if (!ret)' to 'if (ret)'
to handle errors early in drivers/iio/light/iqs621-als.c

Patch 2 depends on patch 1

Signed-off-by: Pedro Barletta Gennari <pedro.pbg@usp.br>
---
v3:
  - Remove unnecessary { }
  - Remove unnecessary ret initialization
  - Flip 'if (!ret)' to 'if (ret)'
v2:
  - Keep include list ordered
  - Remove redundant 'else'
  - Remove unnecessary variable 'ret'
---

Pedro Barletta Gennari (2):
  iio: light: iqs621-als: use lock guards
  iio: light: iqs621-als: prefer early error handling over if (!ret)

 drivers/iio/light/iqs621-als.c | 111 +++++++++++++--------------------
 1 file changed, 43 insertions(+), 68 deletions(-)

-- 
2.51.0


             reply	other threads:[~2026-04-29  1:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  1:29 Pedro Barletta Gennari [this message]
2026-04-29  1:29 ` [PATCH v3 1/2] iio: light: iqs621-als: use lock guards Pedro Barletta Gennari
2026-04-29  1:29 ` [PATCH v3 2/2] iio: light: iqs621-als: prefer early error handling over if (!ret) Pedro Barletta Gennari
2026-04-29 20:01 ` [PATCH v3 0/2] iio: light: iqs621-als: use lock guards and prefer early error handling Andy Shevchenko
2026-05-05 16:35   ` 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=20260429013640.26870-1-pedro.pbg@usp.br \
    --to=pedro.pbg@usp.br \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --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