Skip to contentSkip to conversation

thermal: Add braces around suspect code

PATCH In review Stephen Boyd 2 participants 2 messages Jun 18, 2014 – Jun 30, 2014 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: Add braces around suspect code

It looks like this code is missing braces, otherwise the if statement shouldn't have been indented. Fix it.

---
 drivers/thermal/of-thermal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/thermal/of-thermal.c +2 -1
index 04b1be7fa018..a95ee2889b19 100644
@@ -712,11 +712,12 @@ thermal_of_build_thermal_zone(struct device_node *np)
 	}
 
 	i = 0;
-	for_each_child_of_node(child, gchild)
+	for_each_child_of_node(child, gchild) {
 		ret = thermal_of_populate_bind_params(gchild, &tz->tbps[i++],
 						      tz->trips, tz->ntrips);
 		if (ret)
 			goto free_tbps;
+	}
 
 finish:
 	of_node_put(child);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Stephen Boyd

It looks like this code is missing braces, otherwise the if statement shouldn't have been indented. Fix it.

---
 drivers/thermal/of-thermal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/thermal/of-thermal.c +0 -0
index 04b1be7fa018..a95ee2889b19 100644
@@ -712,11 +712,12 @@ thermal_of_build_thermal_zone(struct device_node *np)
 	}
 
 	i = 0;

drivers/thermal/of-thermal.c thermal_of_build_thermal_zone(struct device_node *np) · line 723

Quoted 10 lines
drivers/thermal/of-thermal.c +2 -1
-	for_each_child_of_node(child, gchild)
+	for_each_child_of_node(child, gchild) {
 		ret = thermal_of_populate_bind_params(gchild, &tz->tbps[i++],
 						      tz->trips, tz->ntrips);
 		if (ret)
 			goto free_tbps;
+	}
 
 finish:
 	of_node_put(child);

Looks good to me.