Commit 9096bbe9 authored by Miaohe Lin's avatar Miaohe Lin Committed by akpm

mm: shmem: make shmem_init return void

The return value of shmem_init is never used.  So we can make it return
void now.

[akpm@linux-foundation.org: remove `return;' from void-returning function, per Muchun Song]
Link: https://lkml.kernel.org/r/20220328112707.22217-1-linmiaohe@huawei.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 21f0dd88
...@@ -56,7 +56,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) ...@@ -56,7 +56,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
* Functions in mm/shmem.c called directly from elsewhere: * Functions in mm/shmem.c called directly from elsewhere:
*/ */
extern const struct fs_parameter_spec shmem_fs_parameters[]; extern const struct fs_parameter_spec shmem_fs_parameters[];
extern int shmem_init(void); extern void shmem_init(void);
extern int shmem_init_fs_context(struct fs_context *fc); extern int shmem_init_fs_context(struct fs_context *fc);
extern struct file *shmem_file_setup(const char *name, extern struct file *shmem_file_setup(const char *name,
loff_t size, unsigned long flags); loff_t size, unsigned long flags);
......
...@@ -3888,7 +3888,7 @@ static struct file_system_type shmem_fs_type = { ...@@ -3888,7 +3888,7 @@ static struct file_system_type shmem_fs_type = {
.fs_flags = FS_USERNS_MOUNT, .fs_flags = FS_USERNS_MOUNT,
}; };
int __init shmem_init(void) void __init shmem_init(void)
{ {
int error; int error;
...@@ -3913,14 +3913,13 @@ int __init shmem_init(void) ...@@ -3913,14 +3913,13 @@ int __init shmem_init(void)
else else
shmem_huge = SHMEM_HUGE_NEVER; /* just in case it was patched */ shmem_huge = SHMEM_HUGE_NEVER; /* just in case it was patched */
#endif #endif
return 0; return;
out1: out1:
unregister_filesystem(&shmem_fs_type); unregister_filesystem(&shmem_fs_type);
out2: out2:
shmem_destroy_inodecache(); shmem_destroy_inodecache();
shm_mnt = ERR_PTR(error); shm_mnt = ERR_PTR(error);
return error;
} }
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && defined(CONFIG_SYSFS) #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && defined(CONFIG_SYSFS)
...@@ -3998,14 +3997,12 @@ static struct file_system_type shmem_fs_type = { ...@@ -3998,14 +3997,12 @@ static struct file_system_type shmem_fs_type = {
.fs_flags = FS_USERNS_MOUNT, .fs_flags = FS_USERNS_MOUNT,
}; };
int __init shmem_init(void) void __init shmem_init(void)
{ {
BUG_ON(register_filesystem(&shmem_fs_type) != 0); BUG_ON(register_filesystem(&shmem_fs_type) != 0);
shm_mnt = kern_mount(&shmem_fs_type); shm_mnt = kern_mount(&shmem_fs_type);
BUG_ON(IS_ERR(shm_mnt)); BUG_ON(IS_ERR(shm_mnt));
return 0;
} }
int shmem_unuse(unsigned int type) int shmem_unuse(unsigned int type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment