Convert more 'alloc_obj' cases to default GFP_KERNEL arguments

This converts some of the visually simpler cases that have been split
over multiple lines.  I only did the ones that are easy to verify the
resulting diff by having just that final GFP_KERNEL argument on the next
line.

Somebody should probably do a proper coccinelle script for this, but for
me the trivial script actually resulted in an assertion failure in the
middle of the script.  I probably had made it a bit _too_ trivial.

So after fighting that far a while I decided to just do some of the
syntactically simpler cases with variations of the previous 'sed'
scripts.

The more syntactically complex multi-line cases would mostly really want
whitespace cleanup anyway.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds
2026-02-21 20:03:00 -08:00
parent 323bbfcf1e
commit 32a92f8c89
826 changed files with 1211 additions and 2422 deletions

View File

@@ -3903,8 +3903,7 @@ __tracing_open(struct inode *inode, struct file *file, bool snapshot)
if (!iter)
return ERR_PTR(-ENOMEM);
iter->buffer_iter = kzalloc_objs(*iter->buffer_iter, nr_cpu_ids,
GFP_KERNEL);
iter->buffer_iter = kzalloc_objs(*iter->buffer_iter, nr_cpu_ids);
if (!iter->buffer_iter)
goto release;
@@ -9310,8 +9309,7 @@ static void setup_trace_scratch(struct trace_array *tr,
mod_addr_comp, NULL, NULL);
if (IS_ENABLED(CONFIG_MODULES)) {
module_delta = kzalloc_flex(*module_delta, delta, nr_entries,
GFP_KERNEL);
module_delta = kzalloc_flex(*module_delta, delta, nr_entries);
if (!module_delta) {
pr_info("module_delta allocation failed. Not able to decode module address.");
goto reset;
@@ -10929,8 +10927,7 @@ void __init ftrace_boot_snapshot(void)
void __init early_trace_init(void)
{
if (tracepoint_printk) {
tracepoint_print_iter = kzalloc_obj(*tracepoint_print_iter,
GFP_KERNEL);
tracepoint_print_iter = kzalloc_obj(*tracepoint_print_iter);
if (MEM_FAIL(!tracepoint_print_iter,
"Failed to allocate trace iterator\n"))
tracepoint_printk = 0;

View File

@@ -5674,8 +5674,7 @@ static int print_entries(struct seq_file *m,
(HIST_FIELD_FL_PERCENT | HIST_FIELD_FL_GRAPH)))
continue;
if (!stats) {
stats = kzalloc_objs(*stats, hist_data->n_vals,
GFP_KERNEL);
stats = kzalloc_objs(*stats, hist_data->n_vals);
if (!stats) {
n_entries = -ENOMEM;
goto out;

View File

@@ -842,8 +842,7 @@ static int __store_entry_arg(struct trace_probe *tp, int argnum)
if (!earg)
return -ENOMEM;
earg->size = 2 * tp->nr_args + 1;
earg->code = kzalloc_objs(struct fetch_insn, earg->size,
GFP_KERNEL);
earg->code = kzalloc_objs(struct fetch_insn, earg->size);
if (!earg->code) {
kfree(earg);
return -ENOMEM;