From: Sang-Heon Jeon Date: Sat, 18 Apr 2026 14:04:20 +0000 (+0900) Subject: of/fdt: remove redundant memset in __unflatten_device_tree() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63353810c08499476efc1e1e85ca7b8e33d54ef7;p=thirdparty%2Fkernel%2Flinux.git of/fdt: remove redundant memset in __unflatten_device_tree() Now that memblock and slab allocators are the only allocators and both return zero-initialized memory, zeroing the memory ourselves is redundant. The allocators used are: - kernel_tree_alloc uses kzalloc() - early_init_dt_alloc_memory_arch() and dt_alloc_memory() both use memblock_alloc() Remove redundant memset after the allocation. No funtional change. Signed-off-by: Sang-Heon Jeon Link: https://patch.msgid.link/20260418140420.2221736-1-ekffu200098@gmail.com Signed-off-by: Rob Herring (Arm) --- diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 82f7327c59ea9..ba65e36e183cc 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -391,8 +391,6 @@ void *__unflatten_device_tree(const void *blob, if (!mem) return NULL; - memset(mem, 0, size); - *(__be32 *)(mem + size) = cpu_to_be32(0xdeadbeef); pr_debug(" unflattening %p...\n", mem);