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

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>

authored by

Xichao Zhao and committed by
Andrew Morton
6c0022d6 a6cf527e

+1 -3
+1 -3
lib/fault-inject-usercopy.c
··· 22 22 23 23 dir = fault_create_debugfs_attr("fail_usercopy", NULL, 24 24 &fail_usercopy.attr); 25 - if (IS_ERR(dir)) 26 - return PTR_ERR(dir); 27 25 28 - return 0; 26 + return PTR_ERR_OR_ZERO(dir); 29 27 } 30 28 31 29 late_initcall(fail_usercopy_debugfs);