提交 34611e69 编写于 作者: K kbuild test robot 提交者: David S. Miller

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: 6556ff32 ("netdevsim: use IS_ERR instead of IS_ERR_OR_NULL for debugfs")
CC: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Nkbuild test robot <lkp@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9784e619
...@@ -934,9 +934,7 @@ int nsim_dev_port_del(struct nsim_bus_dev *nsim_bus_dev, ...@@ -934,9 +934,7 @@ int nsim_dev_port_del(struct nsim_bus_dev *nsim_bus_dev,
int nsim_dev_init(void) int nsim_dev_init(void)
{ {
nsim_dev_ddir = debugfs_create_dir(DRV_NAME, NULL); nsim_dev_ddir = debugfs_create_dir(DRV_NAME, NULL);
if (IS_ERR(nsim_dev_ddir)) return PTR_ERR_OR_ZERO(nsim_dev_ddir);
return PTR_ERR(nsim_dev_ddir);
return 0;
} }
void nsim_dev_exit(void) void nsim_dev_exit(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册