arch/sparc/kernel: Use set_cpus_allowed_ptr

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Julia Lawall and committed by David S. Miller d2566af8 7469a9ac

+10 -10
+2 -2
arch/sparc/kernel/sysfs.c
··· 107 unsigned long ret; 108 109 /* should return -EINVAL to userspace */ 110 - if (set_cpus_allowed(current, cpumask_of_cpu(cpu))) 111 return 0; 112 113 ret = func(arg); 114 115 - set_cpus_allowed(current, old_affinity); 116 117 return ret; 118 }
··· 107 unsigned long ret; 108 109 /* should return -EINVAL to userspace */ 110 + if (set_cpus_allowed_ptr(current, cpumask_of(cpu))) 111 return 0; 112 113 ret = func(arg); 114 115 + set_cpus_allowed_ptr(current, &old_affinity); 116 117 return ret; 118 }
+4 -4
arch/sparc/kernel/us2e_cpufreq.c
··· 238 return 0; 239 240 cpus_allowed = current->cpus_allowed; 241 - set_cpus_allowed(current, cpumask_of_cpu(cpu)); 242 243 clock_tick = sparc64_get_clock_tick(cpu) / 1000; 244 estar = read_hbreg(HBIRD_ESTAR_MODE_ADDR); 245 246 - set_cpus_allowed(current, cpus_allowed); 247 248 return clock_tick / estar_to_divisor(estar); 249 } ··· 259 return; 260 261 cpus_allowed = current->cpus_allowed; 262 - set_cpus_allowed(current, cpumask_of_cpu(cpu)); 263 264 new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000; 265 new_bits = index_to_estar_mode(index); ··· 281 282 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 283 284 - set_cpus_allowed(current, cpus_allowed); 285 } 286 287 static int us2e_freq_target(struct cpufreq_policy *policy,
··· 238 return 0; 239 240 cpus_allowed = current->cpus_allowed; 241 + set_cpus_allowed_ptr(current, cpumask_of(cpu)); 242 243 clock_tick = sparc64_get_clock_tick(cpu) / 1000; 244 estar = read_hbreg(HBIRD_ESTAR_MODE_ADDR); 245 246 + set_cpus_allowed_ptr(current, &cpus_allowed); 247 248 return clock_tick / estar_to_divisor(estar); 249 } ··· 259 return; 260 261 cpus_allowed = current->cpus_allowed; 262 + set_cpus_allowed_ptr(current, cpumask_of(cpu)); 263 264 new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000; 265 new_bits = index_to_estar_mode(index); ··· 281 282 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 283 284 + set_cpus_allowed_ptr(current, &cpus_allowed); 285 } 286 287 static int us2e_freq_target(struct cpufreq_policy *policy,
+4 -4
arch/sparc/kernel/us3_cpufreq.c
··· 86 return 0; 87 88 cpus_allowed = current->cpus_allowed; 89 - set_cpus_allowed(current, cpumask_of_cpu(cpu)); 90 91 reg = read_safari_cfg(); 92 ret = get_current_freq(cpu, reg); 93 94 - set_cpus_allowed(current, cpus_allowed); 95 96 return ret; 97 } ··· 106 return; 107 108 cpus_allowed = current->cpus_allowed; 109 - set_cpus_allowed(current, cpumask_of_cpu(cpu)); 110 111 new_freq = sparc64_get_clock_tick(cpu) / 1000; 112 switch (index) { ··· 140 141 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 142 143 - set_cpus_allowed(current, cpus_allowed); 144 } 145 146 static int us3_freq_target(struct cpufreq_policy *policy,
··· 86 return 0; 87 88 cpus_allowed = current->cpus_allowed; 89 + set_cpus_allowed_ptr(current, cpumask_of(cpu)); 90 91 reg = read_safari_cfg(); 92 ret = get_current_freq(cpu, reg); 93 94 + set_cpus_allowed_ptr(current, &cpus_allowed); 95 96 return ret; 97 } ··· 106 return; 107 108 cpus_allowed = current->cpus_allowed; 109 + set_cpus_allowed_ptr(current, cpumask_of(cpu)); 110 111 new_freq = sparc64_get_clock_tick(cpu) / 1000; 112 switch (index) { ··· 140 141 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 142 143 + set_cpus_allowed_ptr(current, &cpus_allowed); 144 } 145 146 static int us3_freq_target(struct cpufreq_policy *policy,