Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1462759 > unrolled thread

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

Started byColin King <colin.king@canonical.com>
First post2016-08-15 15:00 +0200
Last post2016-08-15 22:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: hns: mdio->irq is an array, so no need to check if it is null Colin King <colin.king@canonical.com> - 2016-08-15 15:00 +0200
    Re: [PATCH] net: hns: mdio->irq is an array, so no need to check  if it is null David Miller <davem@davemloft.net> - 2016-08-15 22:40 +0200

#1462759 — [PATCH] net: hns: mdio->irq is an array, so no need to check if it is null

FromColin King <colin.king@canonical.com>
Date2016-08-15 15:00 +0200
Subject[PATCH] net: hns: mdio->irq is an array, so no need to check if it is null
Message-ID<s6pEJ-5I5-7@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 5c8afe1..a834774 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/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))
 		return -EIO;
 
-	if (mdio->irq)
-		phy->irq = mdio->irq[addr];
+	phy->irq = mdio->irq[addr];
 
 	/* All data is now stored in the phy struct;
 	 * register it
-- 
2.8.1

[toc] | [next] | [standalone]


#1463157 — Re: [PATCH] net: hns: mdio->irq is an array, so no need to check if it is null

FromDavid Miller <davem@davemloft.net>
Date2016-08-15 22:40 +0200
SubjectRe: [PATCH] net: hns: mdio->irq is an array, so no need to check if it is null
Message-ID<s6wPT-1T2-5@gated-at.bofh.it>
In reply to#1462759
From: Colin King <colin.king@canonical.com>
Date: Mon, 15 Aug 2016 13:55:17 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>

Applied, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web