mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
cpumask: use zalloc_cpumask_var() where possible
Remove open-coded zalloc_cpumask_var() and zalloc_cpumask_var_node(). Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
a724eada8c
commit
79f5599772
9 changed files with 14 additions and 30 deletions
|
@ -1984,11 +1984,9 @@ __tracing_open(struct inode *inode, struct file *file)
|
|||
if (current_trace)
|
||||
*iter->trace = *current_trace;
|
||||
|
||||
if (!alloc_cpumask_var(&iter->started, GFP_KERNEL))
|
||||
if (!zalloc_cpumask_var(&iter->started, GFP_KERNEL))
|
||||
goto fail;
|
||||
|
||||
cpumask_clear(iter->started);
|
||||
|
||||
if (current_trace && current_trace->print_max)
|
||||
iter->tr = &max_tr;
|
||||
else
|
||||
|
@ -4389,7 +4387,7 @@ __init static int tracer_alloc_buffers(void)
|
|||
if (!alloc_cpumask_var(&tracing_cpumask, GFP_KERNEL))
|
||||
goto out_free_buffer_mask;
|
||||
|
||||
if (!alloc_cpumask_var(&tracing_reader_cpumask, GFP_KERNEL))
|
||||
if (!zalloc_cpumask_var(&tracing_reader_cpumask, GFP_KERNEL))
|
||||
goto out_free_tracing_cpumask;
|
||||
|
||||
/* To save memory, keep the ring buffer size to its minimum */
|
||||
|
@ -4400,7 +4398,6 @@ __init static int tracer_alloc_buffers(void)
|
|||
|
||||
cpumask_copy(tracing_buffer_mask, cpu_possible_mask);
|
||||
cpumask_copy(tracing_cpumask, cpu_all_mask);
|
||||
cpumask_clear(tracing_reader_cpumask);
|
||||
|
||||
/* TODO: make the number of buffers hot pluggable with CPUS */
|
||||
global_trace.buffer = ring_buffer_alloc(ring_buf_size,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue