diff mbox

[06/15] power-supply: Use 'break' instead of 'continue' to end loop

Message ID f89da51fb4e274d10734f58a2631ea4c6bb7542f.1409831636.git.viresh.kumar@linaro.org
State Accepted
Commit a0f93b4268d903430d7e21110f10be0919daf3b2
Headers show

Commit Message

Viresh Kumar Sept. 4, 2014, 12:01 p.m. UTC
In few routines, we need to end the do-while loop when no more "power-supplies"
are available. Currently we are doing 'continue' which will make the
'while(np)' conditional statement run again.

Skip this by doing a 'break' instead.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/power/power_supply_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 71d00ec..7657335 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -127,7 +127,7 @@  static int __power_supply_populate_supplied_from(struct device *dev,
 	do {
 		np = of_parse_phandle(psy->of_node, "power-supplies", i++);
 		if (!np)
-			continue;
+			break;
 
 		if (np == epsy->of_node) {
 			dev_info(psy->dev, "%s: Found supply : %s\n",
@@ -215,7 +215,7 @@  static int power_supply_check_supplies(struct power_supply *psy)
 
 		np = of_parse_phandle(psy->of_node, "power-supplies", cnt++);
 		if (!np)
-			continue;
+			break;
 
 		ret = power_supply_find_supply_from_node(np);
 		if (ret) {