aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
diff options
context:
space:
mode:
authorHuazhong Tan <tanhuazhong@huawei.com>2020-01-21 16:42:13 +0800
committerDavid S. Miller <davem@davemloft.net>2020-01-21 11:46:21 +0100
commit60df7e91cc3efa141802dffad3a82b95c2ec479e (patch)
tree2d10b3addf8e04c473b0abf2947475d275028d03 /drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
parentnet: hns3: remove redundant print on ENOMEM (diff)
downloadlinux-dev-60df7e91cc3efa141802dffad3a82b95c2ec479e.tar.xz
linux-dev-60df7e91cc3efa141802dffad3a82b95c2ec479e.zip
net: hns3: cleanup some coding style issue
This patch removes some unnecessary return value assignments, some duplicated printing in the caller, refines the judgment of 0 and uses le16_to_cpu to replace __le16_to_cpu. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_enet.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_enet.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 6271b693ddad..acb796cc10d0 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -2094,10 +2094,8 @@ static int hns3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
int ret;
ae_dev = devm_kzalloc(&pdev->dev, sizeof(*ae_dev), GFP_KERNEL);
- if (!ae_dev) {
- ret = -ENOMEM;
- return ret;
- }
+ if (!ae_dev)
+ return -ENOMEM;
ae_dev->pdev = pdev;
ae_dev->flag = ent->driver_data;