Message ID | d6ee621b9dd75b92f8831db365cee58dc2025322.1640813136.git.christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | Accepted |
Commit | 08a6df09063818d55c1f0aa8cf3385d8d217b506 |
Headers | show |
Series | Input: gpio-keys: Avoid clearing twice some memory | expand |
Hi, Le mer., déc. 29 2021 at 22:26:56 +0100, Christophe JAILLET <christophe.jaillet@wanadoo.fr> a écrit : > bitmap_parselist() already clears the 'bits' bitmap, so there is no > need > to clear it when it is allocated. This just wastes some cycles. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Paul Cercueil <paul@crapouillou.net> Cheers, -Paul > --- > drivers/input/keyboard/gpio_keys.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/keyboard/gpio_keys.c > b/drivers/input/keyboard/gpio_keys.c > index 8dbf1e69c90a..d75a8b179a8a 100644 > --- a/drivers/input/keyboard/gpio_keys.c > +++ b/drivers/input/keyboard/gpio_keys.c > @@ -247,7 +247,7 @@ static ssize_t gpio_keys_attr_store_helper(struct > gpio_keys_drvdata *ddata, > ssize_t error; > int i; > > - bits = bitmap_zalloc(n_events, GFP_KERNEL); > + bits = bitmap_alloc(n_events, GFP_KERNEL); > if (!bits) > return -ENOMEM; > > -- > 2.32.0 >
On Wed, Dec 29, 2021 at 10:26:56PM +0100, Christophe JAILLET wrote: > bitmap_parselist() already clears the 'bits' bitmap, so there is no need > to clear it when it is allocated. This just wastes some cycles. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Applied, thank you.
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 8dbf1e69c90a..d75a8b179a8a 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -247,7 +247,7 @@ static ssize_t gpio_keys_attr_store_helper(struct gpio_keys_drvdata *ddata, ssize_t error; int i; - bits = bitmap_zalloc(n_events, GFP_KERNEL); + bits = bitmap_alloc(n_events, GFP_KERNEL); if (!bits) return -ENOMEM;
bitmap_parselist() already clears the 'bits' bitmap, so there is no need to clear it when it is allocated. This just wastes some cycles. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/input/keyboard/gpio_keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)