Message ID | 1479257416-29389-5-git-send-email-andre.przywara@arm.com |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show |
On 11/15/2016 04:52 PM, Andre Przywara wrote: > The error checking makes only sense if the previous line has been > executed, so add block braces around the _whole_ then clause. > > Pointed out by GCC 6.2's -Wmisleading-indentation warning. > > Signed-off-by: Andre Przywara <andre.przywara@arm.com> > --- > drivers/net/ldpaa_eth/ldpaa_eth.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c > index 75b2b6b..4e61700 100644 > --- a/drivers/net/ldpaa_eth/ldpaa_eth.c > +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c > @@ -420,13 +420,14 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd) > goto err_dpmac_setup; > > #ifdef CONFIG_PHYLIB > - if (priv->phydev) > + if (priv->phydev) { > err = phy_startup(priv->phydev); > if (err) { > printf("%s: Could not initialize\n", > priv->phydev->dev->name); > goto err_dpamc_bind; > } > + } > #else > priv->phydev = (struct phy_device *)malloc(sizeof(struct phy_device)); > memset(priv->phydev, 0, sizeof(struct phy_device)); > This is being addressed by http://patchwork.ozlabs.org/patch/690814/. Currently in my test queue. York
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c index 75b2b6b..4e61700 100644 --- a/drivers/net/ldpaa_eth/ldpaa_eth.c +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c @@ -420,13 +420,14 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd) goto err_dpmac_setup; #ifdef CONFIG_PHYLIB - if (priv->phydev) + if (priv->phydev) { err = phy_startup(priv->phydev); if (err) { printf("%s: Could not initialize\n", priv->phydev->dev->name); goto err_dpamc_bind; } + } #else priv->phydev = (struct phy_device *)malloc(sizeof(struct phy_device)); memset(priv->phydev, 0, sizeof(struct phy_device));
The error checking makes only sense if the previous line has been executed, so add block braces around the _whole_ then clause. Pointed out by GCC 6.2's -Wmisleading-indentation warning. Signed-off-by: Andre Przywara <andre.przywara@arm.com> --- drivers/net/ldpaa_eth/ldpaa_eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)