From: Nuno Sa <nuno.sa@analog.com>
To: <linux-iio@vger.kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH v3 0/4] iio: move IIO to the cleanup.h magic
Date: Thu, 29 Feb 2024 16:10:24 +0100 [thread overview]
Message-ID: <20240229-iio-use-cleanup-magic-v3-0-c3d34889ae3c@analog.com> (raw)
Hi,
In v3, I decided to drop the scope_guard_cond() usage (which meant
dropping the event patch). Given the discussion on the cond_guard()
patches, I think it's better to hold those conversions a bit
since Linus came with a suggestion that will potentially change
scope_guard_cond() - and for the better IMO.
Another significant change is the __free(kfree) in all allocations in
inkern.c. I have to admit that I'm not a fan of the in place declaration
(too much time looking at kernel code I guess) but it makes the style
more consistent (as we are doing the automatic cleanup in the locks).
v1:
* https://lore.kernel.org/all/20240221-iio-use-cleanup-magic-v1-0-f9c292666f26@analog.com/
v2:
* https://lore.kernel.org/r/20240223-iio-use-cleanup-magic-v2-0-f6b4848c1f34@analog.com
v3:
- Patch 1:
* Do not use scope_guard_cond();
* Directly return -ENODEV and don't initialize ret.
- Patch 2:
* Removed bonus space;
* Used the normal error check flow in iio_trigger_get_irq().
- Patch 3:
* Refactored the state and ret conditions in iio_scan_mask_query();
* Removed ternary operator check in enable_store().
- Patch 4:
* Still use goto at the error patch in iio_map_array_unregister_locked();
* Used __free(kfree) + return_ptr() in places where allocations are
done;
* Keep the else branch in iio_read_channel_processed_scale();
* Removed the comment in iio_channel_read_min().
---
Nuno Sa (4):
iio: core: move to cleanup.h magic
iio: trigger: move to the cleanup.h magic
iio: buffer: iio: core: move to the cleanup.h magic
iio: inkern: move to the cleanup.h magic
drivers/iio/industrialio-buffer.c | 122 +++++++-----------
drivers/iio/industrialio-core.c | 34 ++---
drivers/iio/industrialio-trigger.c | 71 +++++------
drivers/iio/inkern.c | 255 +++++++++++++------------------------
4 files changed, 176 insertions(+), 306 deletions(-)
---
base-commit: 3cc5ebd3a2d6247aeba81873d6b040d5d87f7db1
change-id: 20240223-iio-use-cleanup-magic-9efe3b0a073d
--
Thanks!
- Nuno Sá
next reply other threads:[~2024-02-29 15:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 15:10 Nuno Sa [this message]
2024-02-29 15:10 ` [PATCH v3 1/4] iio: core: move to cleanup.h magic Nuno Sa
2024-02-29 15:10 ` [PATCH v3 2/4] iio: trigger: move to the " Nuno Sa
2024-03-16 19:32 ` Andy Shevchenko
2024-03-18 12:33 ` Jonathan Cameron
2024-03-18 13:12 ` Andy Shevchenko
2024-03-18 14:15 ` Jonathan Cameron
2024-03-16 19:39 ` Andy Shevchenko
2024-03-18 9:22 ` Nuno Sá
2024-02-29 15:10 ` [PATCH v3 3/4] iio: buffer: iio: core: " Nuno Sa
2024-03-16 19:38 ` Andy Shevchenko
2024-03-18 9:23 ` Nuno Sá
2024-03-18 12:35 ` Jonathan Cameron
2024-03-16 19:49 ` Andy Shevchenko
2024-02-29 15:10 ` [PATCH v3 4/4] iio: inkern: " Nuno Sa
2024-03-03 14:24 ` Jonathan Cameron
2024-03-04 8:04 ` Nuno Sá
2024-03-09 17:41 ` Jonathan Cameron
2024-03-16 13:26 ` Jonathan Cameron
2024-03-16 19:48 ` Andy Shevchenko
2024-03-18 9:20 ` Nuno Sá
2024-03-23 18:09 ` 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=20240229-iio-use-cleanup-magic-v3-0-c3d34889ae3c@analog.com \
--to=nuno.sa@analog.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).