]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: omap: clean up edge interrupt handling
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 10 Jun 2019 17:10:47 +0000 (20:10 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 12 Jun 2019 09:13:20 +0000 (11:13 +0200)
commit69e3d701c8eacf6c2e0a436d27cacd3af4d23636
treecdb87247a854f8b23bacf1416b4a6e0f802313d2
parenta65206fc7738a23f9a6c593f1465312c26d6bdc4
gpio: omap: clean up edge interrupt handling

The edge interrupt handling was effectively:

isr = ISR_reg & enabled;
if (bank->level_mask)
level_mask = bank->level_mask & enabled;
else
level_mask = 0;

edge = isr & ~level_mask;

When bank->level_mask is zero, level_mask will be computed as zero
anyway, so the if() statement is redundant.  We are then left with:

isr = ISR_reg & enabled;
level_mask = bank->level_mask & enabled;
edge = isr & ~level_mask;

This can be simplified further to:

isr = ISR_reg & enabled;
edge = isr & ~bank->level_mask;

since the second mask with 'enabled' is redundant.

Improve the associated comment as well.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-omap.c