Skip to content

Commit

Permalink
iio: magnetometer: ak8974: small endianness fixes
Browse files Browse the repository at this point in the history
Fixes two cases of 'cast to restricted __le16' as reported by sparse.

Signed-off-by: Ico Doornekamp <ico@pruts.nl>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Ico Doornekamp authored and Jonathan Cameron committed Oct 3, 2016
1 parent 23123cd commit 7f709dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/iio/magnetometer/ak8974.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static int ak8974_await_drdy(struct ak8974 *ak8974)
return 0;
}

static int ak8974_getresult(struct ak8974 *ak8974, s16 *result)
static int ak8974_getresult(struct ak8974 *ak8974, __le16 *result)
{
unsigned int src;
int ret;
Expand Down Expand Up @@ -395,7 +395,7 @@ static int ak8974_selftest(struct ak8974 *ak8974)
static int ak8974_get_u16_val(struct ak8974 *ak8974, u8 reg, u16 *val)
{
int ret;
u16 bulk;
__le16 bulk;

ret = regmap_bulk_read(ak8974->map, reg, &bulk, 2);
if (ret)
Expand Down Expand Up @@ -453,7 +453,7 @@ static int ak8974_read_raw(struct iio_dev *indio_dev,
long mask)
{
struct ak8974 *ak8974 = iio_priv(indio_dev);
s16 hw_values[3];
__le16 hw_values[3];
int ret = -EINVAL;

pm_runtime_get_sync(&ak8974->i2c->dev);
Expand Down Expand Up @@ -494,7 +494,7 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev)
{
struct ak8974 *ak8974 = iio_priv(indio_dev);
int ret;
s16 hw_values[8]; /* Three axes + 64bit padding */
__le16 hw_values[8]; /* Three axes + 64bit padding */

pm_runtime_get_sync(&ak8974->i2c->dev);
mutex_lock(&ak8974->lock);
Expand Down

0 comments on commit 7f709dc

Please sign in to comment.