of/fdt: Remove duplicate memory clearing on FDT unflattening
authorGrant Likely <grant.likely@linaro.org>
Wed, 28 Aug 2013 20:24:17 +0000 (21:24 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 16 Feb 2015 02:35:26 +0000 (11:35 +0900)
Patch 9e4012752, "of: fdt: fix memory initialization for expanded DT"
fixed incomplete clearing of memory when unflattening the device tree.
However the code was already clearing some of the memory, it just wasn't
doing so for all allocations. Now that the memory is cleared right at
the point of allocation, the memset after unflatten_dt_alloc() is
redundant. Remove it.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Wladislav Wiebe <wladislav.kw@gmail.com>
(cherry picked from commit 92d31610aac907c046f0e9c0f888c30415f20936)
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/of/fdt.c

index a1ebaecc8122b1dec92d9c314b505e58ea100157..cafff538c85044d1e196c0cebb3e88d3fc75f352 100644 (file)
@@ -201,7 +201,6 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
                                __alignof__(struct device_node));
        if (allnextpp) {
                char *fn;
-               memset(np, 0, sizeof(*np));
                np->full_name = fn = ((char *)np) + sizeof(*np);
                if (new_format) {
                        /* rebuild full path for new format */