linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Use void pointers instead of char in I2C transfer APIs
@ 2019-11-12 20:31 Dmitry Torokhov
  2019-11-12 20:31 ` [PATCH v3 1/3] i2c: use void pointers for supplying data for reads and writes Dmitry Torokhov
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Dmitry Torokhov @ 2019-11-12 20:31 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-iio, Luca Ceresoli, linux-i2c, linux-kernel,
	Hartmut Knaack, Jonathan Cameron, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio

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


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-01-11 21:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 20:31 [PATCH v3 0/3] Use void pointers instead of char in I2C transfer APIs Dmitry Torokhov
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

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).