From patchwork Thu Sep 4 12:01:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 36693 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BD870202E4 for ; Thu, 4 Sep 2014 12:02:54 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id w7sf30613277qcr.11 for ; Thu, 04 Sep 2014 05:02:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=nVq6+aZThlCXxNuCD+sGsyoATQEQbj7twjojLEtQB5g=; b=Q1f4zX5jNkk/UZBlBAJ8++k6jd0Wptiiaa0z0w7BxrXlL3EKrwZenywF+N5yw9poas XQ7LqIp+4qHw8QOF/stvuun58Uo6IDaSNx7QmPI4ge9z7iopI9KMUxzZQfdYjIwyUQYm f/trBAmhzKWYRlqLxL7NzfYOIw5El5OfkhB3NZOVbp5vG8FwJosBefQXwJGjrgX4LPh6 iAzwmJptLOA8Vl37KnM8wh4Jm683dqbK6EFpntP1dpxDZ8IofHeY+KziFsGYHeMvjkNs w6J05w4uoJn8ojsdp3ab8etHG/C7VV1MxrWDn37b2KhCt7iybLzcpev56wmLI5NUupwv mxxg== X-Gm-Message-State: ALoCoQkAJTdKVX2Hvnnws9qdoE3T+rqa4D+geYJD3MJ3wSsH8Pq/k66RB2/qyWYarhfIIJ7a1MSo X-Received: by 10.236.36.99 with SMTP id v63mr2213280yha.2.1409832174631; Thu, 04 Sep 2014 05:02:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.229 with SMTP id 92ls233653qgn.98.gmail; Thu, 04 Sep 2014 05:02:54 -0700 (PDT) X-Received: by 10.220.202.9 with SMTP id fc9mr775991vcb.40.1409832174502; Thu, 04 Sep 2014 05:02:54 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id h9si2723147vdk.39.2014.09.04.05.02.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Sep 2014 05:02:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ij19so10377848vcb.40 for ; Thu, 04 Sep 2014 05:02:54 -0700 (PDT) X-Received: by 10.52.73.202 with SMTP id n10mr306761vdv.86.1409832174419; Thu, 04 Sep 2014 05:02:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp824301vcb; Thu, 4 Sep 2014 05:02:53 -0700 (PDT) X-Received: by 10.66.225.141 with SMTP id rk13mr7935094pac.112.1409832173378; Thu, 04 Sep 2014 05:02:53 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id lp3si3076549pab.230.2014.09.04.05.02.48 for ; Thu, 04 Sep 2014 05:02:48 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753891AbaIDMCd (ORCPT + 15 others); Thu, 4 Sep 2014 08:02:33 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:45239 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753774AbaIDMCc (ORCPT ); Thu, 4 Sep 2014 08:02:32 -0400 Received: by mail-pa0-f43.google.com with SMTP id et14so19910551pad.30 for ; Thu, 04 Sep 2014 05:02:30 -0700 (PDT) X-Received: by 10.70.129.34 with SMTP id nt2mr8128740pdb.70.1409832150787; Thu, 04 Sep 2014 05:02:30 -0700 (PDT) Received: from localhost ([122.167.123.172]) by mx.google.com with ESMTPSA id bn4sm1535482pbc.40.2014.09.04.05.02.29 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Sep 2014 05:02:30 -0700 (PDT) From: Viresh Kumar To: sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org, anton@enomsg.org Cc: linux-pm@vger.kernel.org, linaro-kernel@lists.linaro.org, Viresh Kumar Subject: [PATCH 06/15] power-supply: Use 'break' instead of 'continue' to end loop Date: Thu, 4 Sep 2014 17:31:27 +0530 Message-Id: X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: <2eacd908a8094887cc1796f75ae0513be8a3e36d.1409831636.git.viresh.kumar@linaro.org> References: <2eacd908a8094887cc1796f75ae0513be8a3e36d.1409831636.git.viresh.kumar@linaro.org> In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- drivers/power/power_supply_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {