mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonghwan Choi <jhbird.choi@samsung.com>
To: open list <linux-kernel@vger.kernel.org>
Cc: "'Rafael J. Wysocki'" <rjw@rjwysocki.net>,
	"'Len Brown'" <len.brown@intel.com>
Subject: [PATCH 1/2] PM / OPP: Use list_for_each_entry_reverse instead of list_for_each_entry
Date: Tue, 29 Apr 2014 14:24:03 +0900	[thread overview]
Message-ID: <000601cf636b$3c2b39b0$b481ad10$@samsung.com> (raw)

Most of the cpufreq table is sorted in descending order.
But when cpufreq table is made from dev_pm_opp_init_cpufreq_table,
it is sorted in ascending order. So in some case to make cpufreq table
with descending order it needs an extra work.

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
 drivers/base/power/opp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 2553867..8d81a46 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -649,7 +649,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 		return -ENOMEM;
 	}
 
-	list_for_each_entry(opp, &dev_opp->opp_list, node) {
+	list_for_each_entry_reverse(opp, &dev_opp->opp_list, node) {
 		if (opp->available) {
 			freq_table[i].driver_data = i;
 			freq_table[i].frequency = opp->rate / 1000;
-- 
1.7.10.4


             reply	other threads:[~2014-04-29  5:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29  5:24 Jonghwan Choi [this message]
2014-04-29  5:32 ` Viresh Kumar
2014-04-29  5:50   ` Jonghwan Choi
2014-04-29  6:10     ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000601cf636b$3c2b39b0$b481ad10$@samsung.com' \
    --to=jhbird.choi@samsung.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®