b4-sent.feeds.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Nuno Sa <nuno.sa@analog.com>
Subject: [PATCH 0/5] iio: move IIO to the cleanup.h magic
Date: Wed, 21 Feb 2024 14:26:51 +0100	[thread overview]
Message-ID: <20240221-iio-use-cleanup-magic-v1-0-f9c292666f26@analog.com> (raw)

This series moves the main IIO core files to the new cleanup.h
macros for acquiring and automatically releasing mutexes. This results (in
some cases) in way simpler code paths.

I think the overall result is fairly neat (mainly in inkern.c).

One thing to mention is in the iio_event_getfd() function. We might be
changing the return code. Before we directly returned the error code
returned by mutex_lock_interruptible(). Now we return -EINTR. And this
is something visible by userspace so it might mean an ABI breakage.

Having said the above, looking at the mutex_lock_interruptible() docs it
seems we either return 0 or -EINTR. Not sure if that is really truth
(but it does makes sense). On top of that, I would also say it's very
unlikely for someone to be relying on an error code return by a locking
function but who knows... Anyways, this is something worth mentioning.

Next goal is to convert the code under iio/buffer/

---
Nuno Sa (5):
      iio: core: move to cleanup.h magic
      iio: events: move to the 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  | 105 +++++++----------
 drivers/iio/industrialio-core.c    |  52 ++++-----
 drivers/iio/industrialio-event.c   |  42 +++----
 drivers/iio/industrialio-trigger.c |  64 +++++------
 drivers/iio/inkern.c               | 224 ++++++++++++-------------------------
 5 files changed, 172 insertions(+), 315 deletions(-)
---
base-commit: bd2f1ed8873d4bbb2798151bbe28c86565251cfb
change-id: 20240216-iio-use-cleanup-magic-29fc666a142b
--

Thanks!
- Nuno Sá


             reply	other threads:[~2024-02-21 13:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 13:26 Nuno Sa [this message]
2024-02-21 13:26 ` [PATCH 1/5] iio: core: move to cleanup.h magic Nuno Sa
2024-02-21 13:26 ` [PATCH 2/5] iio: events: move to the " Nuno Sa
2024-02-21 13:26 ` [PATCH 3/5] iio: trigger: " Nuno Sa
2024-02-21 13:26 ` [PATCH 4/5] iio: buffer: iio: core: " Nuno Sa
2024-02-21 13:26 ` [PATCH 5/5] iio: inkern: " Nuno Sa

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=20240221-iio-use-cleanup-magic-v1-0-f9c292666f26@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).