From: kernel test robot <lkp(a)intel.com>
drivers/iio/industrialio-sw-trigger.c:169: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: 970438474716 ("UPSTREAM: iio: core: Introduce IIO software triggers")
CC: Daniel Baluta <daniel.baluta(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
tree:
https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
head: aac4814b1098ee558c879fb53cbbaa5596d2aec7
commit: 9704384747162dd0ecd4b4859cd2a5861065fc82 [6/9] UPSTREAM: iio: core: Introduce IIO
software triggers
industrialio-sw-trigger.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/iio/industrialio-sw-trigger.c
+++ b/drivers/iio/industrialio-sw-trigger.c
@@ -166,9 +166,7 @@ static int __init iio_sw_trigger_init(vo
configfs_register_default_group(&iio_configfs_subsys.su_group,
"triggers",
&iio_triggers_group_type);
- if (IS_ERR(iio_triggers_group))
- return PTR_ERR(iio_triggers_group);
- return 0;
+ return PTR_ERR_OR_ZERO(iio_triggers_group);
}
module_init(iio_sw_trigger_init);