* [PATCH 05/20] cpufreq: dbx500: Use cpufreq_for_each_entry macro for iteration
@ 2014-04-14 21:08 Stratos Karafotis
2014-04-15 5:36 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Stratos Karafotis @ 2014-04-14 21:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar; +Cc: cpufreq, linux-pm, LKML
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 <stratosk@semaphore.gr>
---
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);
--
1.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 05/20] cpufreq: dbx500: Use cpufreq_for_each_entry macro for iteration
2014-04-14 21:08 [PATCH 05/20] cpufreq: dbx500: Use cpufreq_for_each_entry macro for iteration Stratos Karafotis
@ 2014-04-15 5:36 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2014-04-15 5:36 UTC (permalink / raw)
To: Stratos Karafotis; +Cc: Rafael J. Wysocki, cpufreq, linux-pm, LKML
On 15 April 2014 02:38, Stratos Karafotis <stratosk@semaphore.gr> wrote:
> 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 <stratosk@semaphore.gr>
> ---
> 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);
> }
Remove {}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-15 5:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 21:08 [PATCH 05/20] cpufreq: dbx500: Use cpufreq_for_each_entry macro for iteration Stratos Karafotis
2014-04-15 5:36 ` Viresh Kumar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.