Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dad2ad82 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq

parents 7079060f b7fb358c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -377,10 +377,9 @@ acpi_cpufreq_cpu_init (
        arg0.buffer.length = 12;
        arg0.buffer.pointer = (u8 *) arg0_buf;

	data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
	data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
	if (!data)
		return (-ENOMEM);
	memset(data, 0, sizeof(struct cpufreq_acpi_io));

	acpi_io_data[cpu] = data;

+3 −9
Original line number Diff line number Diff line
@@ -171,10 +171,9 @@ static int get_ranges (unsigned char *pst)
	unsigned int speed;
	u8 fid, vid;

	powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL);
	powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL);
	if (!powernow_table)
		return -ENOMEM;
	memset(powernow_table, 0, (sizeof(struct cpufreq_frequency_table) * (number_scales + 1)));

	for (j=0 ; j < number_scales; j++) {
		fid = *pst++;
@@ -305,16 +304,13 @@ static int powernow_acpi_init(void)
		goto err0;
	}

	acpi_processor_perf = kmalloc(sizeof(struct acpi_processor_performance),
	acpi_processor_perf = kzalloc(sizeof(struct acpi_processor_performance),
				      GFP_KERNEL);

	if (!acpi_processor_perf) {
		retval = -ENOMEM;
		goto err0;
	}

	memset(acpi_processor_perf, 0, sizeof(struct acpi_processor_performance));

	if (acpi_processor_register_performance(acpi_processor_perf, 0)) {
		retval = -EIO;
		goto err1;
@@ -337,14 +333,12 @@ static int powernow_acpi_init(void)
		goto err2;
	}

	powernow_table = kmalloc((number_scales + 1) * (sizeof(struct cpufreq_frequency_table)), GFP_KERNEL);
	powernow_table = kzalloc((number_scales + 1) * (sizeof(struct cpufreq_frequency_table)), GFP_KERNEL);
	if (!powernow_table) {
		retval = -ENOMEM;
		goto err2;
	}

	memset(powernow_table, 0, ((number_scales + 1) * sizeof(struct cpufreq_frequency_table)));

	pc.val = (unsigned long) acpi_processor_perf->states[0].control;
	for (i = 0; i < number_scales; i++) {
		u8 fid, vid;
+3 −16
Original line number Diff line number Diff line
@@ -462,7 +462,6 @@ static int check_supported_cpu(unsigned int cpu)

	oldmask = current->cpus_allowed;
	set_cpus_allowed(current, cpumask_of_cpu(cpu));
	schedule();

	if (smp_processor_id() != cpu) {
		printk(KERN_ERR "limiting to cpu %u failed\n", cpu);
@@ -497,9 +496,7 @@ static int check_supported_cpu(unsigned int cpu)

out:
	set_cpus_allowed(current, oldmask);
	schedule();
	return rc;

}

static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 maxvid)
@@ -913,7 +910,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
	/* only run on specific CPU from here on */
	oldmask = current->cpus_allowed;
	set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
	schedule();

	if (smp_processor_id() != pol->cpu) {
		printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
@@ -968,8 +964,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi

err_out:
	set_cpus_allowed(current, oldmask);
	schedule();

	return ret;
}

@@ -991,12 +985,11 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
	if (!check_supported_cpu(pol->cpu))
		return -ENODEV;

	data = kmalloc(sizeof(struct powernow_k8_data), GFP_KERNEL);
	data = kzalloc(sizeof(struct powernow_k8_data), GFP_KERNEL);
	if (!data) {
		printk(KERN_ERR PFX "unable to alloc powernow_k8_data");
		return -ENOMEM;
	}
	memset(data,0,sizeof(struct powernow_k8_data));

	data->cpu = pol->cpu;

@@ -1026,7 +1019,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
	/* only run on specific CPU from here on */
	oldmask = current->cpus_allowed;
	set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
	schedule();

	if (smp_processor_id() != pol->cpu) {
		printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
@@ -1045,7 +1037,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)

	/* run on any CPU again */
	set_cpus_allowed(current, oldmask);
	schedule();

	pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
	pol->cpus = cpu_core_map[pol->cpu];
@@ -1080,7 +1071,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)

err_out:
	set_cpus_allowed(current, oldmask);
	schedule();
	powernow_k8_cpu_exit_acpi(data);

	kfree(data);
@@ -1116,7 +1106,6 @@ static unsigned int powernowk8_get (unsigned int cpu)
		set_cpus_allowed(current, oldmask);
		return 0;
	}
	preempt_disable();

	if (query_current_values_with_pending_wait(data))
		goto out;
@@ -1124,9 +1113,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
	khz = find_khz_freq_from_fid(data->currfid);

out:
	preempt_enable_no_resched();
	set_cpus_allowed(current, oldmask);

	return khz;
}

+1 −2
Original line number Diff line number Diff line
@@ -423,12 +423,11 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
		}
	}

	centrino_model[cpu] = kmalloc(sizeof(struct cpu_model), GFP_KERNEL);
	centrino_model[cpu] = kzalloc(sizeof(struct cpu_model), GFP_KERNEL);
	if (!centrino_model[cpu]) {
		result = -ENOMEM;
		goto err_unreg;
	}
	memset(centrino_model[cpu], 0, sizeof(struct cpu_model));

	centrino_model[cpu]->model_name=NULL;
	centrino_model[cpu]->max_freq = p.states[0].core_frequency * 1000;
+1 −2
Original line number Diff line number Diff line
@@ -593,12 +593,11 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
		goto module_out;
	}

	policy = kmalloc(sizeof(struct cpufreq_policy), GFP_KERNEL);
	policy = kzalloc(sizeof(struct cpufreq_policy), GFP_KERNEL);
	if (!policy) {
		ret = -ENOMEM;
		goto nomem_out;
	}
	memset(policy, 0, sizeof(struct cpufreq_policy));

	policy->cpu = cpu;
	policy->cpus = cpumask_of_cpu(cpu);
Loading