powerpc/mm: ptdump: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Feb 2020 10:58:59 +0000 (11:58 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 Mar 2020 11:44:25 +0000 (22:44 +1100)
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
arch/powerpc/mm/ptdump/bats.c
arch/powerpc/mm/ptdump/hashpagetable.c
arch/powerpc/mm/ptdump/ptdump.c
arch/powerpc/mm/ptdump/segment_regs.c

index 4154feac1da340de829dfa20343a574bc6031a1d..d3a5d6b318d186781cff4d23f8d762a0cc0aaca7 100644 (file)
@@ -164,10 +164,8 @@ static const struct file_operations bats_fops = {
 
 static int __init bats_init(void)
 {
-       struct dentry *debugfs_file;
-
-       debugfs_file = debugfs_create_file("block_address_translation", 0400,
-                                          powerpc_debugfs_root, NULL, &bats_fops);
-       return debugfs_file ? 0 : -ENOMEM;
+       debugfs_create_file("block_address_translation", 0400,
+                           powerpc_debugfs_root, NULL, &bats_fops);
+       return 0;
 }
 device_initcall(bats_init);
index a07278027c6f4a0a5099f7cde2cec2916ae78923..b6ed9578382ff8d0b84c299a083f477e61af7d3a 100644 (file)
@@ -527,13 +527,10 @@ static const struct file_operations ptdump_fops = {
 
 static int ptdump_init(void)
 {
-       struct dentry *debugfs_file;
-
        if (!radix_enabled()) {
                populate_markers();
-               debugfs_file = debugfs_create_file("kernel_hash_pagetable",
-                               0400, NULL, NULL, &ptdump_fops);
-               return debugfs_file ? 0 : -ENOMEM;
+               debugfs_create_file("kernel_hash_pagetable", 0400, NULL, NULL,
+                                   &ptdump_fops);
        }
        return 0;
 }
index 206156255247707a5de9a918c757d9b272eb172a..d92bb8ea229c5324c933b38c1cda5ee3d0306241 100644 (file)
@@ -417,12 +417,10 @@ void ptdump_check_wx(void)
 
 static int ptdump_init(void)
 {
-       struct dentry *debugfs_file;
-
        populate_markers();
        build_pgtable_complete_mask();
-       debugfs_file = debugfs_create_file("kernel_page_tables", 0400, NULL,
-                       NULL, &ptdump_fops);
-       return debugfs_file ? 0 : -ENOMEM;
+       debugfs_create_file("kernel_page_tables", 0400, NULL, NULL,
+                           &ptdump_fops);
+       return 0;
 }
 device_initcall(ptdump_init);
index 501843664bb91bd52db8b7f7554750a265533814..dde2fe8de4b2a867093158981442dab4ac41ef51 100644 (file)
@@ -55,10 +55,8 @@ static const struct file_operations sr_fops = {
 
 static int __init sr_init(void)
 {
-       struct dentry *debugfs_file;
-
-       debugfs_file = debugfs_create_file("segment_registers", 0400,
-                                          powerpc_debugfs_root, NULL, &sr_fops);
-       return debugfs_file ? 0 : -ENOMEM;
+       debugfs_create_file("segment_registers", 0400, powerpc_debugfs_root,
+                           NULL, &sr_fops);
+       return 0;
 }
 device_initcall(sr_init);