All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: gpio-keys: Avoid clearing twice some memory
@ 2021-12-29 21:26 Christophe JAILLET
  2022-01-03 11:26 ` Paul Cercueil
  2022-01-04  5:35 ` Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2021-12-29 21:26 UTC (permalink / raw)
  To: dmitry.torokhov, paul
  Cc: linux-input, linux-kernel, kernel-janitors, Christophe JAILLET

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(-)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: gpio-keys: Avoid clearing twice some memory
  2021-12-29 21:26 [PATCH] Input: gpio-keys: Avoid clearing twice some memory Christophe JAILLET
@ 2022-01-03 11:26 ` Paul Cercueil
  2022-01-04  5:35 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Cercueil @ 2022-01-03 11:26 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: dmitry.torokhov, linux-input, linux-kernel, kernel-janitors

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
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: gpio-keys: Avoid clearing twice some memory
  2021-12-29 21:26 [PATCH] Input: gpio-keys: Avoid clearing twice some memory Christophe JAILLET
  2022-01-03 11:26 ` Paul Cercueil
@ 2022-01-04  5:35 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2022-01-04  5:35 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: paul, linux-input, linux-kernel, kernel-janitors

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.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-04  5:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29 21:26 [PATCH] Input: gpio-keys: Avoid clearing twice some memory Christophe JAILLET
2022-01-03 11:26 ` Paul Cercueil
2022-01-04  5:35 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.