net: hisilicon: fix ptr_ret.cocci warnings
authorWu Fengguang <fengguang.wu@intel.com>
Tue, 20 Oct 2015 06:56:00 +0000 (14:56 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Oct 2015 02:38:26 +0000 (19:38 -0700)
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: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hnae.c

index 9d3bb8349a733e21f7c3547d6f45fd080b5b9802..b3645297477e53309918e6762c44a6bfde031880 100644 (file)
@@ -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)