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/vfio | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
| download | linux-next-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.gz linux-next-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.zip | |
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/vfio')
| -rw-r--r-- | drivers/vfio/cdx/intr.c | 2 | ||||
| -rw-r--r-- | drivers/vfio/container.c | 2 | ||||
| -rw-r--r-- | drivers/vfio/group.c | 2 | ||||
| -rw-r--r-- | drivers/vfio/mdev/mdev_core.c | 2 | ||||
| -rw-r--r-- | drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 4 | ||||
| -rw-r--r-- | drivers/vfio/pci/pds/dirty.c | 4 | ||||
| -rw-r--r-- | drivers/vfio/pci/pds/lm.c | 4 | ||||
| -rw-r--r-- | drivers/vfio/pci/qat/main.c | 4 | ||||
| -rw-r--r-- | drivers/vfio/pci/vfio_pci_core.c | 8 | ||||
| -rw-r--r-- | drivers/vfio/pci/vfio_pci_dmabuf.c | 2 | ||||
| -rw-r--r-- | drivers/vfio/vfio_iommu_spapr_tce.c | 6 | ||||
| -rw-r--r-- | drivers/vfio/vfio_iommu_type1.c | 14 | ||||
| -rw-r--r-- | drivers/vfio/vfio_main.c | 4 |
13 files changed, 29 insertions, 29 deletions
diff --git a/drivers/vfio/cdx/intr.c b/drivers/vfio/cdx/intr.c index 0ae39bda7c35..8f4402cec9c5 100644 --- a/drivers/vfio/cdx/intr.c +++ b/drivers/vfio/cdx/intr.c @@ -27,7 +27,7 @@ static int vfio_cdx_msi_enable(struct vfio_cdx_device *vdev, int nvec) struct device *dev = vdev->vdev.dev; int msi_idx, ret; - vdev->cdx_irqs = kzalloc_objs(struct vfio_cdx_irq, nvec, GFP_KERNEL); + vdev->cdx_irqs = kzalloc_objs(struct vfio_cdx_irq, nvec); if (!vdev->cdx_irqs) return -ENOMEM; diff --git a/drivers/vfio/container.c b/drivers/vfio/container.c index 937fc1de5965..003281dbf8bc 100644 --- a/drivers/vfio/container.c +++ b/drivers/vfio/container.c @@ -95,7 +95,7 @@ int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops) if (WARN_ON(!ops->register_device != !ops->unregister_device)) return -EINVAL; - driver = kzalloc_obj(*driver, GFP_KERNEL); + driver = kzalloc_obj(*driver); if (!driver) return -ENOMEM; diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index 868e69053050..4f15016d2a5f 100644 --- a/drivers/vfio/group.c +++ b/drivers/vfio/group.c @@ -515,7 +515,7 @@ static struct vfio_group *vfio_group_alloc(struct iommu_group *iommu_group, struct vfio_group *group; int minor; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index 5b6ac30c02bf..3b4aa0632fcc 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -154,7 +154,7 @@ int mdev_device_create(struct mdev_type *type, const guid_t *uuid) atomic_dec(&parent->available_instances); } - mdev = kzalloc_obj(*mdev, GFP_KERNEL); + mdev = kzalloc_obj(*mdev); if (!mdev) { mutex_unlock(&mdev_list_lock); return -ENOMEM; diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c index 68b3c1745609..1d367cff7dcf 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c @@ -1498,7 +1498,7 @@ static int hisi_acc_vf_dev_read(struct seq_file *seq, void *data) } mutex_lock(&hisi_acc_vdev->state_mutex); - vf_data = kzalloc_obj(*vf_data, GFP_KERNEL); + vf_data = kzalloc_obj(*vf_data); if (!vf_data) { ret = -ENOMEM; goto mutex_release; @@ -1679,7 +1679,7 @@ static void hisi_acc_vfio_debug_init(struct hisi_acc_vf_core_device *hisi_acc_vd return; } - migf = kzalloc_obj(*migf, GFP_KERNEL); + migf = kzalloc_obj(*migf); if (!migf) { dput(vfio_dev_migration); return; diff --git a/drivers/vfio/pci/pds/dirty.c b/drivers/vfio/pci/pds/dirty.c index 7a218948c475..32573f6e8cc6 100644 --- a/drivers/vfio/pci/pds/dirty.c +++ b/drivers/vfio/pci/pds/dirty.c @@ -285,7 +285,7 @@ static int pds_vfio_dirty_enable(struct pds_vfio_pci_device *pds_vfio, num_ranges = max_regions; } - region_info = kzalloc_objs(*region_info, num_ranges, GFP_KERNEL); + region_info = kzalloc_objs(*region_info, num_ranges); if (!region_info) return -ENOMEM; len = num_ranges * sizeof(*region_info); @@ -397,7 +397,7 @@ static int pds_vfio_dirty_seq_ack(struct pds_vfio_pci_device *pds_vfio, * will be enough pages to represent the bmp_bytes */ npages = DIV_ROUND_UP_ULL(bmp_bytes + page_offset, PAGE_SIZE); - pages = kmalloc_objs(*pages, npages, GFP_KERNEL); + pages = kmalloc_objs(*pages, npages); if (!pages) return -ENOMEM; diff --git a/drivers/vfio/pci/pds/lm.c b/drivers/vfio/pci/pds/lm.c index c9a21a049372..08487eab11b0 100644 --- a/drivers/vfio/pci/pds/lm.c +++ b/drivers/vfio/pci/pds/lm.c @@ -24,7 +24,7 @@ pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size) return NULL; /* Alloc file structure */ - lm_file = kzalloc_obj(*lm_file, GFP_KERNEL); + lm_file = kzalloc_obj(*lm_file); if (!lm_file) return NULL; @@ -42,7 +42,7 @@ pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size) /* Allocate memory for file pages */ npages = DIV_ROUND_UP_ULL(size, PAGE_SIZE); - pages = kmalloc_objs(*pages, npages, GFP_KERNEL); + pages = kmalloc_objs(*pages, npages); if (!pages) goto out_put_file; diff --git a/drivers/vfio/pci/qat/main.c b/drivers/vfio/pci/qat/main.c index 591349c2edc8..b982d4ae666c 100644 --- a/drivers/vfio/pci/qat/main.c +++ b/drivers/vfio/pci/qat/main.c @@ -261,7 +261,7 @@ qat_vf_save_device_data(struct qat_vf_core_device *qat_vdev, bool pre_copy) struct qat_vf_migration_file *migf; int ret; - migf = kzalloc_obj(*migf, GFP_KERNEL); + migf = kzalloc_obj(*migf); if (!migf) return ERR_PTR(-ENOMEM); @@ -352,7 +352,7 @@ qat_vf_resume_device_data(struct qat_vf_core_device *qat_vdev) struct qat_vf_migration_file *migf; int ret; - migf = kzalloc_obj(*migf, GFP_KERNEL); + migf = kzalloc_obj(*migf); if (!migf) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 10bfa76f06e5..d43745fe4c84 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -1291,7 +1291,7 @@ static int vfio_pci_ioctl_get_pci_hot_reset_info( goto header; } - devices = kzalloc_objs(*devices, count, GFP_KERNEL); + devices = kzalloc_objs(*devices, count); if (!devices) return -ENOMEM; @@ -1350,8 +1350,8 @@ vfio_pci_ioctl_pci_hot_reset_groups(struct vfio_pci_core_device *vdev, if (array_count > count) return -EINVAL; - group_fds = kzalloc_objs(*group_fds, array_count, GFP_KERNEL); - files = kzalloc_objs(*files, array_count, GFP_KERNEL); + group_fds = kzalloc_objs(*group_fds, array_count); + files = kzalloc_objs(*files, array_count); if (!group_fds || !files) { kfree(group_fds); kfree(files); @@ -2034,7 +2034,7 @@ static int vfio_pci_vf_init(struct vfio_pci_core_device *vdev) if (!pdev->is_physfn) return 0; - vdev->vf_token = kzalloc_obj(*vdev->vf_token, GFP_KERNEL); + vdev->vf_token = kzalloc_obj(*vdev->vf_token); if (!vdev->vf_token) return -ENOMEM; diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio_pci_dmabuf.c index abed6508cd83..12234538254c 100644 --- a/drivers/vfio/pci/vfio_pci_dmabuf.c +++ b/drivers/vfio/pci/vfio_pci_dmabuf.c @@ -246,7 +246,7 @@ int vfio_pci_core_feature_dma_buf(struct vfio_pci_core_device *vdev, u32 flags, if (ret) goto err_free_ranges; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { ret = -ENOMEM; goto err_free_ranges; diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c index 3867928d2f49..1c0eec228cc6 100644 --- a/drivers/vfio/vfio_iommu_spapr_tce.c +++ b/drivers/vfio/vfio_iommu_spapr_tce.c @@ -159,7 +159,7 @@ static long tce_iommu_register_pages(struct tce_container *container, return ret; } - tcemem = kzalloc_obj(*tcemem, GFP_KERNEL); + tcemem = kzalloc_obj(*tcemem); if (!tcemem) { ret = -ENOMEM; goto put_exit; @@ -322,7 +322,7 @@ static void *tce_iommu_open(unsigned long arg) return ERR_PTR(-EINVAL); } - container = kzalloc_obj(*container, GFP_KERNEL); + container = kzalloc_obj(*container); if (!container) return ERR_PTR(-ENOMEM); @@ -1290,7 +1290,7 @@ static int tce_iommu_attach_group(void *iommu_data, } } - tcegrp = kzalloc_obj(*tcegrp, GFP_KERNEL); + tcegrp = kzalloc_obj(*tcegrp); if (!tcegrp) { ret = -ENOMEM; goto unlock_exit; diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index aedbc2fecb23..03cefdf99a4a 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -388,7 +388,7 @@ static int vfio_add_to_pfn_list(struct vfio_dma *dma, dma_addr_t iova, { struct vfio_pfn *vpfn; - vpfn = kzalloc_obj(*vpfn, GFP_KERNEL); + vpfn = kzalloc_obj(*vpfn); if (!vpfn) return -ENOMEM; @@ -1097,7 +1097,7 @@ static size_t unmap_unpin_fast(struct vfio_domain *domain, struct iommu_iotlb_gather *iotlb_gather) { size_t unmapped = 0; - struct vfio_regions *entry = kzalloc_obj(*entry, GFP_KERNEL); + struct vfio_regions *entry = kzalloc_obj(*entry); if (entry) { unmapped = iommu_unmap_fast(domain->domain, iova, len, @@ -1753,7 +1753,7 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, goto out_unlock; } - dma = kzalloc_obj(*dma, GFP_KERNEL); + dma = kzalloc_obj(*dma); if (!dma) { ret = -ENOMEM; goto out_unlock; @@ -2017,7 +2017,7 @@ static int vfio_iommu_iova_insert(struct list_head *head, { struct vfio_iova *region; - region = kmalloc_obj(*region, GFP_KERNEL); + region = kmalloc_obj(*region); if (!region) return -ENOMEM; @@ -2259,7 +2259,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, goto out_unlock; ret = -ENOMEM; - group = kzalloc_obj(*group, GFP_KERNEL); + group = kzalloc_obj(*group); if (!group) goto out_unlock; group->iommu_group = iommu_group; @@ -2278,7 +2278,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, } ret = -ENOMEM; - domain = kzalloc_obj(*domain, GFP_KERNEL); + domain = kzalloc_obj(*domain); if (!domain) goto out_free_group; @@ -2625,7 +2625,7 @@ static void *vfio_iommu_type1_open(unsigned long arg) { struct vfio_iommu *iommu; - iommu = kzalloc_obj(*iommu, GFP_KERNEL); + iommu = kzalloc_obj(*iommu); if (!iommu) return ERR_PTR(-ENOMEM); diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index 0028abdfe3cb..742477546b15 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -82,7 +82,7 @@ int vfio_assign_device_set(struct vfio_device *device, void *set_id) goto found_get_ref; xa_unlock(&vfio_device_set_xa); - new_dev_set = kzalloc_obj(*new_dev_set, GFP_KERNEL); + new_dev_set = kzalloc_obj(*new_dev_set); if (!new_dev_set) return -ENOMEM; mutex_init(&new_dev_set->lock); @@ -1083,7 +1083,7 @@ vfio_ioctl_device_feature_logging_start(struct vfio_device *device, return -E2BIG; ranges = u64_to_user_ptr(control.ranges); - nodes = kmalloc_objs(struct interval_tree_node, nnodes, GFP_KERNEL); + nodes = kmalloc_objs(struct interval_tree_node, nnodes); if (!nodes) return -ENOMEM; |
