Commit 81fc9b5c authored by Tonghao Zhang's avatar Tonghao Zhang Committed by David S. Miller

drivers/net: Fix ptr_ret.cocci warnings.

we can use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
1. drivers/net/appletalk/ipddp.c
2. drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c

Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc88055a
...@@ -311,9 +311,7 @@ module_param(ipddp_mode, int, 0); ...@@ -311,9 +311,7 @@ module_param(ipddp_mode, int, 0);
static int __init ipddp_init_module(void) static int __init ipddp_init_module(void)
{ {
dev_ipddp = ipddp_init(); dev_ipddp = ipddp_init();
if (IS_ERR(dev_ipddp)) return PTR_ERR_OR_ZERO(dev_ipddp);
return PTR_ERR(dev_ipddp);
return 0;
} }
static void __exit ipddp_cleanup_module(void) static void __exit ipddp_cleanup_module(void)
......
...@@ -78,10 +78,7 @@ int brcmf_debug_attach(struct brcmf_pub *drvr) ...@@ -78,10 +78,7 @@ int brcmf_debug_attach(struct brcmf_pub *drvr)
return -ENODEV; return -ENODEV;
drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder);
if (IS_ERR(drvr->dbgfs_dir)) return PTR_ERR_OR_ZERO(drvr->dbgfs_dir);
return PTR_ERR(drvr->dbgfs_dir);
return 0;
} }
void brcmf_debug_detach(struct brcmf_pub *drvr) void brcmf_debug_detach(struct brcmf_pub *drvr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment