From: Florian Fainelli <f.faine...@gmail.com>
Date: Wed, 29 Apr 2015 18:57:40 -0700

> @@ -2321,7 +2321,7 @@ static void port_start(struct mv643xx_eth_private *mp)
>       wrlp(mp, PORT_SERIAL_CONTROL, pscr);
>  
>       pscr |= DO_NOT_FORCE_LINK_FAIL;
> -     if (mp->phy == NULL)
> +     if (mp->phy == NULL || (mp->phy && phy_is_ethswitch(mp->phy)))
>               pscr |= FORCE_LINK_PASS;

Maybe it looks clearer to you in this form, but the C language
guarentees that:

        if (!ptr || ptr->foo)

will not perform a NULL pointer deref.

So I'm pretty sure you could simply this statement to:

        if (mp->phy == NULL || phy_is_ethswitch(mp->phy))
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to