[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vd_6Rpt5=BjzV8YFCiFP7qsRrYHHo7+=gWwnZH-zT9jNw@mail.gmail.com>
Date: Wed, 4 Sep 2019 19:27:33 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Rashmica Gupta <rashmica.g@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
linux-aspeed@...ts.ozlabs.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Joel Stanley <joel@....id.au>, Andrew Jeffery <andrew@...id.au>
Subject: Re: [PATCH 1/4] gpio/aspeed: Fix incorrect number of banks
On Wed, Sep 4, 2019 at 9:14 AM Rashmica Gupta <rashmica.g@...il.com> wrote:
>
> Fixes: 361b79119a4b7 ('gpio: Add Aspeed driver')
>
> Signed-off-by: Rashmica Gupta <rashmica.g@...il.com>
> /* Allocate a cache of the output registers */
> - banks = gpio->config->nr_gpios >> 5;
> + banks = (gpio->config->nr_gpios >> 5) + 1;
Shouldn't be rather DIV_ROUND_UP(nr_gpios, sizeof(u32)) ?
> gpio->dcache = devm_kcalloc(&pdev->dev,
> banks, sizeof(u32), GFP_KERNEL);
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists