diff mbox

iio: core: fix ptr_ret.cocci warnings

Message ID 20151023163837.GA1049@lkp-hsx03 (mailing list archive)
State New, archived
Headers show

Commit Message

kernel test robot Oct. 23, 2015, 4:38 p.m. UTC
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

CC: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 industrialio-sw-trigger.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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);