From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-iio@vger.kernel.orgi, Luca Ceresoli <luca@lucaceresoli.net>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Hartmut Knaack <knaack.h@gmx.de>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org
Subject: [PATCH v3 0/3] Use void pointers instead of char in I2C transfer APIs
Date: Tue, 12 Nov 2019 12:31:29 -0800 [thread overview]
Message-ID: <20191112203132.163306-1-dmitry.torokhov@gmail.com> (raw)
While we indeed often deal with a stream of bytes when executing a
transfer, at the higher layers we usually work with more structured
data, and there is not really a reason to require casts to u8 * form the
callers. These series change I2C APIs to accept [const] void pointers,
and also adjust SMBUS implementation to use get/put_unaligned_16() and
memcpy() for moving data around.
Changes in v3:
- addressed Luca's comments
- added Jonathan's Acked-by
- split put_unaligned_le16 into a separate patch
- more call sites converted to get/put_unaligned_le16
- new patch using memcpy() for moving data around
Changes in v2:
- adjusted max1363 to the new i2c_master_send/recv signatures
Dmitry Torokhov (3):
i2c: use void pointers for supplying data for reads and writes
i2c: smbus: use get/put_unaligned_le16 when working with word data
i2c: smbus: switch from loops to memcpy
drivers/i2c/i2c-core-base.c | 2 +-
drivers/i2c/i2c-core-smbus.c | 40 +++++++++++++++---------------------
drivers/iio/adc/max1363.c | 14 +++++++------
include/linux/i2c.h | 28 +++++++++++++------------
4 files changed, 41 insertions(+), 43 deletions(-)
--
2.24.0.rc1.363.gb1bccd3e3d-goog
next reply other threads:[~2019-11-12 20:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 20:31 Dmitry Torokhov [this message]
2019-11-12 20:31 ` [PATCH v3 1/3] i2c: use void pointers for supplying data for reads and writes Dmitry Torokhov
2019-11-13 9:47 ` Luca Ceresoli
2019-11-18 7:43 ` Uwe Kleine-König
2019-11-18 8:04 ` Dmitry Torokhov
2019-11-18 8:38 ` Uwe Kleine-König
2021-01-11 21:02 ` Wolfram Sang
2019-11-12 20:31 ` [PATCH v3 2/3] i2c: smbus: use get/put_unaligned_le16 when working with word data Dmitry Torokhov
2019-11-13 9:47 ` Luca Ceresoli
2019-11-13 19:39 ` Dmitry Torokhov
2019-11-14 9:23 ` Luca Ceresoli
2019-11-18 7:36 ` Uwe Kleine-König
2021-01-11 21:04 ` Wolfram Sang
2019-11-12 20:31 ` [PATCH v3 3/3] i2c: smbus: switch from loops to memcpy Dmitry Torokhov
2019-11-13 9:47 ` Luca Ceresoli
2019-11-18 7:47 ` Uwe Kleine-König
2019-11-18 8:09 ` Dmitry Torokhov
2019-11-18 8:47 ` Uwe Kleine-König
2021-01-11 21:04 ` Wolfram Sang
2021-01-11 21:01 ` [PATCH v3 0/3] Use void pointers instead of char in I2C transfer APIs Wolfram Sang
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=20191112203132.163306-1-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-iio@vger.kernel.orgi \
--cc=linux-kernel@vger.kernel.org \
--cc=luca@lucaceresoli.net \
--cc=pmeerw@pmeerw.net \
--cc=wsa@the-dreams.de \
/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 NNTP newsgroup(s).