Blob Blame History Raw
From: Christoph Hellwig <hch@lst.de>
Date: Sat, 6 Jun 2020 13:51:52 +0200
Subject: initramfs: remove the populate_initrd_image and clean_rootfs stubs
Patch-mainline: v5.9-rc1
Git-commit: 9ab6b718491b1a3c3eeb52f32a428dc0cbf5bb80
References: git-fixes

If initrd support is not enable just print the warning directly instead
of hiding the fact that we just failed behind two stub functions.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Daniel Wagner <dwagner@suse.de>
---
 init/initramfs.c |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -610,13 +610,7 @@ static void __init clean_rootfs(void)
 	ksys_close(fd);
 	kfree(buf);
 }
-#else
-static inline void clean_rootfs(void)
-{
-}
-#endif /* CONFIG_BLK_DEV_RAM */
 
-#ifdef CONFIG_BLK_DEV_RAM
 static void __init populate_initrd_image(char *err)
 {
 	ssize_t written;
@@ -636,11 +630,6 @@ static void __init populate_initrd_image
 		       written, initrd_end - initrd_start);
 	ksys_close(fd);
 }
-#else
-static void __init populate_initrd_image(char *err)
-{
-	printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
-}
 #endif /* CONFIG_BLK_DEV_RAM */
 
 static int __init populate_rootfs(void)
@@ -660,8 +649,12 @@ static int __init populate_rootfs(void)
 
 	err = unpack_to_rootfs((char *)initrd_start, initrd_end - initrd_start);
 	if (err) {
+#ifdef CONFIG_BLK_DEV_RAM
 		clean_rootfs();
 		populate_initrd_image(err);
+#else
+		printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
+#endif
 	}
 
 done: