From: 권오훈 Date: Thu, 1 Jul 2021 14:04:57 +0000 (+0900) Subject: of: fdt: remove unnecessary codes X-Git-Tag: v5.15-rc1~137^2~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb7173988caf6fc68ef00065b9defb5ac3467f21;p=thirdparty%2Fkernel%2Flinux.git of: fdt: remove unnecessary codes 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 Link: https://lore.kernel.org/r/20210701140457epcms1p2cc43a7c62150f012619feab913f017af@epcms1p2 Signed-off-by: Rob Herring --- diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index e0f96e3ef1da0..bd35ba56aa96a 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,