On Tue, Jan 17, 2023 at 04:24:35PM +0100, Mårten Lindahl wrote: > Add support to configure proximity sensor interrupts and threshold > limits for vcnl4040. If an interrupt is detected an event will be > pushed to the event interface. ... > + return (dir == IIO_EV_DIR_RISING) ? > + FIELD_GET(VCNL4040_PS_IF_AWAY, ret) : > + FIELD_GET(VCNL4040_PS_IF_CLOSE, ret); Indentation issues? ... > + val = ret; > + > + if (dir == IIO_EV_DIR_RISING) > + val = state ? (val | VCNL4040_PS_IF_AWAY) : > + (val & ~VCNL4040_PS_IF_AWAY); > + else > + val = state ? (val | VCNL4040_PS_IF_CLOSE) : > + (val & ~VCNL4040_PS_IF_CLOSE); Wouldn't be better uXX val, mask; if (dir == IIO_EV_DIR_RISING) mask = VCNL4040_PS_IF_AWAY; else mask = VCNL4040_PS_IF_CLOSE; val = state ? (val | mask) : (val & ~mask); ? -- With Best Regards, Andy Shevchenko