Re: [PATCH v5 05/10] iio: accel: bma400: Add separate channel for step counter

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

 



On Thu,  5 May 2022 19:00:16 +0530
Jagath Jog J <jagathjog1996@xxxxxxxxx> wrote:

> Added channel for step counter which can be enable or disable
> through the sysfs interface.
> 
> Signed-off-by: Jagath Jog J <jagathjog1996@xxxxxxxxx>
> ---
>  
> +static int bma400_enable_steps(struct bma400_data *data, int val)
> +{
> +	int ret;
> +
> +	if (data->steps_enabled == val)
> +		return 0;
> +
> +	ret = regmap_update_bits(data->regmap, BMA400_INT_CONFIG1_REG,
> +				 BMA400_STEP_INT_MSK,
> +				 FIELD_PREP(BMA400_STEP_INT_MSK, !!val));
This gives a dubious x & !y warning

So I've changed it to val ? 1 : 0

Jonathan

> +	if (ret)
> +		return ret;
> +	data->steps_enabled = val;
> +	return ret;
> +}



[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