Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Use set_cpus_allowed_ptr

From: Julia Lawall <julia@diku.dk>

Use set_cpus_allowed_ptr rather than set_cpus_allowed.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E1,E2;
@@

- set_cpus_allowed(E1, cpumask_of_cpu(E2))
+ set_cpus_allowed_ptr(E1, cpumask_of(E2))

@@
expression E;
identifier I;
@@

- set_cpus_allowed(E, I)
+ set_cpus_allowed_ptr(E, &I)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
To: peterz@infradead.org
To: mingo@elte.hu
To: tglx@linutronix.de
To: oleg@redhat.com
To: linux-mips@linux-mips.org
To: linux-kernel@vger.kernel.org
To: kernel-janitors@vger.kernel.org
Patchwork: http://patchwork.linux-mips.org/patch/1087/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Julia Lawall and committed by
Ralf Baechle
ed1bbdef 8b108c60

+5 -5
+2 -2
arch/mips/kernel/cpufreq/loongson2_cpufreq.c
··· 65 65 return -ENODEV; 66 66 67 67 cpus_allowed = current->cpus_allowed; 68 - set_cpus_allowed(current, cpumask_of_cpu(cpu)); 68 + set_cpus_allowed_ptr(current, cpumask_of(cpu)); 69 69 70 70 if (cpufreq_frequency_table_target 71 71 (policy, &loongson2_clockmod_table[0], target_freq, relation, ··· 91 91 /* notifiers */ 92 92 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 93 93 94 - set_cpus_allowed(current, cpus_allowed); 94 + set_cpus_allowed_ptr(current, &cpus_allowed); 95 95 96 96 /* setting the cpu frequency */ 97 97 clk_set_rate(cpuclk, freq);
+2 -2
arch/mips/kernel/mips-mt-fpaff.c
··· 100 100 if (test_ti_thread_flag(ti, TIF_FPUBOUND) && 101 101 cpus_intersects(new_mask, mt_fpu_cpumask)) { 102 102 cpus_and(effective_mask, new_mask, mt_fpu_cpumask); 103 - retval = set_cpus_allowed(p, effective_mask); 103 + retval = set_cpus_allowed_ptr(p, &effective_mask); 104 104 } else { 105 105 clear_ti_thread_flag(ti, TIF_FPUBOUND); 106 - retval = set_cpus_allowed(p, new_mask); 106 + retval = set_cpus_allowed_ptr(p, &new_mask); 107 107 } 108 108 109 109 out_unlock:
+1 -1
arch/mips/kernel/traps.c
··· 854 854 = current->cpus_allowed; 855 855 cpus_and(tmask, current->cpus_allowed, 856 856 mt_fpu_cpumask); 857 - set_cpus_allowed(current, tmask); 857 + set_cpus_allowed_ptr(current, &tmask); 858 858 set_thread_flag(TIF_FPUBOUND); 859 859 } 860 860 }