Skip to contentSkip to conversation

iio: adc: ad_sigma_delta: Use {get,put}_unaligned_be24()

PATCH Applied Andy Shevchenko 5 participants 39 messages Apr 21, 2020 – Apr 25, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/16 iio: adc: ad_sigma_delta: Use {get,put}_unaligned_be24()

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/adc/ad_sigma_delta.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/iio/adc/ad_sigma_delta.c +2 -6
index 8115b6de1d6c..dd3d54b3bc8b 100644
@@ -70,9 +70,7 @@ int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg,
 
 	switch (size) {
 	case 3:
-		data[1] = val >> 16;
-		data[2] = val >> 8;
-		data[3] = val;
+		put_unaligned_be24(val, &data[1]);
 		break;
 	case 2:
 		put_unaligned_be16(val, &data[1]);
@@ -157,9 +155,7 @@ int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta,
 		*val = get_unaligned_be32(sigma_delta->data);
 		break;
 	case 3:
-		*val = (sigma_delta->data[0] << 16) |
-			(sigma_delta->data[1] << 8) |
-			sigma_delta->data[2];
+		*val = get_unaligned_be24(&sigma_delta->data[0]);
 		break;
 	case 2:
 		*val = get_unaligned_be16(sigma_delta->data);
Signature · 1 line
2.26.1
#1 lore raw

PATCH 2/16 iio: adc: mpc3422: Use get_unaligned_beXX()

This makes the driver code slightly easier to read.

---
 drivers/iio/adc/mcp3422.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/mcp3422.c +2 -2
index ea24d7c58b12..b247eb209f10 100644
@@ -117,11 +117,11 @@ static int mcp3422_read(struct mcp3422 *adc, int *value, u8 *config)
 
 	if (sample_rate == MCP3422_SRATE_3) {
 		ret = i2c_master_recv(adc->i2c, buf, 4);
-		temp = buf[0] << 16 | buf[1] << 8 | buf[2];
+		temp = get_unaligned_be24(&buf[0]);
 		*config = buf[3];
 	} else {
 		ret = i2c_master_recv(adc->i2c, buf, 3);
-		temp = buf[0] << 8 | buf[1];
+		temp = get_unaligned_be16(&buf[0]);
 		*config = buf[2];
 	}
 
Signature · 1 line
2.26.1
maintainer Applied
#2 lore raw

Re: [PATCH v1 02/16] iio: adc: mpc3422: Use get_unaligned_beXX()

Quoted 3 lines · On Tue, 21 Apr 2020 03:31:21 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Looks good to me.

Applied

Thanks,

Jonathan

Quoted 22 lines
---
 drivers/iio/adc/mcp3422.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/mcp3422.c +2 -2
index ea24d7c58b12..b247eb209f10 100644
@@ -117,11 +117,11 @@ static int mcp3422_read(struct mcp3422 *adc, int *value, u8 *config)
 
 	if (sample_rate == MCP3422_SRATE_3) {
 		ret = i2c_master_recv(adc->i2c, buf, 4);
-		temp = buf[0] << 16 | buf[1] << 8 | buf[2];
+		temp = get_unaligned_be24(&buf[0]);
 		*config = buf[3];
 	} else {
 		ret = i2c_master_recv(adc->i2c, buf, 3);
-		temp = buf[0] << 8 | buf[1];
+		temp = get_unaligned_be16(&buf[0]);
 		*config = buf[2];
 	}
 
maintainer
#3 lore raw

Re: [PATCH v1 02/16] iio: adc: mpc3422: Use get_unaligned_beXX()

Quoted 10 lines · On Sat, 25 Apr 2020 17:14:20 +0100 Jonathan Cameron <[email protected]> wrote:
Quoted 3 lines · On Tue, 21 Apr 2020 03:31:21 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Looks good to me.

Applied

And doesn't build...

Needs
#include <asm/unaligned.h>

I've added it.

Jonathan

Quoted 27 lines

Thanks,

Jonathan

Quoted 22 lines
---
 drivers/iio/adc/mcp3422.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/mcp3422.c +2 -2
index ea24d7c58b12..b247eb209f10 100644
@@ -117,11 +117,11 @@ static int mcp3422_read(struct mcp3422 *adc, int *value, u8 *config)
 
 	if (sample_rate == MCP3422_SRATE_3) {
 		ret = i2c_master_recv(adc->i2c, buf, 4);
-		temp = buf[0] << 16 | buf[1] << 8 | buf[2];
+		temp = get_unaligned_be24(&buf[0]);
 		*config = buf[3];
 	} else {
 		ret = i2c_master_recv(adc->i2c, buf, 3);
-		temp = buf[0] << 8 | buf[1];
+		temp = get_unaligned_be16(&buf[0]);
 		*config = buf[2];
 	}
 
#4 lore raw

PATCH 3/16 iio: adc: ti-ads124s08: Use get_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/adc/ti-ads124s08.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/iio/adc/ti-ads124s08.c +1 -4
index 552c2be8d87a..2516e42ad00d 100644
@@ -188,7 +188,6 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan)
 {
 	struct ads124s_private *priv = iio_priv(indio_dev);
 	int ret;
-	u32 tmp;
 	struct spi_transfer t[] = {
 		{
 			.tx_buf = &priv->data[0],
@@ -208,9 +207,7 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan)
 	if (ret < 0)
 		return ret;
 
-	tmp = priv->data[2] << 16 | priv->data[3] << 8 | priv->data[4];
-
-	return tmp;
+	return get_unaligned_be24(&priv->data[2]);
 }
 
 static int ads124s_read_raw(struct iio_dev *indio_dev,
Signature · 1 line
2.26.1
maintainer
#5 lore raw

Re: [PATCH v1 03/16] iio: adc: ti-ads124s08: Use get_unaligned_be24()

Quoted 3 lines · On Tue, 21 Apr 2020 03:31:22 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Added
#include <asm/unaligned.h>
and applied.

Thanks,

Jonathan

Quoted 27 lines
---
 drivers/iio/adc/ti-ads124s08.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/iio/adc/ti-ads124s08.c +1 -4
index 552c2be8d87a..2516e42ad00d 100644
@@ -188,7 +188,6 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan)
 {
 	struct ads124s_private *priv = iio_priv(indio_dev);
 	int ret;
-	u32 tmp;
 	struct spi_transfer t[] = {
 		{
 			.tx_buf = &priv->data[0],
@@ -208,9 +207,7 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan)
 	if (ret < 0)
 		return ret;
 
-	tmp = priv->data[2] << 16 | priv->data[3] << 8 | priv->data[4];
-
-	return tmp;
+	return get_unaligned_be24(&priv->data[2]);
 }
 
 static int ads124s_read_raw(struct iio_dev *indio_dev,
#6 lore raw

Re: [PATCH v1 03/16] iio: adc: ti-ads124s08: Use get_unaligned_be24()

Quoted 10 lines · Jonathan Cameron
Quoted 3 lines · On Tue, 21 Apr 2020 03:31:22 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Added
#include <asm/unaligned.h>
and applied.

Thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw

PATCH 4/16 iio: dac: ltc2632: Use put_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/dac/ltc2632.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/dac/ltc2632.c +1 -3
index 7adc91056aa1..5123776cb63e 100644
@@ -75,9 +75,7 @@ static int ltc2632_spi_write(struct spi_device *spi,
 	 * 10-, 8-bit input code followed by 4, 6, or 8 don't care bits.
 	 */
 	data = (cmd << 20) | (addr << 16) | (val << shift);
-	msg[0] = data >> 16;
-	msg[1] = data >> 8;
-	msg[2] = data;
+	put_unaligned_be24(data, &msg[0]);
 
 	return spi_write(spi, msg, sizeof(msg));
 }
Signature · 1 line
2.26.1
maintainer
#8 lore raw

Re: [PATCH v1 04/16] iio: dac: ltc2632: Use put_unaligned_be24()

Quoted 3 lines · On Tue, 21 Apr 2020 03:31:23 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Applied with same include fix.

Jonathan

Quoted 19 lines
---
 drivers/iio/dac/ltc2632.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/dac/ltc2632.c +1 -3
index 7adc91056aa1..5123776cb63e 100644
@@ -75,9 +75,7 @@ static int ltc2632_spi_write(struct spi_device *spi,
 	 * 10-, 8-bit input code followed by 4, 6, or 8 don't care bits.
 	 */
 	data = (cmd << 20) | (addr << 16) | (val << shift);
-	msg[0] = data >> 16;
-	msg[1] = data >> 8;
-	msg[2] = data;
+	put_unaligned_be24(data, &msg[0]);
 
 	return spi_write(spi, msg, sizeof(msg));
 }
#9 lore raw

PATCH 5/16 iio: dac: ad5624r_spi: Use put_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/dac/ad5624r_spi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/iio/dac/ad5624r_spi.c +2 -4
index e6c022e1dc1c..394d9d23ba63 100644
@@ -35,11 +35,9 @@ static int ad5624r_spi_write(struct spi_device *spi,
 	 * for the AD5664R, AD5644R, and AD5624R, respectively.
 	 */
 	data = (0 << 22) | (cmd << 19) | (addr << 16) | (val << shift);
-	msg[0] = data >> 16;
-	msg[1] = data >> 8;
-	msg[2] = data;
+	put_unaligned_be24(data, &msg[0]);
 
-	return spi_write(spi, msg, 3);
+	return spi_write(spi, msg, sizeof(msg));
 }
 
 static int ad5624r_read_raw(struct iio_dev *indio_dev,
Signature · 1 line
2.26.1
maintainer Acked-by on v1 5/16
#10 lore raw

RE: [PATCH v1 05/16] iio: dac: ad5624r_spi: Use put_unaligned_be24()

Quoted 12 lines

From: [email protected] <[email protected]> On Behalf Of Andy Shevchenko
Sent: Dienstag, 21. April 2020 02:31
To: Jonathan Cameron <[email protected]>; Peter Meerwald-Stadler <[email protected]>; [email protected]
Cc: Andy Shevchenko <[email protected]>; Lars-Peter Clausen <[email protected]>; Hennerich, Michael <[email protected]>
Subject: [PATCH v1 05/16] iio: dac: ad5624r_spi: Use put_unaligned_be24()

Quoted 9 lines

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/dac/ad5624r_spi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
maintainer
#11 lore raw

Re: [PATCH v1 05/16] iio: dac: ad5624r_spi: Use put_unaligned_be24()

Quoted 21 lines · Nuno
Quoted 11 lines

From: [email protected] <[email protected]> On Behalf Of Andy Shevchenko
Sent: Dienstag, 21. April 2020 02:31
To: Jonathan Cameron <[email protected]>; Peter Meerwald-Stadler <[email protected]>; [email protected]
Cc: Andy Shevchenko <[email protected]>; Lars-Peter Clausen <[email protected]>; Hennerich, Michael <[email protected]>
Subject: [PATCH v1 05/16] iio: dac: ad5624r_spi: Use put_unaligned_be24()

Quoted 9 lines

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/dac/ad5624r_spi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Quoted 1 line

Applied with missing asm/unaligned header added.

Thanks,

J

#12 lore raw

PATCH 6/16 iio: dac: ad5446: Use put_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/dac/ad5446.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/dac/ad5446.c +1 -3
index 61c670f7fc5f..87ff863bdc10 100644
@@ -302,9 +302,7 @@ static int ad5660_write(struct ad5446_state *st, unsigned val)
 	struct spi_device *spi = to_spi_device(st->dev);
 	uint8_t data[3];
 
-	data[0] = (val >> 16) & 0xFF;
-	data[1] = (val >> 8) & 0xFF;
-	data[2] = val & 0xFF;
+	put_unaligned_be24(val, &data[0]);
 
 	return spi_write(spi, data, sizeof(data));
 }
Signature · 1 line
2.26.1
maintainer
#13 lore raw

Re: [PATCH v1 06/16] iio: dac: ad5446: Use put_unaligned_be24()

Quoted 5 lines · On Tue, 21 Apr 2020 03:31:25 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>

You've guessed it. Applied with missing header added.

Thanks, J

Quoted 19 lines
---
 drivers/iio/dac/ad5446.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/dac/ad5446.c +1 -3
index 61c670f7fc5f..87ff863bdc10 100644
@@ -302,9 +302,7 @@ static int ad5660_write(struct ad5446_state *st, unsigned val)
 	struct spi_device *spi = to_spi_device(st->dev);
 	uint8_t data[3];
 
-	data[0] = (val >> 16) & 0xFF;
-	data[1] = (val >> 8) & 0xFF;
-	data[2] = val & 0xFF;
+	put_unaligned_be24(val, &data[0]);
 
 	return spi_write(spi, data, sizeof(data));
 }
#14 lore raw

PATCH 7/16 iio: gyro: adis16130: Use get_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/gyro/adis16130.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/gyro/adis16130.c +1 -1
index 79e63c8a2ea8..b8d626bc30ad 100644
@@ -59,7 +59,7 @@ static int adis16130_spi_read(struct iio_dev *indio_dev, u8 reg_addr, u32 *val)
 
 	ret = spi_sync_transfer(st->us, &xfer, 1);
 	if (ret == 0)
-		*val = (st->buf[1] << 16) | (st->buf[2] << 8) | st->buf[3];
+		*val = get_unaligned_be24(&st->buf[1]);
 	mutex_unlock(&st->buf_lock);
 
 	return ret;
Signature · 1 line
2.26.1
maintainer Acked-by on v1 7/16
#15 lore raw

RE: [PATCH v1 07/16] iio: gyro: adis16130: Use get_unaligned_be24()

Quoted 11 lines

From: [email protected] <[email protected]> On Behalf Of Andy Shevchenko
Sent: Dienstag, 21. April 2020 02:31
To: Jonathan Cameron <[email protected]>; Peter Meerwald-Stadler <[email protected]>; [email protected]
Cc: Andy Shevchenko <[email protected]>; Lars-Peter Clausen <[email protected]>; Hennerich, Michael <[email protected]>
Subject: [PATCH v1 07/16] iio: gyro: adis16130: Use get_unaligned_be24()

Quoted 9 lines

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/gyro/adis16130.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
maintainer
#16 lore raw

Re: [PATCH v1 07/16] iio: gyro: adis16130: Use get_unaligned_be24()

Quoted 21 lines · Nuno
Quoted 11 lines

From: [email protected] <[email protected]> On Behalf Of Andy Shevchenko
Sent: Dienstag, 21. April 2020 02:31
To: Jonathan Cameron <[email protected]>; Peter Meerwald-Stadler <[email protected]>; [email protected]
Cc: Andy Shevchenko <[email protected]>; Lars-Peter Clausen <[email protected]>; Hennerich, Michael <[email protected]>
Subject: [PATCH v1 07/16] iio: gyro: adis16130: Use get_unaligned_be24()

Quoted 9 lines

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/gyro/adis16130.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 1 line

Applied with header added...
J

#17 lore raw

PATCH 8/16 iio: health: afe4403: Use get_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/health/afe4403.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/iio/health/afe4403.c +4 -8
index dc22dc363a99..db44b53e9330 100644
@@ -220,13 +220,11 @@ static int afe4403_read(struct afe4403_data *afe, unsigned int reg, u32 *val)
 	if (ret)
 		return ret;
 
-	ret = spi_write_then_read(afe->spi, &reg, 1, rx, 3);
+	ret = spi_write_then_read(afe->spi, &reg, 1, rx, sizeof(rx));
 	if (ret)
 		return ret;
 
-	*val = (rx[0] << 16) |
-		(rx[1] << 8) |
-		(rx[2]);
+	*val = get_unaligned_be24(&rx[0]);
 
 	/* Disable reading from the device */
 	tx[3] = AFE440X_CONTROL0_WRITE;
@@ -322,13 +320,11 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private)
 			 indio_dev->masklength) {
 		ret = spi_write_then_read(afe->spi,
 					  &afe4403_channel_values[bit], 1,
-					  rx, 3);
+					  rx, sizeof(rx));
 		if (ret)
 			goto err;
 
-		buffer[i++] = (rx[0] << 16) |
-				(rx[1] << 8) |
-				(rx[2]);
+		buffer[i++] = get_unaligned_be24(&rx[0]);
 	}
 
 	/* Disable reading from the device */
Signature · 1 line
2.26.1
maintainer
#18 lore raw

Re: [PATCH v1 08/16] iio: health: afe4403: Use get_unaligned_be24()

Quoted 3 lines · On Tue, 21 Apr 2020 03:31:27 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Applied with header include added.

J

Quoted 40 lines
---
 drivers/iio/health/afe4403.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/iio/health/afe4403.c +4 -8
index dc22dc363a99..db44b53e9330 100644
@@ -220,13 +220,11 @@ static int afe4403_read(struct afe4403_data *afe, unsigned int reg, u32 *val)
 	if (ret)
 		return ret;
 
-	ret = spi_write_then_read(afe->spi, &reg, 1, rx, 3);
+	ret = spi_write_then_read(afe->spi, &reg, 1, rx, sizeof(rx));
 	if (ret)
 		return ret;
 
-	*val = (rx[0] << 16) |
-		(rx[1] << 8) |
-		(rx[2]);
+	*val = get_unaligned_be24(&rx[0]);
 
 	/* Disable reading from the device */
 	tx[3] = AFE440X_CONTROL0_WRITE;
@@ -322,13 +320,11 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private)
 			 indio_dev->masklength) {
 		ret = spi_write_then_read(afe->spi,
 					  &afe4403_channel_values[bit], 1,
-					  rx, 3);
+					  rx, sizeof(rx));
 		if (ret)
 			goto err;
 
-		buffer[i++] = (rx[0] << 16) |
-				(rx[1] << 8) |
-				(rx[2]);
+		buffer[i++] = get_unaligned_be24(&rx[0]);
 	}
 
 	/* Disable reading from the device */
#19 lore raw

PATCH 9/16 iio: light: si1133: Use get_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

Cc Maxime Roussin-Bélanger <[email protected]>
---
 drivers/iio/light/si1133.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/iio/light/si1133.c +4 -12
index 9174ab928880..8931a8afbafc 100644
@@ -104,8 +104,6 @@
 #define SI1133_LUX_BUFFER_SIZE		9
 #define SI1133_MEASURE_BUFFER_SIZE	3
 
-#define SI1133_SIGN_BIT_INDEX 23
-
 static const int si1133_scale_available[] = {
 	1, 2, 4, 8, 16, 32, 64, 128};
 
@@ -633,8 +631,7 @@ static int si1133_measure(struct si1133_data *data,
 	if (err)
 		return err;
 
-	*val = sign_extend32((buffer[0] << 16) | (buffer[1] << 8) | buffer[2],
-			     SI1133_SIGN_BIT_INDEX);
+	*val = sign_extend32(get_unaligned_be24(&buffer[0]), 23);
 
 	return err;
 }
@@ -723,16 +720,11 @@ static int si1133_get_lux(struct si1133_data *data, int *val)
 	if (err)
 		return err;
 
-	high_vis =
-		sign_extend32((buffer[0] << 16) | (buffer[1] << 8) | buffer[2],
-			      SI1133_SIGN_BIT_INDEX);
+	high_vis = sign_extend32(get_unaligned_be24(&buffer[0]), 23);
 
-	low_vis =
-		sign_extend32((buffer[3] << 16) | (buffer[4] << 8) | buffer[5],
-			      SI1133_SIGN_BIT_INDEX);
+	low_vis = sign_extend32(get_unaligned_be24(&buffer[3]), 23);
 
-	ir = sign_extend32((buffer[6] << 16) | (buffer[7] << 8) | buffer[8],
-			   SI1133_SIGN_BIT_INDEX);
+	ir = sign_extend32(get_unaligned_be24(&buffer[6]), 23);
 
 	if (high_vis > SI1133_ADC_THRESHOLD || ir > SI1133_ADC_THRESHOLD)
 		lux = si1133_calc_polynomial(high_vis, ir,
Signature · 1 line
2.26.1
maintainer
#20 lore raw

Re: [PATCH v1 09/16] iio: light: si1133: Use get_unaligned_be24()

Quoted 4 lines · On Tue, 21 Apr 2020 03:31:28 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Cc Maxime Roussin-Bélanger <[email protected]>

Applied with asm/unaligned include added.

J

Quoted 47 lines
---
 drivers/iio/light/si1133.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/iio/light/si1133.c +4 -12
index 9174ab928880..8931a8afbafc 100644
@@ -104,8 +104,6 @@
 #define SI1133_LUX_BUFFER_SIZE		9
 #define SI1133_MEASURE_BUFFER_SIZE	3
 
-#define SI1133_SIGN_BIT_INDEX 23
-
 static const int si1133_scale_available[] = {
 	1, 2, 4, 8, 16, 32, 64, 128};
 
@@ -633,8 +631,7 @@ static int si1133_measure(struct si1133_data *data,
 	if (err)
 		return err;
 
-	*val = sign_extend32((buffer[0] << 16) | (buffer[1] << 8) | buffer[2],
-			     SI1133_SIGN_BIT_INDEX);
+	*val = sign_extend32(get_unaligned_be24(&buffer[0]), 23);
 
 	return err;
 }
@@ -723,16 +720,11 @@ static int si1133_get_lux(struct si1133_data *data, int *val)
 	if (err)
 		return err;
 
-	high_vis =
-		sign_extend32((buffer[0] << 16) | (buffer[1] << 8) | buffer[2],
-			      SI1133_SIGN_BIT_INDEX);
+	high_vis = sign_extend32(get_unaligned_be24(&buffer[0]), 23);
 
-	low_vis =
-		sign_extend32((buffer[3] << 16) | (buffer[4] << 8) | buffer[5],
-			      SI1133_SIGN_BIT_INDEX);
+	low_vis = sign_extend32(get_unaligned_be24(&buffer[3]), 23);
 
-	ir = sign_extend32((buffer[6] << 16) | (buffer[7] << 8) | buffer[8],
-			   SI1133_SIGN_BIT_INDEX);
+	ir = sign_extend32(get_unaligned_be24(&buffer[6]), 23);
 
 	if (high_vis > SI1133_ADC_THRESHOLD || ir > SI1133_ADC_THRESHOLD)
 		lux = si1133_calc_polynomial(high_vis, ir,
#21 lore raw

PATCH 10/16 iio: light: zopt2201: Use get_unaligned_le24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/light/zopt2201.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/zopt2201.c +1 -1
index 5f54f39e7a4c..0df45b42c091 100644
@@ -219,7 +219,7 @@ static int zopt2201_read(struct zopt2201_data *data, u8 reg)
 		goto fail;
 	mutex_unlock(&data->lock);
 
-	return (buf[2] << 16) | (buf[1] << 8) | buf[0];
+	return get_unaligned_le24(&buf[0]);
 
 fail:
 	mutex_unlock(&data->lock);
Signature · 1 line
2.26.1
maintainer
#22 lore raw

Re: [PATCH v1 10/16] iio: light: zopt2201: Use get_unaligned_le24()

Quoted 3 lines · On Tue, 21 Apr 2020 03:31:29 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Applied with asm/unaligned.h include added.

J

Quoted 17 lines
---
 drivers/iio/light/zopt2201.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/zopt2201.c +1 -1
index 5f54f39e7a4c..0df45b42c091 100644
@@ -219,7 +219,7 @@ static int zopt2201_read(struct zopt2201_data *data, u8 reg)
 		goto fail;
 	mutex_unlock(&data->lock);
 
-	return (buf[2] << 16) | (buf[1] << 8) | buf[0];
+	return get_unaligned_le24(&buf[0]);
 
 fail:
 	mutex_unlock(&data->lock);
#23 lore raw

PATCH 11/16 iio: magnetometer: rm3100: Use get_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/magnetometer/rm3100-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/magnetometer/rm3100-core.c +1 -2
index 7c20918d8108..b3ae9a6c439b 100644
@@ -223,8 +223,7 @@ static int rm3100_read_mag(struct rm3100_data *data, int idx, int *val)
 		goto unlock_return;
 	mutex_unlock(&data->lock);
 
-	*val = sign_extend32((buffer[0] << 16) | (buffer[1] << 8) | buffer[2],
-			     23);
+	*val = sign_extend32(get_unalinged_be24(&buffer[0]), 23);
 
 	return IIO_VAL_INT;
 
Signature · 1 line
2.26.1
maintainer
#24 lore raw

Re: [PATCH v1 11/16] iio: magnetometer: rm3100: Use get_unaligned_be24()

Quoted 4 lines · On Tue, 21 Apr 2020 03:31:30 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Header and typo (see below fixed)

Applied to the togreg branch of iio.git and pushed out as testing to see what else we missed :(

Quoted 9 lines
---
 drivers/iio/magnetometer/rm3100-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/magnetometer/rm3100-core.c +0 -0
index 7c20918d8108..b3ae9a6c439b 100644

drivers/iio/magnetometer/rm3100-core.c static int rm3100_read_mag(struct rm3100_data *data, int idx, int *val) · line 226

Quoted 6 lines
drivers/iio/magnetometer/rm3100-core.c +1 -2
@@ -223,8 +223,7 @@ static int rm3100_read_mag(struct rm3100_data *data, int idx, int *val)
 		goto unlock_return;
 	mutex_unlock(&data->lock);
 
-	*val = sign_extend32((buffer[0] << 16) | (buffer[1] << 8) | buffer[2],
-			     23);
+	*val = sign_extend32(get_unalinged_be24(&buffer[0]), 23);

unaligned

Quoted 3 lines
drivers/iio/magnetometer/rm3100-core.c +0 -0
 	return IIO_VAL_INT;
 
#25 lore raw

PATCH 12/16 iio: pressure: hp206c: Use get_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/pressure/hp206c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/pressure/hp206c.c +3 -3
index 3ac3632e7242..d746882eccc8 100644
@@ -93,12 +93,12 @@ static int hp206c_read_20bit(struct i2c_client *client, u8 cmd)
 	int ret;
 	u8 values[3];
 
-	ret = i2c_smbus_read_i2c_block_data(client, cmd, 3, values);
+	ret = i2c_smbus_read_i2c_block_data(client, cmd, sizeof(values), values);
 	if (ret < 0)
 		return ret;
-	if (ret != 3)
+	if (ret != sizeof(values))
 		return -EIO;
-	return ((values[0] & 0xF) << 16) | (values[1] << 8) | (values[2]);
+	return get_unaligned_be24(&values[0]) & GENMASK(19, 0);
 }
 
 /* Spin for max 160ms until DEV_RDY is 1, or return error. */
Signature · 1 line
2.26.1
maintainer
#26 lore raw

Re: [PATCH v1 12/16] iio: pressure: hp206c: Use get_unaligned_be24()

Quoted 3 lines · On Tue, 21 Apr 2020 03:31:31 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Applied with header added.

Jonathan

Quoted 24 lines
---
 drivers/iio/pressure/hp206c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/pressure/hp206c.c +3 -3
index 3ac3632e7242..d746882eccc8 100644
@@ -93,12 +93,12 @@ static int hp206c_read_20bit(struct i2c_client *client, u8 cmd)
 	int ret;
 	u8 values[3];
 
-	ret = i2c_smbus_read_i2c_block_data(client, cmd, 3, values);
+	ret = i2c_smbus_read_i2c_block_data(client, cmd, sizeof(values), values);
 	if (ret < 0)
 		return ret;
-	if (ret != 3)
+	if (ret != sizeof(values))
 		return -EIO;
-	return ((values[0] & 0xF) << 16) | (values[1] << 8) | (values[2]);
+	return get_unaligned_be24(&values[0]) & GENMASK(19, 0);
 }
 
 /* Spin for max 160ms until DEV_RDY is 1, or return error. */
#27 lore raw

PATCH 13/16 iio: pressure: ms5611: Use get_unaligned_be24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/pressure/ms5611_i2c.c | 2 +-
 drivers/iio/pressure/ms5611_spi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iio/pressure/ms5611_i2c.c +1 -1
index 8089c59adce5..ced83162ae94 100644
@@ -50,7 +50,7 @@ static int ms5611_i2c_read_adc(struct ms5611_state *st, s32 *val)
 	if (ret < 0)
 		return ret;
 
-	*val = (buf[0] << 16) | (buf[1] << 8) | buf[2];
+	*val = get_unaligned_be24(&buf[0]);
 
 	return 0;
 }
drivers/iio/pressure/ms5611_spi.c +1 -1
index b463eaa799ab..517295616869 100644
@@ -45,7 +45,7 @@ static int ms5611_spi_read_adc(struct device *dev, s32 *val)
 	if (ret < 0)
 		return ret;
 
-	*val = (buf[0] << 16) | (buf[1] << 8) | buf[2];
+	*val = get_unaligned_be24(&buf[0]);
 
 	return 0;
 }
Signature · 1 line
2.26.1
Acked-by on v1 13/16
#28 lore raw

Re: [PATCH v1 13/16] iio: pressure: ms5611: Use get_unaligned_be24()

Quoted 26 lines · Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/pressure/ms5611_i2c.c | 2 +-
 drivers/iio/pressure/ms5611_spi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iio/pressure/ms5611_i2c.c +1 -1
index 8089c59adce5..ced83162ae94 100644
@@ -50,7 +50,7 @@ static int ms5611_i2c_read_adc(struct ms5611_state *st, s32 *val)
 	if (ret < 0)
 		return ret;
 
-	*val = (buf[0] << 16) | (buf[1] << 8) | buf[2];
+	*val = get_unaligned_be24(&buf[0]);
 
 	return 0;
 }
drivers/iio/pressure/ms5611_spi.c +0 -0
index b463eaa799ab..517295616869 100644

drivers/iio/pressure/ms5611_spi.c static int ms5611_spi_read_adc(struct device *dev, s32 *val) · line 51

Quoted 8 lines
drivers/iio/pressure/ms5611_spi.c +1 -1
@@ -45,7 +45,7 @@ static int ms5611_spi_read_adc(struct device *dev, s32 *val)
 	if (ret < 0)
 		return ret;
 
-	*val = (buf[0] << 16) | (buf[1] << 8) | buf[2];
+	*val = get_unaligned_be24(&buf[0]);
 
 	return 0;
 }

Looks good.

Quoted 3 lines

--
2.26.1

maintainer
#29 lore raw

Re: [PATCH v1 13/16] iio: pressure: ms5611: Use get_unaligned_be24()

Quoted 30 lines · On Tue, 21 Apr 2020 10:36:45 +0200 Tomasz Duszynski <[email protected]> wrote:
Quoted 29 lines · Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/pressure/ms5611_i2c.c | 2 +-
 drivers/iio/pressure/ms5611_spi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iio/pressure/ms5611_i2c.c +1 -1
index 8089c59adce5..ced83162ae94 100644
@@ -50,7 +50,7 @@ static int ms5611_i2c_read_adc(struct ms5611_state *st, s32 *val)
 	if (ret < 0)
 		return ret;
 
-	*val = (buf[0] << 16) | (buf[1] << 8) | buf[2];
+	*val = get_unaligned_be24(&buf[0]);
 
 	return 0;
 }
drivers/iio/pressure/ms5611_spi.c +0 -0
index b463eaa799ab..517295616869 100644
@@ -45,7 +45,7 @@ static int ms5611_spi_read_adc(struct device *dev, s32 *val)
 	if (ret < 0)
 		return ret;
 
Quoted 8 lines

drivers/iio/pressure/ms5611_spi.c static int ms5611_spi_read_adc(struct device *dev, s32 *val) · line 51

Quoted 5 lines
drivers/iio/pressure/ms5611_spi.c +1 -1
-	*val = (buf[0] << 16) | (buf[1] << 8) | buf[2];
+	*val = get_unaligned_be24(&buf[0]);
 
 	return 0;
 }  

Looks good.

Added missing asm/unaligned.h includes and applied.

Thanks,

Jonathan

Quoted 4 lines
Quoted 4 lines

--
2.26.1

#30 lore raw

PATCH 14/16 iio: pressure: zpa2326: Use get_unaligned_le24()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/pressure/zpa2326.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/iio/pressure/zpa2326.c +3 -5
index 99dfe33ee402..c2ad106e3d5b 100644
@@ -1005,22 +1005,20 @@ static int zpa2326_fetch_raw_sample(const struct iio_dev *indio_dev,
 	struct regmap *regs = ((struct zpa2326_private *)
 			       iio_priv(indio_dev))->regmap;
 	int            err;
+	u8             v[3];
 
 	switch (type) {
 	case IIO_PRESSURE:
 		zpa2326_dbg(indio_dev, "fetching raw pressure sample");
 
-		err = regmap_bulk_read(regs, ZPA2326_PRESS_OUT_XL_REG, value,
-				       3);
+		err = regmap_bulk_read(regs, ZPA2326_PRESS_OUT_XL_REG, v, sizeof(v));
 		if (err) {
 			zpa2326_warn(indio_dev, "failed to fetch pressure (%d)",
 				     err);
 			return err;
 		}
 
-		/* Pressure is a 24 bits wide little-endian unsigned int. */
-		*value = (((u8 *)value)[2] << 16) | (((u8 *)value)[1] << 8) |
-			 ((u8 *)value)[0];
+		*value = get_unaligned_le24(&v[0]);
 
 		return IIO_VAL_INT;
 
Signature · 1 line
2.26.1
maintainer
#31 lore raw

Re: [PATCH v1 14/16] iio: pressure: zpa2326: Use get_unaligned_le24()

Quoted 3 lines · On Tue, 21 Apr 2020 03:31:33 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Include added and applied.

Thanks,

Jonathan

Quoted 34 lines
---
 drivers/iio/pressure/zpa2326.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/iio/pressure/zpa2326.c +3 -5
index 99dfe33ee402..c2ad106e3d5b 100644
@@ -1005,22 +1005,20 @@ static int zpa2326_fetch_raw_sample(const struct iio_dev *indio_dev,
 	struct regmap *regs = ((struct zpa2326_private *)
 			       iio_priv(indio_dev))->regmap;
 	int            err;
+	u8             v[3];
 
 	switch (type) {
 	case IIO_PRESSURE:
 		zpa2326_dbg(indio_dev, "fetching raw pressure sample");
 
-		err = regmap_bulk_read(regs, ZPA2326_PRESS_OUT_XL_REG, value,
-				       3);
+		err = regmap_bulk_read(regs, ZPA2326_PRESS_OUT_XL_REG, v, sizeof(v));
 		if (err) {
 			zpa2326_warn(indio_dev, "failed to fetch pressure (%d)",
 				     err);
 			return err;
 		}
 
-		/* Pressure is a 24 bits wide little-endian unsigned int. */
-		*value = (((u8 *)value)[2] << 16) | (((u8 *)value)[1] << 8) |
-			 ((u8 *)value)[0];
+		*value = get_unaligned_le24(&v[0]);
 
 		return IIO_VAL_INT;
 
#32 lore raw

PATCH 15/16 iio: temperature: max31856: Use get_unaligned_beXX()

In reply to Andy Shevchenko

This makes the driver code slightly easier to read.

---
 drivers/iio/temperature/max31856.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/temperature/max31856.c +2 -2
index b4cb21ab2e85..e1966889a962 100644
@@ -168,7 +168,7 @@ static int max31856_thermocouple_read(struct max31856_data *data,
 		if (ret)
 			return ret;
 		/* Skip last 5 dead bits of LTCBL */
-		*val = (reg_val[0] << 16 | reg_val[1] << 8 | reg_val[2]) >> 5;
+		*val = get_unaligned_be24(&reg_val[0]) >> 5;
 		/* Check 7th bit of LTCBH reg. value for sign*/
 		if (reg_val[0] & 0x80)
 			*val -= 0x80000;
@@ -185,7 +185,7 @@ static int max31856_thermocouple_read(struct max31856_data *data,
 		/* Get Cold Junction Temp. offset register value */
 		offset_cjto = reg_val[0];
 		/* Get CJTH and CJTL value and skip last 2 dead bits of CJTL */
-		*val = (reg_val[1] << 8 | reg_val[2]) >> 2;
+		*val = get_unaligned_be16(&reg_val[1]) >> 2;
 		/* As per datasheet add offset into CJTH and CJTL */
 		*val += offset_cjto;
 		/* Check 7th bit of CJTH reg. value for sign */
Signature · 1 line
2.26.1
maintainer
#33 lore raw

Re: [PATCH v1 15/16] iio: temperature: max31856: Use get_unaligned_beXX()

Quoted 3 lines · On Tue, 21 Apr 2020 03:31:34 +0300 Andy Shevchenko…

This makes the driver code slightly easier to read.

Added missing header and applied,

Thanks,

Jonathan

Quoted 26 lines
---
 drivers/iio/temperature/max31856.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/temperature/max31856.c +2 -2
index b4cb21ab2e85..e1966889a962 100644
@@ -168,7 +168,7 @@ static int max31856_thermocouple_read(struct max31856_data *data,
 		if (ret)
 			return ret;
 		/* Skip last 5 dead bits of LTCBL */
-		*val = (reg_val[0] << 16 | reg_val[1] << 8 | reg_val[2]) >> 5;
+		*val = get_unaligned_be24(&reg_val[0]) >> 5;
 		/* Check 7th bit of LTCBH reg. value for sign*/
 		if (reg_val[0] & 0x80)
 			*val -= 0x80000;
@@ -185,7 +185,7 @@ static int max31856_thermocouple_read(struct max31856_data *data,
 		/* Get Cold Junction Temp. offset register value */
 		offset_cjto = reg_val[0];
 		/* Get CJTH and CJTL value and skip last 2 dead bits of CJTL */
-		*val = (reg_val[1] << 8 | reg_val[2]) >> 2;
+		*val = get_unaligned_be16(&reg_val[1]) >> 2;
 		/* As per datasheet add offset into CJTH and CJTL */
 		*val += offset_cjto;
 		/* Check 7th bit of CJTH reg. value for sign */
#34 lore raw

PATCH 16/16 iio: st_sensors: Use get_unaligned_be24() and sign_extend32()

In reply to Andy Shevchenko

Use these functions instead of open-coding them.

---
 drivers/iio/common/st_sensors/st_sensors_core.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/iio/common/st_sensors/st_sensors_core.c +1 -6
index 0e35ff06f9af..bfc39ef64718 100644
@@ -20,11 +20,6 @@
 
 #include "st_sensors_core.h"
 
-static inline u32 st_sensors_get_unaligned_le24(const u8 *p)
-{
-	return (s32)((p[0] | p[1] << 8 | p[2] << 16) << 8) >> 8;
-}
-
 int st_sensors_write_data_with_mask(struct iio_dev *indio_dev,
 				    u8 reg_addr, u8 mask, u8 data)
 {
@@ -545,7 +540,7 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
 	else if (byte_for_channel == 2)
 		*data = (s16)get_unaligned_le16(outdata);
 	else if (byte_for_channel == 3)
-		*data = (s32)st_sensors_get_unaligned_le24(outdata);
+		*data = (s32)sign_extend32(get_unaligned_le24(outdata), 23);
 
 st_sensors_free_memory:
 	kfree(outdata);
Signature · 1 line
2.26.1
maintainer
#35 lore raw

Re: [PATCH v1 16/16] iio: st_sensors: Use get_unaligned_be24() and sign_extend32()

Quoted 4 lines · On Tue, 21 Apr 2020 03:31:35 +0300 Andy Shevchenko…

Use these functions instead of open-coding them.

This one already has the header, so applied to the togreg branch of iio.git and pushed out as testing with no changes :)

Jonathan

Quoted 29 lines
---
 drivers/iio/common/st_sensors/st_sensors_core.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/iio/common/st_sensors/st_sensors_core.c +1 -6
index 0e35ff06f9af..bfc39ef64718 100644
@@ -20,11 +20,6 @@
 
 #include "st_sensors_core.h"
 
-static inline u32 st_sensors_get_unaligned_le24(const u8 *p)
-{
-	return (s32)((p[0] | p[1] << 8 | p[2] << 16) << 8) >> 8;
-}
-
 int st_sensors_write_data_with_mask(struct iio_dev *indio_dev,
 				    u8 reg_addr, u8 mask, u8 data)
 {
@@ -545,7 +540,7 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
 	else if (byte_for_channel == 2)
 		*data = (s16)get_unaligned_le16(outdata);
 	else if (byte_for_channel == 3)
-		*data = (s32)st_sensors_get_unaligned_le24(outdata);
+		*data = (s32)sign_extend32(get_unaligned_le24(outdata), 23);
 
 st_sensors_free_memory:
 	kfree(outdata);
#36 lore raw

Re: [PATCH v1 16/16] iio: st_sensors: Use get_unaligned_be24() and sign_extend32()

Quoted 10 lines · Jonathan Cameron
Quoted 4 lines · On Tue, 21 Apr 2020 03:31:35 +0300 Andy Shevchenko…

Use these functions instead of open-coding them.

This one already has the header, so applied to the togreg branch of iio.git and pushed out as testing with no changes :)

Thanks, I'm sorry I didn't compile all of them and by some reason thought they all have it already.
Strange we didn't get kbuild bot complains...

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Acked-by on v1 1/16
#37 lore raw
In reply to Andy Shevchenko
Quoted 12 lines

From: [email protected] <[email protected]> On Behalf Of Andy Shevchenko
Sent: Dienstag, 21. April 2020 02:31
To: Jonathan Cameron <[email protected]>; Peter Meerwald-Stadler <[email protected]>; [email protected]
Cc: Andy Shevchenko <[email protected]>; Lars-Peter Clausen <[email protected]>; Hennerich, Michael <[email protected]>
Subject: [PATCH v1 01/16] iio: adc: ad_sigma_delta: Use {get,put}_unaligned_be24()

Quoted 9 lines

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/adc/ad_sigma_delta.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
maintainer
#38 lore raw
Quoted 22 lines · Nuno
Quoted 12 lines

From: [email protected] <[email protected]> On Behalf Of Andy Shevchenko
Sent: Dienstag, 21. April 2020 02:31
To: Jonathan Cameron <[email protected]>; Peter Meerwald-Stadler <[email protected]>; [email protected]
Cc: Andy Shevchenko <[email protected]>; Lars-Peter Clausen <[email protected]>; Hennerich, Michael <[email protected]>
Subject: [PATCH v1 01/16] iio: adc: ad_sigma_delta: Use {get,put}_unaligned_be24()

Quoted 9 lines

This makes the driver code slightly easier to read.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/adc/ad_sigma_delta.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Quoted 1 line

Applied to the togreg branch of iio.git and pushed out as testing etc etc.

Jonathan