arm64: dump: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 14:41:11 +0000 (15:41 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 31 Jan 2019 17:38:19 +0000 (17:38 +0000)
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: Will Deacon <will.deacon@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Peng Donglin <dolinux.peng@gmail.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/ptdump.h
arch/arm64/mm/dump.c
arch/arm64/mm/ptdump_debugfs.c

index 6afd8476c60c63b15bdb6b4a04510ed36a1c0ac6..9e948a93d26ca6737bb58f6764d7154ad5f27ef7 100644 (file)
@@ -34,13 +34,10 @@ struct ptdump_info {
 
 void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info);
 #ifdef CONFIG_ARM64_PTDUMP_DEBUGFS
-int ptdump_debugfs_register(struct ptdump_info *info, const char *name);
+void ptdump_debugfs_register(struct ptdump_info *info, const char *name);
 #else
-static inline int ptdump_debugfs_register(struct ptdump_info *info,
-                                       const char *name)
-{
-       return 0;
-}
+static inline void ptdump_debugfs_register(struct ptdump_info *info,
+                                          const char *name) { }
 #endif
 void ptdump_check_wx(void);
 #endif /* CONFIG_ARM64_PTDUMP_CORE */
index fcb1f2a6d7c66d779a752a4d926123e7f0822b34..08c250350b8a491f3eb204e2e7aaeeece154209d 100644 (file)
@@ -407,7 +407,7 @@ void ptdump_check_wx(void)
 static int ptdump_init(void)
 {
        ptdump_initialize();
-       return ptdump_debugfs_register(&kernel_ptdump_info,
-                                       "kernel_page_tables");
+       ptdump_debugfs_register(&kernel_ptdump_info, "kernel_page_tables");
+       return 0;
 }
 device_initcall(ptdump_init);
index 24d786fc3a4c3935cd8a944f1c8befe56a31207b..064163f2559200ad52fd32b652d7e62d90231c6c 100644 (file)
@@ -12,10 +12,7 @@ static int ptdump_show(struct seq_file *m, void *v)
 }
 DEFINE_SHOW_ATTRIBUTE(ptdump);
 
-int ptdump_debugfs_register(struct ptdump_info *info, const char *name)
+void ptdump_debugfs_register(struct ptdump_info *info, const char *name)
 {
-       struct dentry *pe;
-       pe = debugfs_create_file(name, 0400, NULL, info, &ptdump_fops);
-       return pe ? 0 : -ENOMEM;
-
+       debugfs_create_file(name, 0400, NULL, info, &ptdump_fops);
 }