lkml.org 
[lkml]   [2019]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -mmots] initramfs: fix a compilation error
Date
The commit 754006569c54 ("initramfs: cleanup populate_rootfs")
introduced a compilation error with CONFIG_BLK_DEV_RAM != y due to
clean_rootfs() is only declared with CONFIG_BLK_DEV_RAM=y.

init/initramfs.c: In function 'populate_rootfs':
init/initramfs.c:659:3: error: implicit declaration of function
'clean_rootfs'; did you mean 'clean_path'?
[-Werror=implicit-function-declaration]
clean_rootfs();
^~~~~~~~~~~~
clean_path

Signed-off-by: Qian Cai <cai@lca.pw>
---
init/initramfs.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/init/initramfs.c b/init/initramfs.c
index 000e88ca08b7..435a428c2af1 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -610,7 +610,11 @@ static void __init clean_rootfs(void)
ksys_close(fd);
kfree(buf);
}
-#endif
+#else
+static inline void clean_rootfs(void)
+{
+}
+#endif /* CONFIG_BLK_DEV_RAM */

#ifdef CONFIG_BLK_DEV_RAM
static void populate_initrd_image(char *err)
--
2.17.2 (Apple Git-113)
\
 
 \ /
  Last update: 2019-03-28 02:49    [W:0.023 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site