All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: byd: don't wipe dynamically allocated memory twice
@ 2016-04-21 19:58 Vladimir Zapolskiy
  2016-04-26 16:50 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2016-04-21 19:58 UTC (permalink / raw)
  To: Dmitry Torokhov, Richard Pospesel, Chris Diamand; +Cc: linux-input

Since memory for a private data is allocated by kzalloc() there is no
need to fill it with zeroes immediately after the allocation.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 drivers/input/mouse/byd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c
index fdc243c..ec73f75 100644
--- a/drivers/input/mouse/byd.c
+++ b/drivers/input/mouse/byd.c
@@ -473,9 +473,8 @@ int byd_init(struct psmouse *psmouse)
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-	memset(priv, 0, sizeof(*priv));
 	setup_timer(&priv->timer, byd_clear_touch, (unsigned long) psmouse);
 
 	psmouse->private = priv;
 	psmouse->disconnect = byd_disconnect;
-- 
2.1.4


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

* Re: [PATCH] Input: byd: don't wipe dynamically allocated memory twice
  2016-04-21 19:58 [PATCH] Input: byd: don't wipe dynamically allocated memory twice Vladimir Zapolskiy
@ 2016-04-26 16:50 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2016-04-26 16:50 UTC (permalink / raw)
  To: Vladimir Zapolskiy; +Cc: Richard Pospesel, Chris Diamand, linux-input

On Thu, Apr 21, 2016 at 10:58:17PM +0300, Vladimir Zapolskiy wrote:
> Since memory for a private data is allocated by kzalloc() there is no
> need to fill it with zeroes immediately after the allocation.
> 
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>

Applied, thank you.

> ---
>  drivers/input/mouse/byd.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c
> index fdc243c..ec73f75 100644
> --- a/drivers/input/mouse/byd.c
> +++ b/drivers/input/mouse/byd.c
> @@ -473,9 +473,8 @@ int byd_init(struct psmouse *psmouse)
>  	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;
>  
> -	memset(priv, 0, sizeof(*priv));
>  	setup_timer(&priv->timer, byd_clear_touch, (unsigned long) psmouse);
>  
>  	psmouse->private = priv;
>  	psmouse->disconnect = byd_disconnect;
> -- 
> 2.1.4
> 

-- 
Dmitry

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

end of thread, other threads:[~2016-04-26 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-21 19:58 [PATCH] Input: byd: don't wipe dynamically allocated memory twice Vladimir Zapolskiy
2016-04-26 16:50 ` 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.