mirror of https://github.com/torvalds/linux.git
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:
parent
a6cf527e66
commit
6c0022d6dc
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue