Skip to content

Commit ec9672d

Browse files
gregkhtorvalds
authored andcommitted
kcov: 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. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "Steven Rostedt (VMware)" <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Anders Roxell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 13610aa commit ec9672d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/kcov.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,8 @@ static int __init kcov_init(void)
444444
* there is no need to protect it against removal races. The
445445
* use of debugfs_create_file_unsafe() is actually safe here.
446446
*/
447-
if (!debugfs_create_file_unsafe("kcov", 0600, NULL, NULL, &kcov_fops)) {
448-
pr_err("failed to create kcov in debugfs\n");
449-
return -ENOMEM;
450-
}
447+
debugfs_create_file_unsafe("kcov", 0600, NULL, NULL, &kcov_fops);
448+
451449
return 0;
452450
}
453451

0 commit comments

Comments
 (0)