]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
net: phy: micrel: Fix error handling
authorMarek Vasut <marex@denx.de>
Mon, 14 Nov 2016 14:08:42 +0000 (15:08 +0100)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 8 Dec 2016 16:36:21 +0000 (10:36 -0600)
Fix the following error, the $ret variable handling must
be part of the loop, while due to the missing parenthesis
it was not.

drivers/net/phy/micrel.c: In function ‘ksz9021_of_config’:
drivers/net/phy/micrel.c:303:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
  for (i = 0; i < ARRAY_SIZE(ofcfg); i++)
  ^~~
drivers/net/phy/micrel.c:305:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
   if (ret)
   ^~
drivers/net/phy/micrel.c: In function ‘ksz9031_of_config’:
drivers/net/phy/micrel.c:411:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
  for (i = 0; i < ARRAY_SIZE(ofcfg); i++)
  ^~~
drivers/net/phy/micrel.c:413:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
   if (ret)
   ^~

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/phy/micrel.c

index 28a14018835b175469233385af7546e0ac3ceddd..7163fa257f4c5ad5f9476a862fe5b267f8684d33 100644 (file)
@@ -300,10 +300,11 @@ static int ksz9021_of_config(struct phy_device *phydev)
        };
        int i, ret = 0;
 
-       for (i = 0; i < ARRAY_SIZE(ofcfg); i++)
+       for (i = 0; i < ARRAY_SIZE(ofcfg); i++) {
                ret = ksz90x1_of_config_group(phydev, &(ofcfg[i]));
                if (ret)
                        return ret;
+       }
 
        return 0;
 }
@@ -408,10 +409,11 @@ static int ksz9031_of_config(struct phy_device *phydev)
        };
        int i, ret = 0;
 
-       for (i = 0; i < ARRAY_SIZE(ofcfg); i++)
+       for (i = 0; i < ARRAY_SIZE(ofcfg); i++) {
                ret = ksz90x1_of_config_group(phydev, &(ofcfg[i]));
                if (ret)
                        return ret;
+       }
 
        return 0;
 }