Convert 'alloc_obj' family to use the new default GFP_KERNEL argument

This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds committed 2026-02-21 17:09:51 -08:00
1 parent e19e1b480a
commit bf4afc53b7
6673 files changed
+13013 -13013

No files matched your search

+4 -4
View File
@@ -59,7 +59,7 @@ static const struct vm_operations_struct relay_file_mmap_ops = {
*/
static struct page **relay_alloc_page_array(unsigned int n_pages)
{
return kvzalloc_objs(struct page *, n_pages, GFP_KERNEL);
return kvzalloc_objs(struct page *, n_pages);
}
/*
@@ -150,10 +150,10 @@ static struct rchan_buf *relay_create_buf(struct rchan *chan)
if (chan->n_subbufs > KMALLOC_MAX_SIZE / sizeof(size_t))
return NULL;
buf = kzalloc_obj(struct rchan_buf, GFP_KERNEL);
buf = kzalloc_obj(struct rchan_buf);
if (!buf)
return NULL;
buf->padding = kmalloc_objs(size_t, chan->n_subbufs, GFP_KERNEL);
buf->padding = kmalloc_objs(size_t, chan->n_subbufs);
if (!buf->padding)
goto free_buf;
@@ -489,7 +489,7 @@ struct rchan *relay_open(const char *base_filename,
if (!cb || !cb->create_buf_file || !cb->remove_buf_file)
return NULL;
chan = kzalloc_obj(struct rchan, GFP_KERNEL);
chan = kzalloc_obj(struct rchan);
if (!chan)
return NULL;