Re: [PATCH 4/6] gpiolib: cdev: simplify line event identification

From: Kent Gibson
Date: Wed Jul 13 2022 - 06:27:21 EST


On Wed, Jul 13, 2022 at 11:59:10AM +0200, Andy Shevchenko wrote:
> On Wed, Jul 13, 2022 at 3:39 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:
> >
> > Reorganise line event identification code to reduce code duplication,
> > and replace if-else initializers with the ternary equivalent to
> > improve readability.
>
> ...
>
> > + le.id = level ? GPIO_V2_LINE_EVENT_RISING_EDGE :
> > + GPIO_V2_LINE_EVENT_FALLING_EDGE;
>
> It seems several times you are doing the same, perhaps a helper?
>

If by several times you mean twice, then yeah.
Not sure that reaches the threshold for a helper though.

Cheers,
Kent.