From: kbuild test robot <lkp@xxxxxxxxx> drivers/base/power/wakeup_stats.c:143:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Fixes: 0b050f7fb8a1 ("PM / wakeup: show wakeup sources stats in sysfs") CC: Tri Vo <trong@xxxxxxxxxxx> Signed-off-by: kbuild test robot <lkp@xxxxxxxxx> --- tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge head: 14b99dcec44e7bca9f01e042002f57e9f0dda133 commit: 0b050f7fb8a1e45c72ca945bac2821a59d4a0101 [21/23] PM / wakeup: show wakeup sources stats in sysfs wakeup_stats.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/base/power/wakeup_stats.c +++ b/drivers/base/power/wakeup_stats.c @@ -140,10 +140,7 @@ EXPORT_SYMBOL_GPL(wakeup_source_sysfs_re static int __init wakeup_sources_sysfs_init(void) { wakeup_class = class_create(THIS_MODULE, "wakeup"); - if (IS_ERR(wakeup_class)) - return PTR_ERR(wakeup_class); - - return 0; + return PTR_ERR_OR_ZERO(wakeup_class); } postcore_initcall(wakeup_sources_sysfs_init);