diff options
author | kbuild test robot <lkp@intel.com> | 2020-02-04 17:22:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-05 15:55:32 +0300 |
commit | 34611e6996f331399ee26382fdbc2bd009f9cdd6 (patch) | |
tree | d87fbbc327babaef24cfb90ddce987a0762a16b8 /drivers/net | |
parent | 9784e619f0a0ada7421ffd777872a199cdcb73cd (diff) | |
download | linux-34611e6996f331399ee26382fdbc2bd009f9cdd6.tar.xz |
netdevsim: fix ptr_ret.cocci warnings
drivers/net/netdevsim/dev.c:937: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: 6556ff32f12d ("netdevsim: use IS_ERR instead of IS_ERR_OR_NULL for debugfs")
CC: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/netdevsim/dev.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index 5c5427c840b6..d7706a0346f2 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c @@ -934,9 +934,7 @@ int nsim_dev_port_del(struct nsim_bus_dev *nsim_bus_dev, int nsim_dev_init(void) { nsim_dev_ddir = debugfs_create_dir(DRV_NAME, NULL); - if (IS_ERR(nsim_dev_ddir)) - return PTR_ERR(nsim_dev_ddir); - return 0; + return PTR_ERR_OR_ZERO(nsim_dev_ddir); } void nsim_dev_exit(void) |