powerpc/mm: ptdump: 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. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200209105901.1620958-4-gregkh@linuxfoundation.org
This commit is contained in:
parent
08f6a7974a
commit
f3c0520195
|
@ -164,10 +164,8 @@ static const struct file_operations bats_fops = {
|
||||||
|
|
||||||
static int __init bats_init(void)
|
static int __init bats_init(void)
|
||||||
{
|
{
|
||||||
struct dentry *debugfs_file;
|
debugfs_create_file("block_address_translation", 0400,
|
||||||
|
powerpc_debugfs_root, NULL, &bats_fops);
|
||||||
debugfs_file = debugfs_create_file("block_address_translation", 0400,
|
return 0;
|
||||||
powerpc_debugfs_root, NULL, &bats_fops);
|
|
||||||
return debugfs_file ? 0 : -ENOMEM;
|
|
||||||
}
|
}
|
||||||
device_initcall(bats_init);
|
device_initcall(bats_init);
|
||||||
|
|
|
@ -527,13 +527,10 @@ static const struct file_operations ptdump_fops = {
|
||||||
|
|
||||||
static int ptdump_init(void)
|
static int ptdump_init(void)
|
||||||
{
|
{
|
||||||
struct dentry *debugfs_file;
|
|
||||||
|
|
||||||
if (!radix_enabled()) {
|
if (!radix_enabled()) {
|
||||||
populate_markers();
|
populate_markers();
|
||||||
debugfs_file = debugfs_create_file("kernel_hash_pagetable",
|
debugfs_create_file("kernel_hash_pagetable", 0400, NULL, NULL,
|
||||||
0400, NULL, NULL, &ptdump_fops);
|
&ptdump_fops);
|
||||||
return debugfs_file ? 0 : -ENOMEM;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -417,12 +417,10 @@ void ptdump_check_wx(void)
|
||||||
|
|
||||||
static int ptdump_init(void)
|
static int ptdump_init(void)
|
||||||
{
|
{
|
||||||
struct dentry *debugfs_file;
|
|
||||||
|
|
||||||
populate_markers();
|
populate_markers();
|
||||||
build_pgtable_complete_mask();
|
build_pgtable_complete_mask();
|
||||||
debugfs_file = debugfs_create_file("kernel_page_tables", 0400, NULL,
|
debugfs_create_file("kernel_page_tables", 0400, NULL, NULL,
|
||||||
NULL, &ptdump_fops);
|
&ptdump_fops);
|
||||||
return debugfs_file ? 0 : -ENOMEM;
|
return 0;
|
||||||
}
|
}
|
||||||
device_initcall(ptdump_init);
|
device_initcall(ptdump_init);
|
||||||
|
|
|
@ -55,10 +55,8 @@ static const struct file_operations sr_fops = {
|
||||||
|
|
||||||
static int __init sr_init(void)
|
static int __init sr_init(void)
|
||||||
{
|
{
|
||||||
struct dentry *debugfs_file;
|
debugfs_create_file("segment_registers", 0400, powerpc_debugfs_root,
|
||||||
|
NULL, &sr_fops);
|
||||||
debugfs_file = debugfs_create_file("segment_registers", 0400,
|
return 0;
|
||||||
powerpc_debugfs_root, NULL, &sr_fops);
|
|
||||||
return debugfs_file ? 0 : -ENOMEM;
|
|
||||||
}
|
}
|
||||||
device_initcall(sr_init);
|
device_initcall(sr_init);
|
||||||
|
|
Loading…
Reference in New Issue