}
EXPORT_SYMBOL_GPL(sched_power_cpu_reinit_weight);
-static int vidle_setup(int cpu, int rate, int period)
-{
-
- return 0;
-}
-
//////////////////////////////////////////////////////////////
static int sched_power_idle_play(struct cpu_power *cpower, unsigned int period,
unsigned int idle)
{
- unsigned int run;
-
if (period <= idle)
return -EINVAL;
sched_power_reweight_cluster(int cpu, struct cpumask *cpus, unsigned int capacity,
unsigned int period, int flags)
{
- int ret, i;
- struct cpu_power *cpower = NULL;
- int opp_curr_state, opp_curr_cost;
- int opp_next_state, opp_next_cost;
- u64 cluster_udget;
- u64 total_weight = 0;
-
+ /* int ret, i; */
+ /* struct cpu_power *cpower = NULL; */
+ /* int opp_curr_state, opp_curr_cost; */
+ /* int opp_next_state, opp_next_cost; */
+ /* u64 cluster_udget; */
+ /* u64 total_weight = 0; */
+ /* */
/* opp_next_state = get_opp_for_capacity(cpu, capacity); */
/* opp_next_cost = get_opp_cost(cpu, opp_next_state); */
/* */
sched_power_update_cpu_weight(struct cpu_power *cpower, int cpu, int weight,
int flags, int time)
{
- struct sched_power *sp;
-
raw_spin_lock(&cpower->update_lock);
cpower->req.weight = weight;
cpower->req.cpu = cpu;
{
struct idle_inject_device *ii_dev;
struct cpumask *cpus;
- int i, last_cpu;
+ int i, last_cpu = 0;
struct cpu_power *cpower;
ii_dev = idle_inject_register(cpus);
if (IS_ERR_OR_NULL(ii_dev)) {
- last_cpu;
goto cleanup;
}
raw_spin_unlock(&cpower->update_lock);
cpumask_clear_cpu(i, cpus);
+ last_cpu = i;
}
kfree(cpus);
static void sched_power_idle_unregister(struct sched_power *sp)
{
- struct idle_inject_device *ii_dev;
- int i, last_cpu;
+ int i;
struct cpu_power *cpower;
for_each_possible_cpu(i) {
power_budget = temp_diff;
- power_budget = max(0, power_budget);
+ power_budget = max(0LL, power_budget);
return power_budget;
}
return 0;
}
+
static int sched_power_gov_throttle(struct thermal_zone_device *tz, int trip)
{
- struct thermal_cooling_device *cdev;
- struct thermal_instance *inst;
+ struct thermal_cooling_device *cdev = NULL;
+ struct thermal_instance *inst = NULL;
u32 dev_power;
struct _thermal_zone *zone;
int ret;
{
struct thermal_instance *inst;
struct _thermal_zone *zone;
- struct _cooling_dev *cooling, *prev_cooling;
+ struct _cooling_dev *cooling, *prev_cooling = NULL;
struct _cooling_instance *_inst, *tmp;
struct thermal_cooling_device *cdev;
int i = 0;
return 0;
cleanup:
- list_for_each_entry_reverse(cooling, &prev_cooling->node, node) {
- if (i-- == 0)
- break;
- list_del(&prev_cooling->node);
- cleanup_percpu_cooling_dev(prev_cooling);
- prev_cooling = cooling;
+ if (prev_cooling) {
+ list_for_each_entry_reverse(cooling, &prev_cooling->node, node) {
+ if (i-- == 0)
+ break;
+ list_del(&prev_cooling->node);
+ cleanup_percpu_cooling_dev(prev_cooling);
+ prev_cooling = cooling;
+ }
}
mutex_unlock(&cdev_list_lock);