Skip to content

Commit fad1db8

Browse files
Villemoesgregkh
authored andcommitted
devtmpfs: initify a bit
devtmpfs_mount() is only called from prepare_namespace() in init/do_mounts.c, which is an __init function, so devtmpfs_mount() can also be moved to .init.text. Then the mount_dev static variable is only referenced from __init functions (devtmpfs_mount and its initializer function mount_param). Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Link: https://lore.kernel.org/r/20200115184154.3492-5-linux@rasmusvillemoes.dk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 21766d1 commit fad1db8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/base/devtmpfs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
static struct task_struct *thread;
3232

33-
static int mount_dev = IS_ENABLED(CONFIG_DEVTMPFS_MOUNT);
33+
static int __initdata mount_dev = IS_ENABLED(CONFIG_DEVTMPFS_MOUNT);
3434

3535
static DEFINE_SPINLOCK(req_lock);
3636

@@ -355,7 +355,7 @@ static int handle_remove(const char *nodename, struct device *dev)
355355
* If configured, or requested by the commandline, devtmpfs will be
356356
* auto-mounted after the kernel mounted the root filesystem.
357357
*/
358-
int devtmpfs_mount(void)
358+
int __init devtmpfs_mount(void)
359359
{
360360
int err;
361361

0 commit comments

Comments
 (0)