forked from Minki/linux
zsmalloc: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> Cc: linux-mm@kvack.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3e6f176f30
commit
4268509a36
@ -575,8 +575,6 @@ static void __init zs_stat_init(void)
|
||||
}
|
||||
|
||||
zs_stat_root = debugfs_create_dir("zsmalloc", NULL);
|
||||
if (!zs_stat_root)
|
||||
pr_warn("debugfs 'zsmalloc' stat dir creation failed\n");
|
||||
}
|
||||
|
||||
static void __exit zs_stat_exit(void)
|
||||
@ -654,22 +652,10 @@ static void zs_pool_stat_create(struct zs_pool *pool, const char *name)
|
||||
return;
|
||||
}
|
||||
|
||||
entry = debugfs_create_dir(name, zs_stat_root);
|
||||
if (!entry) {
|
||||
pr_warn("debugfs dir <%s> creation failed\n", name);
|
||||
return;
|
||||
}
|
||||
pool->stat_dentry = entry;
|
||||
pool->stat_dentry = debugfs_create_dir(name, zs_stat_root);
|
||||
|
||||
entry = debugfs_create_file("classes", S_IFREG | 0444,
|
||||
pool->stat_dentry, pool,
|
||||
&zs_stats_size_fops);
|
||||
if (!entry) {
|
||||
pr_warn("%s: debugfs file entry <%s> creation failed\n",
|
||||
name, "classes");
|
||||
debugfs_remove_recursive(pool->stat_dentry);
|
||||
pool->stat_dentry = NULL;
|
||||
}
|
||||
debugfs_create_file("classes", S_IFREG | 0444, pool->stat_dentry, pool,
|
||||
&zs_stats_size_fops);
|
||||
}
|
||||
|
||||
static void zs_pool_stat_destroy(struct zs_pool *pool)
|
||||
|
Loading…
Reference in New Issue
Block a user