Re: [PATCH] drivers: iio: chemical: Fix sparse endianness warnings cast to restricted __be16

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24/09/16 20:16, Sandhya Bankar wrote:
> Fix the following sparse endianness warnings:
> 
> drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
> drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
> drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
> drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
> drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
> drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
> drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
> drivers/iio/chemical/atlas-ph-sensor.c:215:9: warning: cast to restricted __be16
> 
> Signed-off-by: Sandhya Bankar <bankarsandhya512@xxxxxxxxx>
Hi Sandhya,

Please also CC the author of a driver if possible.  Here it's a little
trickier as Matt's email address changed recently.

Patch is fine though so applied to the togreg branch of iio.git.
Initially pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/chemical/atlas-ph-sensor.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
> index 407f141..a3fbdb7 100644
> --- a/drivers/iio/chemical/atlas-ph-sensor.c
> +++ b/drivers/iio/chemical/atlas-ph-sensor.c
> @@ -207,13 +207,14 @@ static int atlas_check_ec_calibration(struct atlas_data *data)
>  	struct device *dev = &data->client->dev;
>  	int ret;
>  	unsigned int val;
> +	__be16	rval;
>  
> -	ret = regmap_bulk_read(data->regmap, ATLAS_REG_EC_PROBE, &val, 2);
> +	ret = regmap_bulk_read(data->regmap, ATLAS_REG_EC_PROBE, &rval, 2);
>  	if (ret)
>  		return ret;
>  
> -	dev_info(dev, "probe set to K = %d.%.2d", be16_to_cpu(val) / 100,
> -						 be16_to_cpu(val) % 100);
> +	val = be16_to_cpu(rval);
> +	dev_info(dev, "probe set to K = %d.%.2d", val / 100, val % 100);
>  
>  	ret = regmap_read(data->regmap, ATLAS_REG_EC_CALIB_STATUS, &val);
>  	if (ret)
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux