diff mbox

of: remove redundant memset in overlay

Message ID 1483787067-108430-1-git-send-email-xuyiping@hisilicon.com
State Accepted
Commit 261c73f3f6ce0f64ad7da46fd69600f57eec1c11
Headers show

Commit Message

Xu YiPing Jan. 7, 2017, 11:04 a.m. UTC
From: XuYing <xuyiping@hisilicon.com>


memset in of_build_overlay_info is redundant, the ovinfo has been
zeroed in of_fill_overlay_info when error.

Signed-off-by: YiPing Xu <xuyiping@hisilicon.com>

---
 drivers/of/overlay.c | 1 -
 1 file changed, 1 deletion(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Frank Rowand Jan. 9, 2017, 6:50 p.m. UTC | #1
Hi Rob,

On 01/07/17 03:04, YiPing Xu wrote:
> From: XuYing <xuyiping@hisilicon.com>

> 

> memset in of_build_overlay_info is redundant, the ovinfo has been

> zeroed in of_fill_overlay_info when error.

> 

> Signed-off-by: YiPing Xu <xuyiping@hisilicon.com>

> ---

>  drivers/of/overlay.c | 1 -

>  1 file changed, 1 deletion(-)

> 

> diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c

> index 0d4cda7..4b1b6b3 100644

> --- a/drivers/of/overlay.c

> +++ b/drivers/of/overlay.c

> @@ -314,7 +314,6 @@ static int of_build_overlay_info(struct of_overlay *ov,

>  

>  	cnt = 0;

>  	for_each_child_of_node(tree, node) {

> -		memset(&ovinfo[cnt], 0, sizeof(*ovinfo));

>  		err = of_fill_overlay_info(ov, node, &ovinfo[cnt]);

>  		if (err == 0)

>  			cnt++;

> 


Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>


I am in the midst of a cleanup of overlay.c.  I can add this patch to
my series if you would prefer.  And of course if I get delayed with
the series I would expect you to apply this one without my series if
you desire.

-Frank

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 0d4cda7..4b1b6b3 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -314,7 +314,6 @@  static int of_build_overlay_info(struct of_overlay *ov,
 
 	cnt = 0;
 	for_each_child_of_node(tree, node) {
-		memset(&ovinfo[cnt], 0, sizeof(*ovinfo));
 		err = of_fill_overlay_info(ov, node, &ovinfo[cnt]);
 		if (err == 0)
 			cnt++;