linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: qcom_spmi: Add missing braces for aligned code
@ 2015-06-16 18:11 Stephen Boyd
  2015-06-16 20:31 ` Andy Gross
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Boyd @ 2015-06-16 18:11 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Julia Lawall

drivers/regulator/qcom_spmi-regulator.c:751:3-50: code aligned
with following code on line 753
drivers/regulator/qcom_spmi-regulator.c:584:3-41: code aligned
with following code on line 587

These lines where missing braces causing the break to always
be executed even when it shouldn't be. Fix it.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/regulator/qcom_spmi-regulator.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 162b86501a91..ff6ccc734565 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -580,11 +580,12 @@ static int spmi_regulator_select_voltage_same_range(struct spmi_regulator *vreg,
 	*selector = 0;
 	for (i = 0; i < vreg->set_points->count; i++) {
 		if (uV >= vreg->set_points->range[i].set_point_min_uV
-		    && uV <= vreg->set_points->range[i].set_point_max_uV)
+		    && uV <= vreg->set_points->range[i].set_point_max_uV) {
 			*selector +=
 			    (uV - vreg->set_points->range[i].set_point_min_uV)
 				/ vreg->set_points->range[i].step_uV;
 			break;
+		}
 
 		*selector += vreg->set_points->range[i].n_voltages;
 	}
@@ -747,10 +748,11 @@ static int spmi_regulator_common_list_voltage(struct regulator_dev *rdev,
 		return 0;
 
 	for (i = 0; i < vreg->set_points->count; i++) {
-		if (selector < vreg->set_points->range[i].n_voltages)
+		if (selector < vreg->set_points->range[i].n_voltages) {
 			uV = selector * vreg->set_points->range[i].step_uV
 				+ vreg->set_points->range[i].set_point_min_uV;
 			break;
+		}
 
 		selector -= vreg->set_points->range[i].n_voltages;
 	}
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: qcom_spmi: Add missing braces for aligned code
  2015-06-16 18:11 [PATCH] regulator: qcom_spmi: Add missing braces for aligned code Stephen Boyd
@ 2015-06-16 20:31 ` Andy Gross
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Gross @ 2015-06-16 20:31 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Mark Brown, linux-kernel, linux-arm-msm, linux-arm-kernel, Julia Lawall

On Tue, Jun 16, 2015 at 11:11:22AM -0700, Stephen Boyd wrote:
> drivers/regulator/qcom_spmi-regulator.c:751:3-50: code aligned
> with following code on line 753
> drivers/regulator/qcom_spmi-regulator.c:584:3-41: code aligned
> with following code on line 587
> 
> These lines where missing braces causing the break to always
> be executed even when it shouldn't be. Fix it.
> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Cc: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Reviewed-by: Andy Gross <agross@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-16 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 18:11 [PATCH] regulator: qcom_spmi: Add missing braces for aligned code Stephen Boyd
2015-06-16 20:31 ` Andy Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).