From patchwork Thu Jul 30 07:10:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 6898961 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@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 EE0709F38B for ; Thu, 30 Jul 2015 07:11:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F7792054A for ; Thu, 30 Jul 2015 07:11:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76F2520575 for ; Thu, 30 Jul 2015 07:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753818AbbG3HK6 (ORCPT ); Thu, 30 Jul 2015 03:10:58 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33894 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753289AbbG3HK5 (ORCPT ); Thu, 30 Jul 2015 03:10:57 -0400 Received: by pacan13 with SMTP id an13so19150174pac.1 for ; Thu, 30 Jul 2015 00:10:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=oa/F3tCEpUxk9bfIYQBwlrnhYgXs415Z7krJd3WgNTQ=; b=Il4O/n36LAFP68r64PCZ7WmpqUe27Pho4xc8t2SMCG5xNqYz3U2DPaxEcDvtg5LAjL pyJ9ilfz8siPcVj3TsL9dVarjhB0ls40JN2Fg2g4LP1Iytl8xNJ2FEaG/ZyOOVncKgWt 045PrsksHygoKZhG2VY5TUWuiEf7qJgCGk4U+s5OXDOWb8Lg9fLBz/VK3UsZgijA7+SJ VVU5+ihSUdDfft1/yKiwobP28msw2rPDw3CbIj2/NFh1trVKHsaEC/Zfds5lIzGcp7OP /yTuscxxM8nYQ6RuWj9xdtBSPbmBiKC2NYXclNTwZRXRE3Vjx3BK0PwUOE4+ygGCmwHy xfpw== X-Gm-Message-State: ALoCoQlgaD6DYKnmtwp3kf2sCZLZPi2ioclphGWSUChVto+WIYYyx5kuSpTHwIVl3GVHcStv95ce X-Received: by 10.66.221.138 with SMTP id qe10mr100330611pac.45.1438240256702; Thu, 30 Jul 2015 00:10:56 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id cr4sm331623pac.10.2015.07.30.00.10.55 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 30 Jul 2015 00:10:56 -0700 (PDT) From: Viresh Kumar To: edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, rui.zhang@intel.com, linux-pm@vger.kernel.org, radivoje.jovanovic@linux.intel.com, punit.agrawal@arm.com, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/6] thermal/cpu_cooling: quit early after updating policy Date: Thu, 30 Jul 2015 12:40:31 +0530 Message-Id: <47594802e96dc2b1e727fd88f92b3fa4459b4d09.1438239727.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a valid cpufreq_dev is found for policy->cpu, we should update the policy and quit the for loop. There is no need to keep traversing the list of cpufreq_dev's. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index d010c6d0d722..276cec5a1fb7 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -232,6 +232,7 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb, if (policy->max != max_freq) cpufreq_verify_within_limits(policy, 0, max_freq); + break; } mutex_unlock(&cooling_cpufreq_lock); break;