lkml.org 
[lkml]   [2021]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] of: fdt: remove unnecessary codes
From
Date
While unflattening the device tree, we try to populate dt nodes and
properties into tree-shaped data structure.

In populate_properties function, pprev is initially set to
&np->properties, and then updated to &pp->next.

In both scenarios *pprev is NULL, since the memory area that we are
allocating from is initially zeroed.

I tested the code as below, and it showed that BUG was never called.

- if (!dryrun)
+ if (!dryrun) {
+ if (*pprev)
+ BUG();
*pprev = NULL;
+ }

Let's remove unnecessary code.

Signed-off-by: Ohhoon Kwon <ohoono.kwon@samsung.com>
---
drivers/of/fdt.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index ba17a80b8c79..5e71f5eb35b1 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -200,9 +200,6 @@ static void populate_properties(const void *blob,
nodename, (char *)pp->value);
}
}
-
- if (!dryrun)
- *pprev = NULL;
}

static int populate_node(const void *blob,
--
2.17.1
\
 
 \ /
  Last update: 2021-07-01 16:06    [W:0.220 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site