All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: Zero-initialize memory for new clock in devm_clk_register
@ 2013-10-29 10:50 ` Tushar Behera
  0 siblings, 0 replies; 4+ messages in thread
From: Tushar Behera @ 2013-10-29 10:50 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: mturquette, patches

Earlier to commit 64c862a839a8 ("devres: add kernel standard devm_k.alloc
functions") devres_alloc API used to zero-initialize the devres
allocated object, but now only the devres header is zero-initialized.

Since clk_register zero-initializes the memory while allocating for
a new clock, passing explicit flag __GFP_ZERO to devres_alloc in
devm_clk_register to match the behaviour.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/clk/clk.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 2cf2ea6..ea3f2b9 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1932,7 +1932,8 @@ struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw)
 	struct clk *clk;
 	int ret;
 
-	clk = devres_alloc(devm_clk_release, sizeof(*clk), GFP_KERNEL);
+	clk = devres_alloc(devm_clk_release, sizeof(*clk),
+			GFP_KERNEL|__GFP_ZERO);
 	if (!clk)
 		return ERR_PTR(-ENOMEM);
 
-- 
1.7.9.5


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

* [PATCH] clk: Zero-initialize memory for new clock in devm_clk_register
@ 2013-10-29 10:50 ` Tushar Behera
  0 siblings, 0 replies; 4+ messages in thread
From: Tushar Behera @ 2013-10-29 10:50 UTC (permalink / raw)
  To: linux-arm-kernel

Earlier to commit 64c862a839a8 ("devres: add kernel standard devm_k.alloc
functions") devres_alloc API used to zero-initialize the devres
allocated object, but now only the devres header is zero-initialized.

Since clk_register zero-initializes the memory while allocating for
a new clock, passing explicit flag __GFP_ZERO to devres_alloc in
devm_clk_register to match the behaviour.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/clk/clk.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 2cf2ea6..ea3f2b9 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1932,7 +1932,8 @@ struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw)
 	struct clk *clk;
 	int ret;
 
-	clk = devres_alloc(devm_clk_release, sizeof(*clk), GFP_KERNEL);
+	clk = devres_alloc(devm_clk_release, sizeof(*clk),
+			GFP_KERNEL|__GFP_ZERO);
 	if (!clk)
 		return ERR_PTR(-ENOMEM);
 
-- 
1.7.9.5

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

* Re: [PATCH] clk: Zero-initialize memory for new clock in devm_clk_register
  2013-10-29 10:50 ` Tushar Behera
@ 2013-10-29 11:45   ` Tushar Behera
  -1 siblings, 0 replies; 4+ messages in thread
From: Tushar Behera @ 2013-10-29 11:45 UTC (permalink / raw)
  To: lkml, linux-arm-kernel; +Cc: mturquette, Patch Tracking

On 29 October 2013 16:20, Tushar Behera <tushar.behera@linaro.org> wrote:
> Earlier to commit 64c862a839a8 ("devres: add kernel standard devm_k.alloc
> functions") devres_alloc API used to zero-initialize the devres
> allocated object, but now only the devres header is zero-initialized.
>
> Since clk_register zero-initializes the memory while allocating for
> a new clock, passing explicit flag __GFP_ZERO to devres_alloc in
> devm_clk_register to match the behaviour.
>
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---

Please ignore this patch. Kevin Hilman already has got a nicer patch
[1] that fixes this problem at a generic level.

[1] https://lkml.org/lkml/2013/10/19/5

-- 
Tushar Behera

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

* [PATCH] clk: Zero-initialize memory for new clock in devm_clk_register
@ 2013-10-29 11:45   ` Tushar Behera
  0 siblings, 0 replies; 4+ messages in thread
From: Tushar Behera @ 2013-10-29 11:45 UTC (permalink / raw)
  To: linux-arm-kernel

On 29 October 2013 16:20, Tushar Behera <tushar.behera@linaro.org> wrote:
> Earlier to commit 64c862a839a8 ("devres: add kernel standard devm_k.alloc
> functions") devres_alloc API used to zero-initialize the devres
> allocated object, but now only the devres header is zero-initialized.
>
> Since clk_register zero-initializes the memory while allocating for
> a new clock, passing explicit flag __GFP_ZERO to devres_alloc in
> devm_clk_register to match the behaviour.
>
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---

Please ignore this patch. Kevin Hilman already has got a nicer patch
[1] that fixes this problem at a generic level.

[1] https://lkml.org/lkml/2013/10/19/5

-- 
Tushar Behera

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

end of thread, other threads:[~2013-10-29 11:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29 10:50 [PATCH] clk: Zero-initialize memory for new clock in devm_clk_register Tushar Behera
2013-10-29 10:50 ` Tushar Behera
2013-10-29 11:45 ` Tushar Behera
2013-10-29 11:45   ` Tushar Behera

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.