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

Commit 0bc3cc03 authored by Mike Travis's avatar Mike Travis Committed by Ingo Molnar
Browse files

cpumask: change cpumask_of_cpu_ptr to use new cpumask_of_cpu



  * Replace previous instances of the cpumask_of_cpu_ptr* macros
    with a the new (lvalue capable) generic cpumask_of_cpu().

Signed-off-by: default avatarMike Travis <travis@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6524d938
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -73,7 +73,6 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
	struct cpuinfo_x86 *c = &cpu_data(cpu);

	cpumask_t saved_mask;
	cpumask_of_cpu_ptr(new_mask, cpu);
	int retval;
	unsigned int eax, ebx, ecx, edx;
	unsigned int edx_part;
@@ -92,7 +91,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,

	/* Make sure we are running on right CPU */
	saved_mask = current->cpus_allowed;
	retval = set_cpus_allowed_ptr(current, new_mask);
	retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
	if (retval)
		return -1;

+3 −7
Original line number Diff line number Diff line
@@ -200,12 +200,10 @@ static void drv_read(struct drv_cmd *cmd)
static void drv_write(struct drv_cmd *cmd)
{
	cpumask_t saved_mask = current->cpus_allowed;
	cpumask_of_cpu_ptr_declare(cpu_mask);
	unsigned int i;

	for_each_cpu_mask_nr(i, cmd->mask) {
		cpumask_of_cpu_ptr_next(cpu_mask, i);
		set_cpus_allowed_ptr(current, cpu_mask);
		set_cpus_allowed_ptr(current, &cpumask_of_cpu(i));
		do_drv_write(cmd);
	}

@@ -269,12 +267,11 @@ static unsigned int get_measured_perf(unsigned int cpu)
	} aperf_cur, mperf_cur;

	cpumask_t saved_mask;
	cpumask_of_cpu_ptr(cpu_mask, cpu);
	unsigned int perf_percent;
	unsigned int retval;

	saved_mask = current->cpus_allowed;
	set_cpus_allowed_ptr(current, cpu_mask);
	set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
	if (get_cpu() != cpu) {
		/* We were not able to run on requested processor */
		put_cpu();
@@ -340,7 +337,6 @@ static unsigned int get_measured_perf(unsigned int cpu)

static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
{
	cpumask_of_cpu_ptr(cpu_mask, cpu);
	struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu);
	unsigned int freq;
	unsigned int cached_freq;
@@ -353,7 +349,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
	}

	cached_freq = data->freq_table[data->acpi_data->state].frequency;
	freq = extract_freq(get_cur_val(cpu_mask), data);
	freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data);
	if (freq != cached_freq) {
		/*
		 * The dreaded BIOS frequency change behind our back.
+5 −10
Original line number Diff line number Diff line
@@ -479,12 +479,11 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi
static int check_supported_cpu(unsigned int cpu)
{
	cpumask_t oldmask;
	cpumask_of_cpu_ptr(cpu_mask, cpu);
	u32 eax, ebx, ecx, edx;
	unsigned int rc = 0;

	oldmask = current->cpus_allowed;
	set_cpus_allowed_ptr(current, cpu_mask);
	set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));

	if (smp_processor_id() != cpu) {
		printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu);
@@ -1017,7 +1016,6 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation)
{
	cpumask_t oldmask;
	cpumask_of_cpu_ptr(cpu_mask, pol->cpu);
	struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
	u32 checkfid;
	u32 checkvid;
@@ -1032,7 +1030,7 @@ 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_ptr(current, cpu_mask);
	set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));

	if (smp_processor_id() != pol->cpu) {
		printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1107,7 +1105,6 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
{
	struct powernow_k8_data *data;
	cpumask_t oldmask;
	cpumask_of_cpu_ptr_declare(newmask);
	int rc;

	if (!cpu_online(pol->cpu))
@@ -1159,8 +1156,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)

	/* only run on specific CPU from here on */
	oldmask = current->cpus_allowed;
	cpumask_of_cpu_ptr_next(newmask, pol->cpu);
	set_cpus_allowed_ptr(current, newmask);
	set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));

	if (smp_processor_id() != pol->cpu) {
		printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1182,7 +1178,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
	set_cpus_allowed_ptr(current, &oldmask);

	if (cpu_family == CPU_HW_PSTATE)
		pol->cpus = *newmask;
		pol->cpus = cpumask_of_cpu(pol->cpu);
	else
		pol->cpus = per_cpu(cpu_core_map, pol->cpu);
	data->available_cores = &(pol->cpus);
@@ -1248,7 +1244,6 @@ static unsigned int powernowk8_get (unsigned int cpu)
{
	struct powernow_k8_data *data;
	cpumask_t oldmask = current->cpus_allowed;
	cpumask_of_cpu_ptr(newmask, cpu);
	unsigned int khz = 0;
	unsigned int first;

@@ -1258,7 +1253,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
	if (!data)
		return -EINVAL;

	set_cpus_allowed_ptr(current, newmask);
	set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
	if (smp_processor_id() != cpu) {
		printk(KERN_ERR PFX
			"limiting to CPU %d failed in powernowk8_get\n", cpu);
+4 −8
Original line number Diff line number Diff line
@@ -324,10 +324,9 @@ static unsigned int get_cur_freq(unsigned int cpu)
	unsigned l, h;
	unsigned clock_freq;
	cpumask_t saved_mask;
	cpumask_of_cpu_ptr(new_mask, cpu);

	saved_mask = current->cpus_allowed;
	set_cpus_allowed_ptr(current, new_mask);
	set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
	if (smp_processor_id() != cpu)
		return 0;

@@ -585,15 +584,12 @@ static int centrino_target (struct cpufreq_policy *policy,
		 * Best effort undo..
		 */

		if (!cpus_empty(*covered_cpus)) {
			cpumask_of_cpu_ptr_declare(new_mask);

		if (!cpus_empty(*covered_cpus))
			for_each_cpu_mask_nr(j, *covered_cpus) {
				cpumask_of_cpu_ptr_next(new_mask, j);
				set_cpus_allowed_ptr(current, new_mask);
				set_cpus_allowed_ptr(current,
						     &cpumask_of_cpu(j));
				wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
			}
		}

		tmp = freqs.new;
		freqs.new = freqs.old;
+1 −2
Original line number Diff line number Diff line
@@ -244,8 +244,7 @@ static unsigned int _speedstep_get(const cpumask_t *cpus)

static unsigned int speedstep_get(unsigned int cpu)
{
	cpumask_of_cpu_ptr(newmask, cpu);
	return _speedstep_get(newmask);
	return _speedstep_get(&cpumask_of_cpu(cpu));
}

/**
Loading