On Mon, Jan 9, 2017 at 9:02 PM, David Daney <ddaney@xxxxxxxxxxxxxxxxxx> wrote: >> if (test_bit(line, gpio->invert_mask)) >> return !(read_bits & BIT(bank_bit)); >> else >> return !!(read_bits & BIT(bank_bit)); >> >> OK maybe not much clearer but seems clearer to me. > > As I really dislike the "!!" idiom, would you settle for: > > if (test_bit(line, gpio->invert_mask)) > return (read_bits & BIT(bank_bit)) == 0; > else > return (read_bits & BIT(bank_bit)) != 0; Not the biggest issue in the world. But I maintain a huge stack of GPIO drivers and it drives me crazy that each one has to bear the mark of the authors habits rather than mine. >> I think this is overkill. Use hierarchical irqdomain. > > I will look into it. I suspect it will require more lines of driver code to > implement it than what I have here (that does actually work). I understand. But at the same time, the kernel needs to have the right idea of what it is dealing with here. The generic IRQ handling code will take a shorter fastpath if you are using hierarchical irqdomain (I think?) but I can't claim to be an expert. When in doubt, consult Marc Z. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html