diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 16:37:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 17:09:51 -0800 |
| commit | bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch) | |
| tree | 01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/vdpa | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
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>
Diffstat (limited to 'drivers/vdpa')
| -rw-r--r-- | drivers/vdpa/ifcvf/ifcvf_main.c | 2 | ||||
| -rw-r--r-- | drivers/vdpa/mlx5/core/mr.c | 10 | ||||
| -rw-r--r-- | drivers/vdpa/mlx5/net/mlx5_vnet.c | 18 | ||||
| -rw-r--r-- | drivers/vdpa/pds/aux_drv.c | 2 | ||||
| -rw-r--r-- | drivers/vdpa/solidrun/snet_main.c | 6 | ||||
| -rw-r--r-- | drivers/vdpa/vdpa_user/iova_domain.c | 2 | ||||
| -rw-r--r-- | drivers/vdpa/vdpa_user/vduse_dev.c | 16 | ||||
| -rw-r--r-- | drivers/vdpa/virtio_pci/vp_vdpa.c | 6 |
8 files changed, 31 insertions, 31 deletions
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index b1b4c6adeef7..d46c1606c97a 100644 --- a/drivers/vdpa/ifcvf/ifcvf_main.c +++ b/drivers/vdpa/ifcvf/ifcvf_main.c @@ -793,7 +793,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) } pci_set_master(pdev); - ifcvf_mgmt_dev = kzalloc_obj(struct ifcvf_vdpa_mgmt_dev, GFP_KERNEL); + ifcvf_mgmt_dev = kzalloc_obj(struct ifcvf_vdpa_mgmt_dev); if (!ifcvf_mgmt_dev) { IFCVF_ERR(pdev, "Failed to alloc memory for the vDPA management device\n"); return -ENOMEM; diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c index f27316f3fec3..42c2705077a6 100644 --- a/drivers/vdpa/mlx5/core/mr.c +++ b/drivers/vdpa/mlx5/core/mr.c @@ -215,7 +215,7 @@ static int create_direct_keys(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr * int err = 0; int i = 0; - cmds = kvzalloc_objs(*cmds, mr->num_directs, GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, mr->num_directs); if (!cmds) return -ENOMEM; @@ -287,8 +287,8 @@ static int destroy_direct_keys(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr int err = 0; int i = 0; - cmds = kvzalloc_objs(*cmds, mr->num_directs, GFP_KERNEL); - cmd_mem = kvzalloc_objs(*cmd_mem, mr->num_directs, GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, mr->num_directs); + cmd_mem = kvzalloc_objs(*cmd_mem, mr->num_directs); if (!cmds || !cmd_mem) return -ENOMEM; @@ -456,7 +456,7 @@ static int add_direct_chain(struct mlx5_vdpa_dev *mvdev, st = start; while (size) { sz = (u32)min_t(u64, MAX_KLM_SIZE, size); - dmr = kzalloc_obj(*dmr, GFP_KERNEL); + dmr = kzalloc_obj(*dmr); if (!dmr) { err = -ENOMEM; goto err_alloc; @@ -817,7 +817,7 @@ struct mlx5_vdpa_mr *mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_mr *mr; int err; - mr = kzalloc_obj(*mr, GFP_KERNEL); + mr = kzalloc_obj(*mr); if (!mr) return ERR_PTR(-ENOMEM); diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 15a6c91ec335..4acd61285885 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1229,8 +1229,8 @@ static int query_virtqueues(struct mlx5_vdpa_net *ndev, WARN(start_vq + num_vqs > mvdev->max_vqs, "query vq range invalid [%d, %d), max_vqs: %u\n", start_vq, start_vq + num_vqs, mvdev->max_vqs); - cmds = kvzalloc_objs(*cmds, num_vqs, GFP_KERNEL); - cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs, GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, num_vqs); + cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs); if (!cmds || !cmd_mem) { err = -ENOMEM; goto done; @@ -1562,8 +1562,8 @@ static int modify_virtqueues(struct mlx5_vdpa_net *ndev, int start_vq, int num_v WARN(start_vq + num_vqs > mvdev->max_vqs, "modify vq range invalid [%d, %d), max_vqs: %u\n", start_vq, start_vq + num_vqs, mvdev->max_vqs); - cmds = kvzalloc_objs(*cmds, num_vqs, GFP_KERNEL); - cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs, GFP_KERNEL); + cmds = kvzalloc_objs(*cmds, num_vqs); + cmd_mem = kvzalloc_objs(*cmd_mem, num_vqs); if (!cmds || !cmd_mem) { err = -ENOMEM; goto done; @@ -1649,7 +1649,7 @@ static int suspend_vqs(struct mlx5_vdpa_net *ndev, int start_vq, int num_vqs) if (err) return err; - attrs = kzalloc_objs(struct mlx5_virtq_attr, num_vqs, GFP_KERNEL); + attrs = kzalloc_objs(struct mlx5_virtq_attr, num_vqs); if (!attrs) return -ENOMEM; @@ -1922,7 +1922,7 @@ static int mlx5_vdpa_add_mac_vlan_rules(struct mlx5_vdpa_net *ndev, u8 *mac, int err; u16 vid; - spec = kvzalloc_obj(*spec, GFP_KERNEL); + spec = kvzalloc_obj(*spec); if (!spec) return -ENOMEM; @@ -2034,7 +2034,7 @@ static int mac_vlan_add(struct mlx5_vdpa_net *ndev, u8 *mac, u16 vid, bool tagge if (mac_vlan_lookup(ndev, val)) return -EEXIST; - ptr = kzalloc_obj(*ptr, GFP_KERNEL); + ptr = kzalloc_obj(*ptr); if (!ptr) return -ENOMEM; @@ -3902,7 +3902,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name, mlx5_cmd_init_async_ctx(mdev, &mvdev->async_ctx); - ndev->vqs = kzalloc_objs(*ndev->vqs, max_vqs, GFP_KERNEL); + ndev->vqs = kzalloc_objs(*ndev->vqs, max_vqs); ndev->event_cbs = kzalloc_objs(*ndev->event_cbs, max_vqs + 1, GFP_KERNEL); if (!ndev->vqs || !ndev->event_cbs) { @@ -4104,7 +4104,7 @@ static int mlx5v_probe(struct auxiliary_device *adev, struct mlx5_vdpa_mgmtdev *mgtdev; int err; - mgtdev = kzalloc_obj(*mgtdev, GFP_KERNEL); + mgtdev = kzalloc_obj(*mgtdev); if (!mgtdev) return -ENOMEM; diff --git a/drivers/vdpa/pds/aux_drv.c b/drivers/vdpa/pds/aux_drv.c index 970eec66b117..61314d56095d 100644 --- a/drivers/vdpa/pds/aux_drv.c +++ b/drivers/vdpa/pds/aux_drv.c @@ -39,7 +39,7 @@ static int pds_vdpa_probe(struct auxiliary_device *aux_dev, struct pds_vdpa_aux *vdpa_aux; int err; - vdpa_aux = kzalloc_obj(*vdpa_aux, GFP_KERNEL); + vdpa_aux = kzalloc_obj(*vdpa_aux); if (!vdpa_aux) return -ENOMEM; diff --git a/drivers/vdpa/solidrun/snet_main.c b/drivers/vdpa/solidrun/snet_main.c index 527efeed912c..28d55315df2a 100644 --- a/drivers/vdpa/solidrun/snet_main.c +++ b/drivers/vdpa/solidrun/snet_main.c @@ -732,7 +732,7 @@ static int psnet_read_cfg(struct pci_dev *pdev, struct psnet *psnet) /* Load device configuration from BAR */ for (i = 0; i < cfg->devices_num; i++) { - cfg->devs[i] = kzalloc_obj(*cfg->devs[i], GFP_KERNEL); + cfg->devs[i] = kzalloc_obj(*cfg->devs[i]); if (!cfg->devs[i]) { snet_free_cfg(cfg); return -ENOMEM; @@ -827,7 +827,7 @@ static int snet_build_vqs(struct snet *snet) /* Allocate the VQs */ for (i = 0; i < snet->cfg->vq_num; i++) { - snet->vqs[i] = kzalloc_obj(*snet->vqs[i], GFP_KERNEL); + snet->vqs[i] = kzalloc_obj(*snet->vqs[i]); if (!snet->vqs[i]) { snet_free_vqs(snet); return -ENOMEM; @@ -902,7 +902,7 @@ static int snet_vdpa_probe_pf(struct pci_dev *pdev) } /* Allocate a PCI physical function device */ - psnet = kzalloc_obj(*psnet, GFP_KERNEL); + psnet = kzalloc_obj(*psnet); if (!psnet) return -ENOMEM; diff --git a/drivers/vdpa/vdpa_user/iova_domain.c b/drivers/vdpa/vdpa_user/iova_domain.c index 44e9babc0b54..806cec32c4bc 100644 --- a/drivers/vdpa/vdpa_user/iova_domain.c +++ b/drivers/vdpa/vdpa_user/iova_domain.c @@ -622,7 +622,7 @@ vduse_domain_create(unsigned long iova_limit, size_t bounce_size) if (iova_limit <= bounce_size) return NULL; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) return NULL; diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index 7478aa8d5489..6202f6902fcd 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -1232,7 +1232,7 @@ static int vduse_dev_reg_umem(struct vduse_dev *dev, npages = size >> PAGE_SHIFT; page_list = __vmalloc(array_size(npages, sizeof(struct page *)), GFP_KERNEL_ACCOUNT); - umem = kzalloc_obj(*umem, GFP_KERNEL); + umem = kzalloc_obj(*umem); if (!page_list || !umem) goto unlock; @@ -1800,12 +1800,12 @@ static int vduse_dev_init_vqs(struct vduse_dev *dev, u32 vq_align, u32 vq_num) dev->vq_align = vq_align; dev->vq_num = vq_num; - dev->vqs = kzalloc_objs(*dev->vqs, dev->vq_num, GFP_KERNEL); + dev->vqs = kzalloc_objs(*dev->vqs, dev->vq_num); if (!dev->vqs) return -ENOMEM; for (i = 0; i < vq_num; i++) { - dev->vqs[i] = kzalloc_obj(*dev->vqs[i], GFP_KERNEL); + dev->vqs[i] = kzalloc_obj(*dev->vqs[i]); if (!dev->vqs[i]) { ret = -ENOMEM; goto err; @@ -1839,7 +1839,7 @@ err: static struct vduse_dev *vduse_dev_create(void) { - struct vduse_dev *dev = kzalloc_obj(*dev, GFP_KERNEL); + struct vduse_dev *dev = kzalloc_obj(*dev); if (!dev) return NULL; @@ -2076,7 +2076,7 @@ static int vduse_create_dev(struct vduse_dev_config *config, dev->vendor_id = config->vendor_id; dev->nas = (dev->api_version < VDUSE_API_VERSION_1) ? 1 : config->nas; - dev->as = kzalloc_objs(dev->as[0], dev->nas, GFP_KERNEL); + dev->as = kzalloc_objs(dev->as[0], dev->nas); if (!dev->as) goto err_as; for (int i = 0; i < dev->nas; i++) @@ -2085,7 +2085,7 @@ static int vduse_create_dev(struct vduse_dev_config *config, dev->ngroups = (dev->api_version < VDUSE_API_VERSION_1) ? 1 : config->ngroups; - dev->groups = kzalloc_objs(dev->groups[0], dev->ngroups, GFP_KERNEL); + dev->groups = kzalloc_objs(dev->groups[0], dev->ngroups); if (!dev->groups) goto err_vq_groups; for (u32 i = 0; i < dev->ngroups; ++i) { @@ -2226,7 +2226,7 @@ static int vduse_open(struct inode *inode, struct file *file) { struct vduse_control *control; - control = kmalloc_obj(struct vduse_control, GFP_KERNEL); + control = kmalloc_obj(struct vduse_control); if (!control) return -ENOMEM; @@ -2356,7 +2356,7 @@ static int vduse_mgmtdev_init(void) { int ret; - vduse_mgmt = kzalloc_obj(*vduse_mgmt, GFP_KERNEL); + vduse_mgmt = kzalloc_obj(*vduse_mgmt); if (!vduse_mgmt) return -ENOMEM; diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c index 102f25ccfddf..51ffc245a038 100644 --- a/drivers/vdpa/virtio_pci/vp_vdpa.c +++ b/drivers/vdpa/virtio_pci/vp_vdpa.c @@ -608,7 +608,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) struct virtio_device_id *mdev_id = NULL; int err; - vp_vdpa_mgtdev = kzalloc_obj(*vp_vdpa_mgtdev, GFP_KERNEL); + vp_vdpa_mgtdev = kzalloc_obj(*vp_vdpa_mgtdev); if (!vp_vdpa_mgtdev) return -ENOMEM; @@ -616,7 +616,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) mgtdev->ops = &vp_vdpa_mdev_ops; mgtdev->device = dev; - mdev = kzalloc_obj(struct virtio_pci_modern_device, GFP_KERNEL); + mdev = kzalloc_obj(struct virtio_pci_modern_device); if (!mdev) { err = -ENOMEM; goto mdev_err; @@ -626,7 +626,7 @@ static int vp_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id) * id_table should be a null terminated array, so allocate one additional * entry here, see vdpa_mgmtdev_get_classes(). */ - mdev_id = kzalloc_objs(struct virtio_device_id, 2, GFP_KERNEL); + mdev_id = kzalloc_objs(struct virtio_device_id, 2); if (!mdev_id) { err = -ENOMEM; goto mdev_id_err; |
