From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Alexandru Ardelean <ardeleanalex@gmail.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: [PATCH 2/9] iio: avoid shadowing of variable name in to_iio_dev_opaque()
Date: Mon, 26 Apr 2021 18:49:04 +0100 [thread overview]
Message-ID: <20210426174911.397061-3-jic23@kernel.org> (raw)
In-Reply-To: <20210426174911.397061-1-jic23@kernel.org>
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
indio_dev was both the macro input parameter and the field name
in this macro. That causes trouble if the instance of
struct iio_dev passed in is not called indio_dev.
Whilst a fix of sorts, no need to backport as it seems we never
hit this previously due to some very consistent naming in IIO.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
include/linux/iio/iio-opaque.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/iio/iio-opaque.h b/include/linux/iio/iio-opaque.h
index e66b029d99de..f876e3aede2c 100644
--- a/include/linux/iio/iio-opaque.h
+++ b/include/linux/iio/iio-opaque.h
@@ -48,7 +48,7 @@ struct iio_dev_opaque {
#endif
};
-#define to_iio_dev_opaque(indio_dev) \
- container_of(indio_dev, struct iio_dev_opaque, indio_dev)
+#define to_iio_dev_opaque(_indio_dev) \
+ container_of((_indio_dev), struct iio_dev_opaque, indio_dev)
#endif
--
2.31.1
next prev parent reply other threads:[~2021-04-26 17:50 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-26 17:49 [PATCH 0/9] iio: Move more things from iio_dev to iio_dev_opaque Jonathan Cameron
2021-04-26 17:49 ` [PATCH 1/9] iio: core: move @id from struct iio_dev to struct iio_dev_opaque Jonathan Cameron
2021-04-27 7:44 ` Alexandru Ardelean
2021-04-27 17:16 ` Jonathan Cameron
2021-05-03 11:42 ` Jonathan Cameron
2021-04-26 17:49 ` Jonathan Cameron [this message]
2021-04-27 7:45 ` [PATCH 2/9] iio: avoid shadowing of variable name in to_iio_dev_opaque() Alexandru Ardelean
2021-04-26 17:49 ` [PATCH 3/9] iio: core: move @driver_module from struct iio_dev to struct iio_dev_opaque Jonathan Cameron
2021-04-28 6:55 ` Alexandru Ardelean
2021-04-26 17:49 ` [PATCH 4/9] iio: core: move @trig_readonly " Jonathan Cameron
2021-04-27 8:03 ` Alexandru Ardelean
2021-04-26 17:49 ` [PATCH 5/9] iio: core: move @scan_index_timestamp " Jonathan Cameron
2021-04-27 8:03 ` Alexandru Ardelean
2021-04-26 17:49 ` [PATCH 6/9] iio: core: move @info_exist_lock " Jonathan Cameron
2021-04-27 8:04 ` Alexandru Ardelean
2021-04-26 17:49 ` [PATCH 7/9] iio: core: move @chrdev from struct iio_dev " Jonathan Cameron
2021-04-27 8:06 ` Alexandru Ardelean
2021-04-27 17:17 ` Jonathan Cameron
2021-04-26 17:49 ` [PATCH 8/9] iio: core: move @flags " Jonathan Cameron
2021-04-27 8:07 ` Alexandru Ardelean
2021-04-26 17:49 ` [PATCH 9/9] iio: core: move @clock_id " Jonathan Cameron
2021-04-27 8:02 ` Alexandru Ardelean
2021-04-27 17:19 ` Jonathan Cameron
2021-04-27 8:08 ` [PATCH 0/9] iio: Move more things from iio_dev to iio_dev_opaque Alexandru Ardelean
2021-04-27 17:12 ` Jonathan Cameron
2021-04-28 6:55 ` Alexandru Ardelean
2021-05-03 11:53 ` 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=20210426174911.397061-3-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=ardeleanalex@gmail.com \
--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