From patchwork Mon Apr 14 21:08:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stratos Karafotis X-Patchwork-Id: 3986381 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7FE2BFF02 for ; Mon, 14 Apr 2014 21:20:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1621B20170 for ; Mon, 14 Apr 2014 21:20:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 334732015A for ; Mon, 14 Apr 2014 21:20:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755463AbaDNVIn (ORCPT ); Mon, 14 Apr 2014 17:08:43 -0400 Received: from sema.semaphore.gr ([78.46.194.137]:54726 "EHLO sema.semaphore.gr" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750993AbaDNVIh (ORCPT ); Mon, 14 Apr 2014 17:08:37 -0400 Received: from albert.lan (ppp079166063152.access.hol.gr [79.166.63.152]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: stratosk) by sema.semaphore.gr (Postfix) with ESMTPSA id 4164A837F0; Mon, 14 Apr 2014 23:08:32 +0200 (CEST) Message-ID: <534C4E52.2010103@semaphore.gr> Date: Tue, 15 Apr 2014 00:08:34 +0300 From: Stratos Karafotis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Viresh Kumar , Sudeep Holla , "Rafael J. Wysocki" CC: cpufreq@vger.kernel.org, "linux-pm@vger.kernel.org" , LKML Subject: [PATCH 04/20] cpufreq: arm_big_little: Use cpufreq_for_each_entry macro for iteration Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.9 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 The cpufreq core supports the cpufreq_for_each_entry macro helper for iteration over the cpufreq_frequency_table, so use it. It should have no functional changes. Signed-off-by: Stratos Karafotis --- drivers/cpufreq/arm_big_little.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index bad2ed3..59c87f8 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -226,22 +226,24 @@ static inline u32 get_table_count(struct cpufreq_frequency_table *table) /* get the minimum frequency in the cpufreq_frequency_table */ static inline u32 get_table_min(struct cpufreq_frequency_table *table) { - int i; + struct cpufreq_frequency_table *pos; uint32_t min_freq = ~0; - for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) - if (table[i].frequency < min_freq) - min_freq = table[i].frequency; + cpufreq_for_each_entry(pos, table) { + if (pos->frequency < min_freq) + min_freq = pos->frequency; + } return min_freq; } /* get the maximum frequency in the cpufreq_frequency_table */ static inline u32 get_table_max(struct cpufreq_frequency_table *table) { - int i; + struct cpufreq_frequency_table *pos; uint32_t max_freq = 0; - for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) - if (table[i].frequency > max_freq) - max_freq = table[i].frequency; + cpufreq_for_each_entry(pos, table) { + if (pos->frequency > max_freq) + max_freq = pos->frequency; + } return max_freq; }