Skip to content

Commit 9ab6b71

Browse files
author
Christoph Hellwig
committed
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 <[email protected]> Acked-by: Linus Torvalds <[email protected]>
1 parent 9acc17b commit 9ab6b71

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

init/initramfs.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -618,13 +618,7 @@ static void __init clean_rootfs(void)
618618
ksys_close(fd);
619619
kfree(buf);
620620
}
621-
#else
622-
static inline void clean_rootfs(void)
623-
{
624-
}
625-
#endif /* CONFIG_BLK_DEV_RAM */
626621

627-
#ifdef CONFIG_BLK_DEV_RAM
628622
static void __init populate_initrd_image(char *err)
629623
{
630624
ssize_t written;
@@ -644,11 +638,6 @@ static void __init populate_initrd_image(char *err)
644638
written, initrd_end - initrd_start);
645639
ksys_close(fd);
646640
}
647-
#else
648-
static void __init populate_initrd_image(char *err)
649-
{
650-
printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
651-
}
652641
#endif /* CONFIG_BLK_DEV_RAM */
653642

654643
static int __init populate_rootfs(void)
@@ -668,8 +657,12 @@ static int __init populate_rootfs(void)
668657

669658
err = unpack_to_rootfs((char *)initrd_start, initrd_end - initrd_start);
670659
if (err) {
660+
#ifdef CONFIG_BLK_DEV_RAM
671661
clean_rootfs();
672662
populate_initrd_image(err);
663+
#else
664+
printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
665+
#endif
673666
}
674667

675668
done:

0 commit comments

Comments
 (0)