瀏覽代碼

net: hns: mdio->irq is an array, so no need to check if it is null

The null check on mdio->irq is redundant since mdio->irq is an array
of PHY_MAX_ADDR ints and hence can never be null. Remove the redundant
check.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King 9 年之前
父節點
當前提交
cfaace269d
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c

+ 1 - 2
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c

@@ -684,8 +684,7 @@ hns_mac_register_phydev(struct mii_bus *mdio, struct hns_mac_cb *mac_cb,
 	if (!phy || IS_ERR(phy))
 	if (!phy || IS_ERR(phy))
 		return -EIO;
 		return -EIO;
 
 
-	if (mdio->irq)
-		phy->irq = mdio->irq[addr];
+	phy->irq = mdio->irq[addr];
 
 
 	/* All data is now stored in the phy struct;
 	/* All data is now stored in the phy struct;
 	 * register it
 	 * register it