lib/fault-inject-usercopy.c: use PTR_ERR_OR_ZERO() to simplify code

Use the standard error pointer macro to shorten the code and simplify.

Link: https://lkml.kernel.org/r/20250812084045.64218-1-zhao.xichao@vivo.com
Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Xichao Zhao 2025-08-12 16:40:45 +08:00 committed by Andrew Morton
parent a6cf527e66
commit 6c0022d6dc
1 changed files with 1 additions and 3 deletions

View File

@ -22,10 +22,8 @@ static int __init fail_usercopy_debugfs(void)
dir = fault_create_debugfs_attr("fail_usercopy", NULL, dir = fault_create_debugfs_attr("fail_usercopy", NULL,
&fail_usercopy.attr); &fail_usercopy.attr);
if (IS_ERR(dir))
return PTR_ERR(dir);
return 0; return PTR_ERR_OR_ZERO(dir);
} }
late_initcall(fail_usercopy_debugfs); late_initcall(fail_usercopy_debugfs);