Skip to content

Commit b5497ee

Browse files
thomasmeydavem330
authored andcommitted
net: Use PTR_RET rather than if(IS_ERR(.. [1]
The semantic patch that makes this change is available in scripts/coccinelle/api/ptr_ret.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 47fd92f commit b5497ee

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

‎drivers/net/appletalk/cops.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,9 +996,7 @@ static int __init cops_module_init(void)
996996
printk(KERN_WARNING "%s: You shouldn't autoprobe with insmod\n",
997997
cardname);
998998
cops_dev = cops_probe(-1);
999-
if (IS_ERR(cops_dev))
1000-
return PTR_ERR(cops_dev);
1001-
return 0;
999+
return PTR_RET(cops_dev);
10021000
}
10031001

10041002
static void __exit cops_module_exit(void)

‎drivers/net/appletalk/ltpc.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,9 +1243,7 @@ static int __init ltpc_module_init(void)
12431243
"ltpc: Autoprobing is not recommended for modules\n");
12441244

12451245
dev_ltpc = ltpc_probe();
1246-
if (IS_ERR(dev_ltpc))
1247-
return PTR_ERR(dev_ltpc);
1248-
return 0;
1246+
return PTR_RET(dev_ltpc);
12491247
}
12501248
module_init(ltpc_module_init);
12511249
#endif

0 commit comments

Comments
 (0)