Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm: dump: 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: Russell King <linux@armlinux.org.uk>
Cc: Jinbum Park <jinb.park7@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+7 -14
+3 -6
arch/arm/include/asm/ptdump.h
··· 21 21 22 22 void ptdump_walk_pgd(struct seq_file *s, struct ptdump_info *info); 23 23 #ifdef CONFIG_ARM_PTDUMP_DEBUGFS 24 - int ptdump_debugfs_register(struct ptdump_info *info, const char *name); 24 + void ptdump_debugfs_register(struct ptdump_info *info, const char *name); 25 25 #else 26 - static inline int ptdump_debugfs_register(struct ptdump_info *info, 27 - const char *name) 28 - { 29 - return 0; 30 - } 26 + static inline void ptdump_debugfs_register(struct ptdump_info *info, 27 + const char *name) { } 31 28 #endif /* CONFIG_ARM_PTDUMP_DEBUGFS */ 32 29 33 30 void ptdump_check_wx(void);
+2 -2
arch/arm/mm/dump.c
··· 450 450 static int ptdump_init(void) 451 451 { 452 452 ptdump_initialize(); 453 - return ptdump_debugfs_register(&kernel_ptdump_info, 454 - "kernel_page_tables"); 453 + ptdump_debugfs_register(&kernel_ptdump_info, "kernel_page_tables"); 454 + return 0; 455 455 } 456 456 __initcall(ptdump_init);
+2 -6
arch/arm/mm/ptdump_debugfs.c
··· 24 24 .release = single_release, 25 25 }; 26 26 27 - int ptdump_debugfs_register(struct ptdump_info *info, const char *name) 27 + void ptdump_debugfs_register(struct ptdump_info *info, const char *name) 28 28 { 29 - struct dentry *pe; 30 - 31 - pe = debugfs_create_file(name, 0400, NULL, info, &ptdump_fops); 32 - return pe ? 0 : -ENOMEM; 33 - 29 + debugfs_create_file(name, 0400, NULL, info, &ptdump_fops); 34 30 }