Skip to content

Commit 61c358e

Browse files
larsclausenjic23
authored andcommitted
iio:ad5504: Mark transfer buffers as __be16
Fixes the following warnings from sparse: drivers/iio/dac/ad5504.c:71:19: warning: incorrect type in initializer (different base types) drivers/iio/dac/ad5504.c:71:19: expected unsigned short [unsigned] [usertype] tmp drivers/iio/dac/ad5504.c:71:19: got restricted __be16 [usertype] <noident> drivers/iio/dac/ad5504.c:80:19: warning: incorrect type in initializer (different base types) drivers/iio/dac/ad5504.c:80:19: expected unsigned short [unsigned] [usertype] tmp drivers/iio/dac/ad5504.c:80:19: got restricted __be16 [usertype] <noident> drivers/iio/dac/ad5504.c:93:16: warning: cast to restricted __be16 drivers/iio/dac/ad5504.c:93:16: warning: cast to restricted __be16 drivers/iio/dac/ad5504.c:93:16: warning: cast to restricted __be16 drivers/iio/dac/ad5504.c:93:16: warning: cast to restricted __be16 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent c3a09c1 commit 61c358e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/iio/dac/ad5504.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ enum ad5504_supported_device_ids {
6868

6969
static int ad5504_spi_write(struct spi_device *spi, u8 addr, u16 val)
7070
{
71-
u16 tmp = cpu_to_be16(AD5504_CMD_WRITE |
71+
__be16 tmp = cpu_to_be16(AD5504_CMD_WRITE |
7272
AD5504_ADDR(addr) |
7373
(val & AD5504_RES_MASK));
7474

@@ -77,8 +77,8 @@ static int ad5504_spi_write(struct spi_device *spi, u8 addr, u16 val)
7777

7878
static int ad5504_spi_read(struct spi_device *spi, u8 addr)
7979
{
80-
u16 tmp = cpu_to_be16(AD5504_CMD_READ | AD5504_ADDR(addr));
81-
u16 val;
80+
__be16 tmp = cpu_to_be16(AD5504_CMD_READ | AD5504_ADDR(addr));
81+
__be16 val;
8282
int ret;
8383
struct spi_transfer t = {
8484
.tx_buf = &tmp,

0 commit comments

Comments
 (0)