Thread (5 messages) flat view 5 messages, 2 authors, 2014-02-20

Re: [net-next 1/3] net: bcmgenet: drop checks on priv->phydev

From: Sergei Shtylyov <hidden>
Date: 2014-02-20 22:54:04

Hello.

On 02/20/2014 11:53 PM, Florian Fainelli wrote:
Drop all the checks on priv->phydev since we will refuse probing the
driver if we cannot attach to a PHY device. Drop all checks on
priv->phydev. This also fixes some smatch issues reported by Dan
Carpenter where smatch would complain that a pointer is not always
checked correctly.
Reported-by: Dan Carpenter <redacted>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
  drivers/net/ethernet/broadcom/genet/bcmgenet.c | 15 +++++----------
  1 file changed, 5 insertions(+), 10 deletions(-)
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 0ebc297..8af5f07 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
[...]
quoted hunk ↗ jump to hunk
@@ -1811,8 +1810,7 @@ static void bcmgenet_irq_task(struct work_struct *work)
  	/* Link UP/DOWN event */
  	if ((priv->hw_params->flags & GENET_HAS_MDIO_INTR) &&
  		(priv->irq0_stat & (UMAC_IRQ_LINK_UP|UMAC_IRQ_LINK_DOWN))) {
-		if (priv->phydev)
-			phy_mac_interrupt(priv->phydev,
+		phy_mac_interrupt(priv->phydev,
  				(priv->irq0_stat & UMAC_IRQ_LINK_UP));
    Should probably realign this line (although it wasn't correctly aligned 
before). Also () are not needed around &.

WBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help