On Tue, Jan 30, 2024 at 09:37:10AM +0200, Arturas Moskvinas wrote: > GPINTEN register contains information about GPIOs with enabled > interrupts no need to check other GPIOs for changes. ... > + if (mcp_read(mcp, MCP_GPINTEN, &gpinten)) > + goto unlock; > + enabled_interrupts = gpinten; Move this line to be... ... > - for (i = 0; i < mcp->chip.ngpio; i++) { > - /* We must check all of the inputs on the chip, > - * otherwise we may not notice a change on >=2 pins. ...just here (w/o any blank line in between). > + for_each_set_bit(i, &enabled_interrupts, mcp->chip.ngpio) { ... > + /* We must check all of the inputs with enabled interrupts > + * on the chip, otherwise we may not notice a change > + * on >=2 pins. Missing space after =. But better to spell in proper English, i.e. "...great than or equal to 2 pins." > * > * On at least the mcp23s17, INTCAP is only updated /* * Use proper multi-line * comment style as depicted * in this example. */ -- With Best Regards, Andy Shevchenko