diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2015-10-20 02:56:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-21 22:38:26 -0400 |
commit | c6aa74d546ccb94c99a1e95fb461f8b0e9410a3e (patch) | |
tree | 02a727654ec1ee60e2f2f0f038308894acf9cfdb | |
parent | feec0cb3f20b837f8ca36e974267918d7a4497f8 (diff) |
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: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hnae.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.c b/drivers/net/ethernet/hisilicon/hns/hnae.c index 9d3bb8349a73..b3645297477e 100644 --- a/drivers/net/ethernet/hisilicon/hns/hnae.c +++ b/drivers/net/ethernet/hisilicon/hns/hnae.c | |||
@@ -439,10 +439,7 @@ EXPORT_SYMBOL(hnae_ae_unregister); | |||
439 | static int __init hnae_init(void) | 439 | static int __init hnae_init(void) |
440 | { | 440 | { |
441 | hnae_class = class_create(THIS_MODULE, "hnae"); | 441 | hnae_class = class_create(THIS_MODULE, "hnae"); |
442 | if (IS_ERR(hnae_class)) | 442 | return PTR_ERR_OR_ZERO(hnae_class); |
443 | return PTR_ERR(hnae_class); | ||
444 | |||
445 | return 0; | ||
446 | } | 443 | } |
447 | 444 | ||
448 | static void __exit hnae_exit(void) | 445 | static void __exit hnae_exit(void) |