From patchwork Mon Apr 14 21:10:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stratos Karafotis X-Patchwork-Id: 4040901 Return-Path: X-Original-To: patchwork-davinci@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 32B7ABFF02 for ; Wed, 23 Apr 2014 13:10:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60EAF2017A for ; Wed, 23 Apr 2014 13:10:19 +0000 (UTC) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7F0320304 for ; Wed, 23 Apr 2014 13:10:17 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3ND9C3H012484; Wed, 23 Apr 2014 08:09:12 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3ND9B3L023432; Wed, 23 Apr 2014 08:09:11 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Wed, 23 Apr 2014 08:09:11 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3ND9AVl003903; Wed, 23 Apr 2014 08:09:10 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4AAD380627; Wed, 23 Apr 2014 08:09:10 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflxv17.itg.ti.com (dflxv17.itg.ti.com [128.247.5.93]) by linux.omap.com (Postfix) with ESMTP id A0F5C80626 for ; Mon, 14 Apr 2014 16:10:47 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3ELAltn019373 for ; Mon, 14 Apr 2014 16:10:47 -0500 Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3ELAk4L003189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Apr 2014 16:10:47 -0500 Received: from [216.82.250.51:23983] by server-15.bemta-12.messagelabs.com id D6/3A-19062-6DE4C435; Mon, 14 Apr 2014 21:10:46 +0000 X-Env-Sender: stratosk@semaphore.gr X-Msg-Ref: server-8.tower-108.messagelabs.com!1397509844!14810542!1 X-Originating-IP: [78.46.194.137] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7764 invoked from network); 14 Apr 2014 21:10:45 -0000 Received: from sema.semaphore.gr (HELO sema.semaphore.gr) (78.46.194.137) by server-8.tower-108.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 14 Apr 2014 21:10:45 -0000 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 97D63837FA; Mon, 14 Apr 2014 23:10:39 +0200 (CEST) Message-ID: <534C4ED1.7080901@semaphore.gr> Date: Tue, 15 Apr 2014 00:10:41 +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: Sekhar Nori , Kevin Hilman , Russell King Subject: [PATCH 17/20] davinci: da850: Use cpufreq_for_each_entry macro for iteration X-Mailman-Approved-At: Wed, 23 Apr 2014 08:09:09 -0500 CC: Viresh Kumar , , "Rafael J. Wysocki" , LKML , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham 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 --- arch/arm/mach-davinci/da850.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 85399c9..45ce065 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -1092,20 +1092,21 @@ int da850_register_cpufreq(char *async_clk) static int da850_round_armrate(struct clk *clk, unsigned long rate) { - int i, ret = 0, diff; + int ret = 0, diff; unsigned int best = (unsigned int) -1; struct cpufreq_frequency_table *table = cpufreq_info.freq_table; + struct cpufreq_frequency_table *pos; rate /= 1000; /* convert to kHz */ - for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) { - diff = table[i].frequency - rate; + cpufreq_for_each_entry(pos, table) { + diff = pos->frequency - rate; if (diff < 0) diff = -diff; if (diff < best) { best = diff; - ret = table[i].frequency; + ret = pos->frequency; } }