iio: core: fix ptr_ret.cocci warnings
authorFengguang Wu <[email protected]>
Wed, 20 Jan 2016 23:01:19 +0000 (15:01 -0800)
committerLinus Torvalds <[email protected]>
Thu, 21 Jan 2016 01:09:18 +0000 (17:09 -0800)
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

Signed-off-by: Fengguang Wu <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Hartmut Knaack <[email protected]>
Cc: Octavian Purdila <[email protected]>
Cc: Paul Bolle <[email protected]>
Cc: Adriana Reus <[email protected]>
Cc: Daniel Baluta <[email protected]>
Cc: Cristina Opriceana <[email protected]>
Cc: Peter Meerwald <[email protected]>
Cc: Alexander Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/iio/industrialio-sw-trigger.c

index 311f9fe5aa34bd809b2705e50c84682f460e35f1..8d24fb159cc92504c16938529542c117bd38000d 100644 (file)
@@ -167,9 +167,7 @@ static int __init iio_sw_trigger_init(void)
                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);