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

@@ -57,7 +57,7 @@ static int pm80x_onkey_probe(struct platform_device *pdev)
struct pm80x_onkey_info *info;
int err;
info = kzalloc_obj(*info, GFP_KERNEL);
info = kzalloc_obj(*info);
if (!info)
return -ENOMEM;

View File

@@ -772,7 +772,7 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d
if (alt->desc.bInterfaceNumber)
return -ENODEV;
ar2 = kzalloc_obj(struct ati_remote2, GFP_KERNEL);
ar2 = kzalloc_obj(struct ati_remote2);
if (!ar2)
return -ENOMEM;

View File

@@ -696,7 +696,7 @@ static int cm109_usb_probe(struct usb_interface *intf,
if (!usb_endpoint_is_int_in(endpoint))
return -ENODEV;
dev = kzalloc_obj(*dev, GFP_KERNEL);
dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;
@@ -721,7 +721,7 @@ static int cm109_usb_probe(struct usb_interface *intf,
if (!dev->ctl_data)
goto err_out;
dev->ctl_req = kmalloc_obj(*(dev->ctl_req), GFP_KERNEL);
dev->ctl_req = kmalloc_obj(*(dev->ctl_req));
if (!dev->ctl_req)
goto err_out;

View File

@@ -285,7 +285,7 @@ struct cma3000_accl_data *cma3000_init(struct device *dev, int irq,
goto err_out;
}
data = kzalloc_obj(*data, GFP_KERNEL);
data = kzalloc_obj(*data);
input_dev = input_allocate_device();
if (!data || !input_dev) {
error = -ENOMEM;

View File

@@ -276,7 +276,7 @@ static void cs40l50_add_worker(struct work_struct *work)
/* Update effect if already uploaded, otherwise create new effect */
effect = cs40l50_find_effect(work_data->effect->id, &vib->effect_head);
if (!effect) {
effect = kzalloc_obj(*effect, GFP_KERNEL);
effect = kzalloc_obj(*effect);
if (!effect) {
error = -ENOMEM;
goto err_pm;

View File

@@ -80,7 +80,7 @@ static int da9052_onkey_probe(struct platform_device *pdev)
return -EINVAL;
}
onkey = kzalloc_obj(*onkey, GFP_KERNEL);
onkey = kzalloc_obj(*onkey);
input_dev = input_allocate_device();
if (!onkey || !input_dev) {
dev_err(&pdev->dev, "Failed to allocate memory\n");

View File

@@ -286,7 +286,7 @@ static int ims_pcu_setup_gamepad(struct ims_pcu *pcu)
struct input_dev *input;
int error;
gamepad = kzalloc_obj(*gamepad, GFP_KERNEL);
gamepad = kzalloc_obj(*gamepad);
input = input_allocate_device();
if (!gamepad || !input) {
dev_err(pcu->dev,
@@ -1991,7 +1991,7 @@ static int ims_pcu_probe(struct usb_interface *intf,
struct ims_pcu *pcu;
int error;
pcu = kzalloc_obj(*pcu, GFP_KERNEL);
pcu = kzalloc_obj(*pcu);
if (!pcu)
return -ENOMEM;

View File

@@ -453,7 +453,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
if (!endpoint)
return -ENODEV;
remote = kzalloc_obj(*remote, GFP_KERNEL);
remote = kzalloc_obj(*remote);
input_dev = input_allocate_device();
if (!remote || !input_dev) {
error = -ENOMEM;

View File

@@ -247,7 +247,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
return -EINVAL;
}
chip = kzalloc_obj(*chip, GFP_KERNEL);
chip = kzalloc_obj(*chip);
input_dev = input_allocate_device();
if (!chip || !input_dev) {
dev_err(&pdev->dev, "unable to allocate memory\n");

View File

@@ -108,7 +108,7 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
return -ENOMEM;
}
priv = kzalloc_obj(*priv, GFP_KERNEL);
priv = kzalloc_obj(*priv);
if (!priv) {
err = -ENOMEM;
dev_dbg(&pdev->dev, "Can't allocate power button\n");

View File

@@ -164,7 +164,7 @@ static int palmas_pwron_probe(struct platform_device *pdev)
palmas_pwron_params_ofinit(dev, &config);
pwron = kzalloc_obj(*pwron, GFP_KERNEL);
pwron = kzalloc_obj(*pwron);
if (!pwron)
return -ENOMEM;

View File

@@ -49,7 +49,7 @@ static int pcap_keys_probe(struct platform_device *pdev)
struct pcap_keys *pcap_keys;
struct input_dev *input_dev;
pcap_keys = kmalloc_obj(*pcap_keys, GFP_KERNEL);
pcap_keys = kmalloc_obj(*pcap_keys);
if (!pcap_keys)
return err;

View File

@@ -91,7 +91,7 @@ static int pcf8574_kp_probe(struct i2c_client *client)
return -ENODEV;
}
lp = kzalloc_obj(*lp, GFP_KERNEL);
lp = kzalloc_obj(*lp);
if (!lp)
return -ENOMEM;

View File

@@ -275,7 +275,7 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
if (!pm->data)
return -1;
pm->configcr = kmalloc_obj(*(pm->configcr), GFP_KERNEL);
pm->configcr = kmalloc_obj(*(pm->configcr));
if (!pm->configcr)
return -ENOMEM;
@@ -313,7 +313,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
0, interface->desc.bInterfaceNumber, NULL, 0,
USB_CTRL_SET_TIMEOUT);
pm = kzalloc_obj(*pm, GFP_KERNEL);
pm = kzalloc_obj(*pm);
input_dev = input_allocate_device();
if (!pm || !input_dev)
goto fail1;

View File

@@ -379,7 +379,7 @@ static int uinput_open(struct inode *inode, struct file *file)
{
struct uinput_device *newdev;
newdev = kzalloc_obj(*newdev, GFP_KERNEL);
newdev = kzalloc_obj(*newdev);
if (!newdev)
return -ENOMEM;

View File

@@ -205,7 +205,7 @@ static int xenkbd_probe(struct xenbus_device *dev,
struct xenkbd_info *info;
struct input_dev *kbd, *ptr, *mtouch;
info = kzalloc_obj(*info, GFP_KERNEL);
info = kzalloc_obj(*info);
if (!info) {
xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure");
return -ENOMEM;

View File

@@ -831,7 +831,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
if (!usb_endpoint_is_int_in(endpoint))
return -ENODEV;
yld = kzalloc_obj(*yld, GFP_KERNEL);
yld = kzalloc_obj(*yld);
if (!yld)
return -ENOMEM;
@@ -854,7 +854,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
if (!yld->ctl_data)
return usb_cleanup(yld, -ENOMEM);
yld->ctl_req = kmalloc_obj(*(yld->ctl_req), GFP_KERNEL);
yld->ctl_req = kmalloc_obj(*(yld->ctl_req));
if (yld->ctl_req == NULL)
return usb_cleanup(yld, -ENOMEM);