[PATCH] kexec_core: Remove redundant 0 value initialization

Liao Yuanhong liaoyuanhong at vivo.com
Mon Aug 25 05:33:05 PDT 2025


The kimage struct is already zeroed by kzalloc(). It's redundant to
initialize image->head to 0.

Signed-off-by: Liao Yuanhong <liaoyuanhong at vivo.com>
---
 kernel/kexec_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 31203f0bacaf..fa00b239c5d9 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -233,7 +233,6 @@ struct kimage *do_kimage_alloc_init(void)
 	if (!image)
 		return NULL;
 
-	image->head = 0;
 	image->entry = &image->head;
 	image->last_entry = &image->head;
 	image->control_page = ~0; /* By default this does not apply */
-- 
2.34.1




More information about the kexec mailing list