[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZ2o1AP4YdbNqS7BjHZzpgfpMLSM8GeXNWFPdJ8_C0shQ@mail.gmail.com>
Date: Wed, 12 Jun 2019 09:57:45 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Grygorii Strashko <grygorii.strashko@...com>
Cc: Russell King <rmk@....linux.org.uk>,
Tony Lindgren <tony@...mide.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Linux-OMAP <linux-omap@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Santosh Shilimkar <ssantosh@...nel.org>,
Russell King <rmk+kernel@...linux.org.uk>
Subject: Re: [PATCH-next 04/20] gpio: gpio-omap: clean up edge interrupt handling
On Mon, Jun 10, 2019 at 7:11 PM Grygorii Strashko
<grygorii.strashko@...com> wrote:
> From: Russell King <rmk+kernel@...linux.org.uk>
>
> 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@...linux.org.uk>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@...com>
Patch applied.
Yours,
Linus Walleij
Powered by blists - more mailing lists