From patchwork Mon Dec 10 08:55:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 13436 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AE54E23E1A for ; Mon, 10 Dec 2012 08:56:25 +0000 (UTC) Received: from mail-ia0-f173.google.com (mail-ia0-f173.google.com [209.85.210.173]) by fiordland.canonical.com (Postfix) with ESMTP id 64664A19058 for ; Mon, 10 Dec 2012 08:56:25 +0000 (UTC) Received: by mail-ia0-f173.google.com with SMTP id w21so3513771iac.4 for ; Mon, 10 Dec 2012 00:56:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Zbjf/6htPlXQ/slLN8Sfia51iQOqdJqJEXPPmcYtt+s=; b=kgerdMjJNx4wnR+Mz4aYeQTH5ee8HuSn9YV1R8QaHupXlleK19Vvc902ba0LqhHmx+ ZMtpDqnYBj90nuqLk/4RpXQakNidW3e4ovH7dOavhvDnXnaVqc2GVLFQ+1Eqe7EHtBMw 3R5iLS8XWcIFuQlKswxYZg/jwwdpFnV8IxhrwgBaa0mD2Fw7Xx3vGrJCCfFPR1Amztvk ehJ4JEonL15xKwba3iWeEvj2vsFYoaYLLGUx8yL0Y6c7BT4g2TJTBub6MSo/T+NSByWI usCL1uWoQ3JSXb8VM8hdRwcSZ2GRT7hIkg+clwASdoqVzJu+i5uel23+AAVbz1cLfVZU tFtw== Received: by 10.50.36.164 with SMTP id r4mr5839025igj.57.1355129784785; Mon, 10 Dec 2012 00:56:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp54750igt; Mon, 10 Dec 2012 00:56:24 -0800 (PST) Received: by 10.180.81.170 with SMTP id b10mr9344060wiy.16.1355129783681; Mon, 10 Dec 2012 00:56:23 -0800 (PST) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id d14si13805038wea.97.2012.12.10.00.56.23 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 00:56:23 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wg0-f50.google.com with SMTP id es5so1073624wgb.5 for ; Mon, 10 Dec 2012 00:56:23 -0800 (PST) Received: by 10.216.211.84 with SMTP id v62mr4990184weo.158.1355129783109; Mon, 10 Dec 2012 00:56:23 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id fv2sm9173114wib.4.2012.12.10.00.56.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 00:56:22 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, ulf.hansson@linaro.org, Lee Jones , Mark Brown Subject: [PATCH 03/12] regulator: gpio-regulator: Fix logical error in for() loop Date: Mon, 10 Dec 2012 08:55:52 +0000 Message-Id: <1355129761-8088-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355129761-8088-1-git-send-email-lee.jones@linaro.org> References: <1355129761-8088-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnFBISNgkVm/0XdbDjTrp16KHq6qWtKXL2C+N7/vrEsxkpOpurl+EqkWBLzWBav7f6dNd1c The cond-statement of this particular for() loop will always be true as long as at least one voltage-shifting GPIO is present. If it wasn't for the break below, we'd be stuck in a forever loop. This patch inserts the correct cond-statement into the statement. Cc: Mark Brown Signed-off-by: Lee Jones --- drivers/regulator/gpio-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 3afa46a..5462c28 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c @@ -181,7 +181,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) if (!config->gpios) return ERR_PTR(-ENOMEM); - for (i = 0; config->nr_gpios; i++) { + for (i = 0; i < config->nr_gpios; i++) { gpio = of_get_named_gpio(np, "gpios", i); if (gpio < 0) break;