From patchwork Tue Jun 16 18:11:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 6619401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 206149F326 for ; Tue, 16 Jun 2015 18:14:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D348207F8 for ; Tue, 16 Jun 2015 18:14:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDCE8207ED for ; Tue, 16 Jun 2015 18:14:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4vKw-0001v1-G1; Tue, 16 Jun 2015 18:11:50 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4vKs-0001pj-8p for linux-arm-kernel@lists.infradead.org; Tue, 16 Jun 2015 18:11:47 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 0939E140D3F; Tue, 16 Jun 2015 18:11:25 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id C8531140D7A; Tue, 16 Jun 2015 18:11:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E7090140D3F; Tue, 16 Jun 2015 18:11:23 +0000 (UTC) From: Stephen Boyd To: Mark Brown Subject: [PATCH] regulator: qcom_spmi: Add missing braces for aligned code Date: Tue, 16 Jun 2015 11:11:22 -0700 Message-Id: <1434478282-13552-1-git-send-email-sboyd@codeaurora.org> X-Mailer: git-send-email 2.3.0.rc1.33.g42e4583 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150616_111146_334976_86F8B837 X-CRM114-Status: GOOD ( 15.16 ) X-Spam-Score: -0.6 (/) Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Julia Lawall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Julia Lawall Signed-off-by: Stephen Boyd Reviewed-by: Andy Gross --- 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; }