* [PATCH] net: hns: mdio->irq is an array, so no need to check if it is null
@ 2016-08-15 12:55 Colin King
2016-08-15 20:39 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-08-15 12:55 UTC (permalink / raw)
To: Yisen Zhuang, Salil Mehta, David S . Miller, Kejian Yan,
Daode Huang, lipeng, Lisheng, netdev
Cc: linux-kernel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: hns: mdio->irq is an array, so no need to check if it is null
2016-08-15 12:55 [PATCH] net: hns: mdio->irq is an array, so no need to check if it is null Colin King
@ 2016-08-15 20:39 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-08-15 20:39 UTC (permalink / raw)
To: colin.king
Cc: yisen.zhuang, salil.mehta, yankejian, huangdaode, lipeng321,
lisheng011, netdev, linux-kernel
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-15 20:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-15 12:55 [PATCH] net: hns: mdio->irq is an array, so no need to check if it is null Colin King
2016-08-15 20:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).