summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:06:51 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:09:51 -0800
commit323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3 (patch)
tree515dca34daa8d18ec26c2c3da3096c6c23955c95 /kernel
parentbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (diff)
Convert 'alloc_flex' family to use the new default GFP_KERNEL argument
This is the exact same thing as the 'alloc_obj()' version, only much smaller because there are a lot fewer users of the *alloc_flex() interface. As with alloc_obj() version, this was done entirely with mindless brute force, using the same script, except using 'flex' in the pattern rather than 'objs*'. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c2
-rw-r--r--kernel/audit_tree.c4
-rw-r--r--kernel/auditfilter.c2
-rw-r--r--kernel/bpf/btf.c2
-rw-r--r--kernel/cgroup/cgroup.c2
-rw-r--r--kernel/gcov/fs.c2
-rw-r--r--kernel/irq/generic-chip.c2
-rw-r--r--kernel/irq/matrix.c2
-rw-r--r--kernel/kprobes.c2
-rw-r--r--kernel/module/sysfs.c4
-rw-r--r--kernel/trace/fprobe.c2
-rw-r--r--kernel/trace/trace_eprobe.c2
-rw-r--r--kernel/trace/trace_fprobe.c2
-rw-r--r--kernel/trace/trace_kprobe.c2
-rw-r--r--kernel/trace/trace_uprobe.c2
-rw-r--r--kernel/tracepoint.c2
-rw-r--r--kernel/watch_queue.c2
-rw-r--r--kernel/workqueue.c2
18 files changed, 20 insertions, 20 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index ad46aa11d42c..5a0216056524 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1517,7 +1517,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
if (err < 0)
return err;
}
- sig_data = kmalloc_flex(*sig_data, ctx, lsmctx.len, GFP_KERNEL);
+ sig_data = kmalloc_flex(*sig_data, ctx, lsmctx.len);
if (!sig_data) {
if (lsmprop_is_set(&audit_sig_lsm))
security_release_secctx(&lsmctx);
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
index 3ffd6582bfe5..ee84777fdfad 100644
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -96,7 +96,7 @@ static struct audit_tree *alloc_tree(const char *s)
size_t sz;
sz = strlen(s) + 1;
- tree = kmalloc_flex(*tree, pathname, sz, GFP_KERNEL);
+ tree = kmalloc_flex(*tree, pathname, sz);
if (tree) {
refcount_set(&tree->count, 1);
tree->goner = 0;
@@ -192,7 +192,7 @@ static struct audit_chunk *alloc_chunk(int count)
struct audit_chunk *chunk;
int i;
- chunk = kzalloc_flex(*chunk, owners, count, GFP_KERNEL);
+ chunk = kzalloc_flex(*chunk, owners, count);
if (!chunk)
return NULL;
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 2bffaef0011b..6e3abbf08e3d 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -638,7 +638,7 @@ static struct audit_rule_data *audit_krule_to_data(struct audit_krule *krule)
void *bufp;
int i;
- data = kzalloc_flex(*data, buf, krule->buflen, GFP_KERNEL);
+ data = kzalloc_flex(*data, buf, krule->buflen);
if (unlikely(!data))
return NULL;
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 319916f8fc64..4872d2a6c42d 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -9617,7 +9617,7 @@ btf_add_struct_ops(struct btf *btf, struct bpf_struct_ops *st_ops,
tab = btf->struct_ops_tab;
if (!tab) {
- tab = kzalloc_flex(*tab, ops, 4, GFP_KERNEL);
+ tab = kzalloc_flex(*tab, ops, 4);
if (!tab)
return -ENOMEM;
tab->capacity = 4;
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index c14fbdc4cdbe..c22cda7766d8 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5844,7 +5844,7 @@ static struct cgroup *cgroup_create(struct cgroup *parent, const char *name,
int ret;
/* allocate the cgroup and its ID, 0 is reserved for the root */
- cgrp = kzalloc_flex(*cgrp, _low_ancestors, level, GFP_KERNEL);
+ cgrp = kzalloc_flex(*cgrp, _low_ancestors, level);
if (!cgrp)
return ERR_PTR(-ENOMEM);
diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
index 2acf677171b1..33829e4a4d39 100644
--- a/kernel/gcov/fs.c
+++ b/kernel/gcov/fs.c
@@ -116,7 +116,7 @@ static struct gcov_iterator *gcov_iter_new(struct gcov_info *info)
/* Dry-run to get the actual buffer size. */
size = convert_to_gcda(NULL, info);
- iter = kvmalloc_flex(*iter, buffer, size, GFP_KERNEL);
+ iter = kvmalloc_flex(*iter, buffer, size);
if (!iter)
return NULL;
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
index da1da1a4b2d0..2c8bc6ce082e 100644
--- a/kernel/irq/generic-chip.c
+++ b/kernel/irq/generic-chip.c
@@ -240,7 +240,7 @@ irq_alloc_generic_chip(const char *name, int num_ct, unsigned int irq_base,
{
struct irq_chip_generic *gc;
- gc = kzalloc_flex(*gc, chip_types, num_ct, GFP_KERNEL);
+ gc = kzalloc_flex(*gc, chip_types, num_ct);
if (gc) {
irq_init_generic_chip(gc, name, num_ct, irq_base, reg_base,
handler);
diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c
index 8151c14ca35a..0f79a4abea05 100644
--- a/kernel/irq/matrix.c
+++ b/kernel/irq/matrix.c
@@ -51,7 +51,7 @@ __init struct irq_matrix *irq_alloc_matrix(unsigned int matrix_bits,
unsigned int cpu, matrix_size = BITS_TO_LONGS(matrix_bits);
struct irq_matrix *m;
- m = kzalloc_flex(*m, scratch_map, matrix_size * 2, GFP_KERNEL);
+ m = kzalloc_flex(*m, scratch_map, matrix_size * 2);
if (!m)
return NULL;
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 15cc289a6fdf..ab25b4aa9095 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -172,7 +172,7 @@ kprobe_opcode_t *__get_insn_slot(struct kprobe_insn_cache *c)
} while (c->nr_garbage && collect_garbage_slots(c) == 0);
/* All out of space. Need to allocate a new page. */
- kip = kmalloc_flex(*kip, slot_used, slots_per_page(c), GFP_KERNEL);
+ kip = kmalloc_flex(*kip, slot_used, slots_per_page(c));
if (!kip)
return NULL;
diff --git a/kernel/module/sysfs.c b/kernel/module/sysfs.c
index 768f74e99026..01c65d608873 100644
--- a/kernel/module/sysfs.c
+++ b/kernel/module/sysfs.c
@@ -74,7 +74,7 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info)
for (i = 0; i < info->hdr->e_shnum; i++)
if (!sect_empty(&info->sechdrs[i]))
nloaded++;
- sect_attrs = kzalloc_flex(*sect_attrs, attrs, nloaded, GFP_KERNEL);
+ sect_attrs = kzalloc_flex(*sect_attrs, attrs, nloaded);
if (!sect_attrs)
return -ENOMEM;
@@ -166,7 +166,7 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info)
if (notes == 0)
return 0;
- notes_attrs = kzalloc_flex(*notes_attrs, attrs, notes, GFP_KERNEL);
+ notes_attrs = kzalloc_flex(*notes_attrs, attrs, notes);
if (!notes_attrs)
return -ENOMEM;
diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
index ec90ba215405..dcadf1d23b8a 100644
--- a/kernel/trace/fprobe.c
+++ b/kernel/trace/fprobe.c
@@ -749,7 +749,7 @@ static int fprobe_init(struct fprobe *fp, unsigned long *addrs, int num)
return -E2BIG;
fp->entry_data_size = size;
- hlist_array = kzalloc_flex(*hlist_array, array, num, GFP_KERNEL);
+ hlist_array = kzalloc_flex(*hlist_array, array, num);
if (!hlist_array)
return -ENOMEM;
diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
index 3eeaa5df7fc8..b66d6196338d 100644
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -211,7 +211,7 @@ static struct trace_eprobe *alloc_event_probe(const char *group,
sys_name = event->class->system;
event_name = trace_event_name(event);
- ep = kzalloc_flex(*ep, tp.args, nargs, GFP_KERNEL);
+ ep = kzalloc_flex(*ep, tp.args, nargs);
if (!ep) {
trace_event_put_ref(event);
return ERR_PTR(-ENOMEM);
diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c
index 8cd7eb790071..9f5f08c0e7c2 100644
--- a/kernel/trace/trace_fprobe.c
+++ b/kernel/trace/trace_fprobe.c
@@ -579,7 +579,7 @@ static struct trace_fprobe *alloc_trace_fprobe(const char *group,
struct trace_fprobe *tf __free(free_trace_fprobe) = NULL;
int ret = -ENOMEM;
- tf = kzalloc_flex(*tf, tp.args, nargs, GFP_KERNEL);
+ tf = kzalloc_flex(*tf, tp.args, nargs);
if (!tf)
return ERR_PTR(ret);
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 84539e1cd27e..a5dbb72528e0 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -275,7 +275,7 @@ static struct trace_kprobe *alloc_trace_kprobe(const char *group,
struct trace_kprobe *tk __free(free_trace_kprobe) = NULL;
int ret = -ENOMEM;
- tk = kzalloc_flex(*tk, tp.args, nargs, GFP_KERNEL);
+ tk = kzalloc_flex(*tk, tp.args, nargs);
if (!tk)
return ERR_PTR(ret);
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 00ca63934763..2cabf8a23ec5 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -338,7 +338,7 @@ alloc_trace_uprobe(const char *group, const char *event, int nargs, bool is_ret)
struct trace_uprobe *tu;
int ret;
- tu = kzalloc_flex(*tu, tp.args, nargs, GFP_KERNEL);
+ tu = kzalloc_flex(*tu, tp.args, nargs);
if (!tu)
return ERR_PTR(-ENOMEM);
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index df7ab773c7f3..91905aa19294 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -103,7 +103,7 @@ static void tp_stub_func(void)
static inline void *allocate_probes(int count)
{
- struct tp_probes *p = kmalloc_flex(*p, probes, count, GFP_KERNEL);
+ struct tp_probes *p = kmalloc_flex(*p, probes, count);
return p == NULL ? NULL : p->probes;
}
diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c
index 765c152f6084..538520861e8b 100644
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -358,7 +358,7 @@ long watch_queue_set_filter(struct pipe_inode_info *pipe,
* user-specified filters.
*/
ret = -ENOMEM;
- wfilter = kzalloc_flex(*wfilter, filters, nr_filter, GFP_KERNEL);
+ wfilter = kzalloc_flex(*wfilter, filters, nr_filter);
if (!wfilter)
goto err_filter;
wfilter->nr_filters = nr_filter;
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 399b0375a66a..aeaec79bc09c 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5370,7 +5370,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq,
attrs->affn_scope >= WQ_AFFN_NR_TYPES))
return ERR_PTR(-EINVAL);
- ctx = kzalloc_flex(*ctx, pwq_tbl, nr_cpu_ids, GFP_KERNEL);
+ ctx = kzalloc_flex(*ctx, pwq_tbl, nr_cpu_ids);
new_attrs = alloc_workqueue_attrs();
if (!ctx || !new_attrs)