aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns_mdio.c
diff options
context:
space:
mode:
authorYonglong Liu <liuyonglong@huawei.com>2021-03-23 15:41:09 +0800
committerDavid S. Miller <davem@davemloft.net>2021-03-24 12:07:21 -0700
commit7f8bcd915724f9485475b515c554b840278526bc (patch)
treec427e4df9ba4669d7269a67ed8c99b71bdc1c865 /drivers/net/ethernet/hisilicon/hns_mdio.c
parentnet: hns: remove unnecessary !! operation in hns_mac_config_sds_loopback_acpi() (diff)
downloadlinux-dev-7f8bcd915724f9485475b515c554b840278526bc.tar.xz
linux-dev-7f8bcd915724f9485475b515c554b840278526bc.zip
net: hns: remove redundant variable initialization
There are some variables in HNS driver will not being referenced before assigned, so there is no need to init them. Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns_mdio.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns_mdio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
index 883d0d7c6858..3e54017a2a5b 100644
--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
@@ -279,7 +279,7 @@ static int hns_mdio_write(struct mii_bus *bus,
static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
{
int ret;
- u16 reg_val = 0;
+ u16 reg_val;
u8 devad = ((regnum >> 16) & 0x1f);
u8 is_c45 = !!(regnum & MII_ADDR_C45);
u16 reg = (u16)(regnum & 0xffff);
@@ -420,7 +420,7 @@ static int hns_mdio_probe(struct platform_device *pdev)
{
struct hns_mdio_device *mdio_dev;
struct mii_bus *new_bus;
- int ret = -ENODEV;
+ int ret;
if (!pdev) {
dev_err(NULL, "pdev is NULL!\r\n");