Skip to content

Commit

Permalink
initramfs: remove the populate_initrd_image and clean_rootfs stubs
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Christoph Hellwig committed Jul 30, 2020
1 parent 9acc17b commit 9ab6b71
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions init/initramfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 9ab6b71

Please sign in to comment.