Skip to content

Commit 6c0022d

Browse files
Xichao Zhaoakpm00
authored andcommitted
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/[email protected] Signed-off-by: Xichao Zhao <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent a6cf527 commit 6c0022d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/fault-inject-usercopy.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ static int __init fail_usercopy_debugfs(void)
2222

2323
dir = fault_create_debugfs_attr("fail_usercopy", NULL,
2424
&fail_usercopy.attr);
25-
if (IS_ERR(dir))
26-
return PTR_ERR(dir);
2725

28-
return 0;
26+
return PTR_ERR_OR_ZERO(dir);
2927
}
3028

3129
late_initcall(fail_usercopy_debugfs);

0 commit comments

Comments
 (0)