From patchwork Mon Apr 14 21:08:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stratos Karafotis X-Patchwork-Id: 3986051 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 17BF99F336 for ; Mon, 14 Apr 2014 21:08:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A83BA201EC for ; Mon, 14 Apr 2014 21:08:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E208C20158 for ; Mon, 14 Apr 2014 21:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755156AbaDNVIv (ORCPT ); Mon, 14 Apr 2014 17:08:51 -0400 Received: from sema.semaphore.gr ([78.46.194.137]:54731 "EHLO sema.semaphore.gr" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755495AbaDNVIs (ORCPT ); Mon, 14 Apr 2014 17:08:48 -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 157FA837F2; Mon, 14 Apr 2014 23:08:42 +0200 (CEST) Message-ID: <534C4E5D.40508@semaphore.gr> Date: Tue, 15 Apr 2014 00:08:45 +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: "Rafael J. Wysocki" , Viresh Kumar CC: "cpufreq@vger.kernel.org" , "linux-pm@vger.kernel.org" , LKML Subject: [PATCH 05/20] cpufreq: dbx500: 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/dbx500-cpufreq.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index 412a78b..2a0635c 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -45,7 +45,7 @@ static struct cpufreq_driver dbx500_cpufreq_driver = { static int dbx500_cpufreq_probe(struct platform_device *pdev) { - int i = 0; + struct cpufreq_frequency_table *pos; freq_table = dev_get_platdata(&pdev->dev); if (!freq_table) { @@ -60,9 +60,8 @@ static int dbx500_cpufreq_probe(struct platform_device *pdev) } pr_info("dbx500-cpufreq: Available frequencies:\n"); - while (freq_table[i].frequency != CPUFREQ_TABLE_END) { - pr_info(" %d Mhz\n", freq_table[i].frequency/1000); - i++; + cpufreq_for_each_entry(pos, freq_table) { + pr_info(" %d Mhz\n", pos->frequency / 1000); } return cpufreq_register_driver(&dbx500_cpufreq_driver);