Thread (24 messages) 24 messages, 2 authors, 2015-06-26

Re: [PATCH 05/10] cpufreq: governor: Drop __gov_queue_work()

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: 2015-06-26 07:32:08

On 26-06-15, 12:33, Preeti U Murthy wrote:
On 06/22/2015 01:32 PM, Viresh Kumar wrote:
quoted
__gov_queue_work() isn't required anymore and can be merged with
gov_queue_work(). Do it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq_governor.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 416a8c5665dd..ac288f0efb06 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -158,25 +158,20 @@ void dbs_check_cpu(struct dbs_data *dbs_data, int cpu)
 }
 EXPORT_SYMBOL_GPL(dbs_check_cpu);

-static inline void __gov_queue_work(int cpu, struct dbs_data *dbs_data,
-		unsigned int delay)
-{
-	struct cpu_dbs_info *cdbs = dbs_data->cdata->get_cpu_cdbs(cpu);
-
-	mod_delayed_work_on(cpu, system_wq, &cdbs->dwork, delay);
-}
Looking at this patch I feel now that, you can simply make the above
function non static and call the same from update_sampling_rate() in
patch[04/10] It already gives scope to pass in the cpu parameter, if not
the mask. Anyway you want to pass in a single cpu from
update_sampling_rate(). This will avoid having to change the other call
sites of gov_queue_work().

I also see elsewhere in the kernel where a fn() and __fn() are sometimes
both non-static, with __fn() giving you the additional benefit of
passing a critical parameter. Eg:
__hrtimer_start_range_ns() and hrtimer_start_range_ns().
Keeping two functions that way isn't a problem and is beneficial many
a times. But that doesn't fit here.

The above function doesn't have the necessary lock and so was never
used directly. And there is no need to keep two routines now that only
one is sufficient.

-- 
viresh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help