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 2026-02-21 16:37:42 -08:00
parent e19e1b480a
commit bf4afc53b7
6673 changed files with 13013 additions and 13013 deletions

View file

@ -449,7 +449,7 @@ static int mqueue_init_fs_context(struct fs_context *fc)
{
struct mqueue_fs_context *ctx;
ctx = kzalloc_obj(struct mqueue_fs_context, GFP_KERNEL);
ctx = kzalloc_obj(struct mqueue_fs_context);
if (!ctx)
return -ENOMEM;
@ -1088,7 +1088,7 @@ static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr,
* fall back to that if necessary.
*/
if (!info->node_cache)
new_leaf = kmalloc_obj(*new_leaf, GFP_KERNEL);
new_leaf = kmalloc_obj(*new_leaf);
spin_lock(&info->lock);
@ -1181,7 +1181,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr,
* fall back to that if necessary.
*/
if (!info->node_cache)
new_leaf = kmalloc_obj(*new_leaf, GFP_KERNEL);
new_leaf = kmalloc_obj(*new_leaf);
spin_lock(&info->lock);

View file

@ -2234,7 +2234,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops,
return -EINVAL;
if (nsops > SEMOPM_FAST) {
sops = kvmalloc_objs(*sops, nsops, GFP_KERNEL);
sops = kvmalloc_objs(*sops, nsops);
if (sops == NULL)
return -ENOMEM;
}

View file

@ -1618,7 +1618,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg,
rcu_read_unlock();
err = -ENOMEM;
sfd = kzalloc_obj(*sfd, GFP_KERNEL);
sfd = kzalloc_obj(*sfd);
if (!sfd) {
fput(base);
goto out_nattch;

View file

@ -141,7 +141,7 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
struct proc_dir_entry *pde;
struct ipc_proc_iface *iface;
iface = kmalloc_obj(*iface, GFP_KERNEL);
iface = kmalloc_obj(*iface);
if (!iface)
return;
iface->path = path;