From 63353810c08499476efc1e1e85ca7b8e33d54ef7 Mon Sep 17 00:00:00 2001 From: Sang-Heon Jeon Date: Sat, 18 Apr 2026 23:04:20 +0900 Subject: [PATCH] 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) --- drivers/of/fdt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 82f7327c59ea..ba65e36e183c 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);