提交 c6aa74d5 编写于 作者: W Wu Fengguang 提交者: David S. Miller

net: hisilicon: fix ptr_ret.cocci warnings

drivers/net/ethernet/hisilicon/hns/hnae.c:442: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

CC: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 feec0cb3
......@@ -439,10 +439,7 @@ EXPORT_SYMBOL(hnae_ae_unregister);
static int __init hnae_init(void)
{
hnae_class = class_create(THIS_MODULE, "hnae");
if (IS_ERR(hnae_class))
return PTR_ERR(hnae_class);
return 0;
return PTR_ERR_OR_ZERO(hnae_class);
}
static void __exit hnae_exit(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册