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; > +}