Skip to content

Commit 995694e

Browse files
committed
cpufreq: ACPI: Use on_each_cpu_mask() in drv_write()
Make drv_write() call on_each_cpu_mask() instead of using an open-coded equivalent of the latter. Also remove a comment mentioning the smp_call_function_many() usage which is not particularly useful anyway. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
1 parent 34d2eb4 commit 995694e

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ static u32 drv_read(struct acpi_cpufreq_data *data, const struct cpumask *mask)
318318
return cmd.val;
319319
}
320320

321-
/* Called via smp_call_function_many(), on the target CPUs */
322321
static void do_drv_write(void *_cmd)
323322
{
324323
struct drv_cmd *cmd = _cmd;
@@ -335,14 +334,8 @@ static void drv_write(struct acpi_cpufreq_data *data,
335334
.val = val,
336335
.func.write = data->cpu_freq_write,
337336
};
338-
int this_cpu;
339337

340-
this_cpu = get_cpu();
341-
if (cpumask_test_cpu(this_cpu, mask))
342-
do_drv_write(&cmd);
343-
344-
smp_call_function_many(mask, do_drv_write, &cmd, 1);
345-
put_cpu();
338+
on_each_cpu_mask(mask, do_drv_write, &cmd, true);
346339
}
347340

348341
static u32 get_cur_val(const struct cpumask *mask, struct acpi_cpufreq_data *data)

0 commit comments

Comments
 (0)