summaryrefslogtreecommitdiff
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-06-06 13:51:52 +0200
committerChristoph Hellwig <hch@lst.de>2020-07-30 08:22:47 +0200
commit9ab6b718491b1a3c3eeb52f32a428dc0cbf5bb80 (patch)
tree95e29ba646f16d655db263e708538b065a27ada8 /init/initramfs.c
parent9acc17baf1fd6369cf969b1130bcf8c4b616ecfb (diff)
downloadlwn-9ab6b718491b1a3c3eeb52f32a428dc0cbf5bb80.tar.gz
lwn-9ab6b718491b1a3c3eeb52f32a428dc0cbf5bb80.zip
initramfs: remove the populate_initrd_image and clean_rootfs stubs
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>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r--init/initramfs.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index 7a38012e1af7..d10404625c31 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -618,13 +618,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;
@@ -644,11 +638,6 @@ static void __init populate_initrd_image(char *err)
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)
@@ -668,8 +657,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: