linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 3/8] davinci: da850: Use cpufreq_for_each_entry macro for iteration
@ 2014-04-15 22:26 Stratos Karafotis
  2014-04-21 10:23 ` Sekhar Nori
  0 siblings, 1 reply; 3+ messages in thread
From: Stratos Karafotis @ 2014-04-15 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

The cpufreq core now 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>
---
 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;
 		}
 	}
 
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 3/8] davinci: da850: Use cpufreq_for_each_entry macro for iteration
  2014-04-15 22:26 [PATCH v2 3/8] davinci: da850: Use cpufreq_for_each_entry macro for iteration Stratos Karafotis
@ 2014-04-21 10:23 ` Sekhar Nori
  2014-04-21 10:26   ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Sekhar Nori @ 2014-04-21 10:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 16 April 2014 03:56 AM, Stratos Karafotis wrote:
> The cpufreq core now 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>

I cannot test this (or even build this) since I do not have the patch
which adds cpufreq_for_each_entry(). The change as such looks fine to
me. Please prefix the subject line with "ARM: " as is the convention in
ARM world.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 3/8] davinci: da850: Use cpufreq_for_each_entry macro for iteration
  2014-04-21 10:23 ` Sekhar Nori
@ 2014-04-21 10:26   ` Viresh Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2014-04-21 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 21 April 2014 15:53, Sekhar Nori <nsekhar@ti.com> wrote:
> I cannot test this (or even build this) since I do not have the patch
> which adds cpufreq_for_each_entry(). The change as such looks fine to
> me. Please prefix the subject line with "ARM: " as is the convention in
> ARM world.

In case you wanna have a look:

https://lkml.org/lkml/2014/4/15/695

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-21 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 22:26 [PATCH v2 3/8] davinci: da850: Use cpufreq_for_each_entry macro for iteration Stratos Karafotis
2014-04-21 10:23 ` Sekhar Nori
2014-04-21 10:26   ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).