Re: [PATCH v1 2/2] iio: accel: bma400: Add support for single and double tap events

From: Jonathan Cameron
Date: Sun Jun 19 2022 - 08:38:05 EST



> >
> > ...
> >
> > > bool step_event_en;
> > > bool activity_event_en;
> > > unsigned int generic_event_en;
> > > + unsigned int tap_event_en;
> >
> > Should it be boolean? Or i.o.w. why does it need to be an unsigned int?
>
> tap_event_en is used as a bitmask. Bit 2 and 3 of tap_event_en
> are used to tell the state of the single and double tap events.
> For example bit 2 is used to indicate single tap is enabled or not.
>
> set_mask_bits() and FIELD_GET() is used to set and retrieve the
> required bit value so I used unsigned int.

Perhaps make that obvious by calling it

tap_event_en_bitmask ?