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/virtio | |
| 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/virtio')
| -rw-r--r-- | drivers/virtio/virtio_balloon.c | 2 | ||||
| -rw-r--r-- | drivers/virtio/virtio_input.c | 2 | ||||
| -rw-r--r-- | drivers/virtio/virtio_mem.c | 2 | ||||
| -rw-r--r-- | drivers/virtio/virtio_mmio.c | 2 | ||||
| -rw-r--r-- | drivers/virtio/virtio_pci_admin_legacy_io.c | 4 | ||||
| -rw-r--r-- | drivers/virtio/virtio_pci_common.c | 8 | ||||
| -rw-r--r-- | drivers/virtio/virtio_pci_modern.c | 22 | ||||
| -rw-r--r-- | drivers/virtio/virtio_ring.c | 10 | ||||
| -rw-r--r-- | drivers/virtio/virtio_vdpa.c | 4 |
9 files changed, 28 insertions, 28 deletions
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 4151aeebe766..d1fbc8fe8470 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -927,7 +927,7 @@ static int virtballoon_probe(struct virtio_device *vdev) return -EINVAL; } - vdev->priv = vb = kzalloc_obj(*vb, GFP_KERNEL); + vdev->priv = vb = kzalloc_obj(*vb); if (!vb) { err = -ENOMEM; goto out; diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c index 2386021e6dc5..deec24e8e682 100644 --- a/drivers/virtio/virtio_input.c +++ b/drivers/virtio/virtio_input.c @@ -229,7 +229,7 @@ static int virtinput_probe(struct virtio_device *vdev) if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) return -ENODEV; - vi = kzalloc_obj(*vi, GFP_KERNEL); + vi = kzalloc_obj(*vi); if (!vi) return -ENOMEM; diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 065027783822..48051e9e98ab 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -2940,7 +2940,7 @@ static int virtio_mem_probe(struct virtio_device *vdev) BUILD_BUG_ON(sizeof(struct virtio_mem_req) != 24); BUILD_BUG_ON(sizeof(struct virtio_mem_resp) != 10); - vdev->priv = vm = kzalloc_obj(*vm, GFP_KERNEL); + vdev->priv = vm = kzalloc_obj(*vm); if (!vm) return -ENOMEM; diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 7b063ea8b7f1..595c2274fbb5 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -575,7 +575,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) unsigned long magic; int rc; - vm_dev = kzalloc_obj(*vm_dev, GFP_KERNEL); + vm_dev = kzalloc_obj(*vm_dev); if (!vm_dev) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_admin_legacy_io.c b/drivers/virtio/virtio_pci_admin_legacy_io.c index 24733b098703..e3a9d261812a 100644 --- a/drivers/virtio/virtio_pci_admin_legacy_io.c +++ b/drivers/virtio/virtio_pci_admin_legacy_io.c @@ -124,7 +124,7 @@ static int virtio_pci_admin_legacy_io_read(struct pci_dev *pdev, u16 opcode, if (vf_id < 0) return vf_id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -210,7 +210,7 @@ int virtio_pci_admin_legacy_io_notify_info(struct pci_dev *pdev, if (vf_id < 0) return vf_id; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 2749bd6500fb..d3bdd68d4b6a 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -210,7 +210,7 @@ static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned int in struct virtio_pci_vq_info **p_info) { struct virtio_pci_device *vp_dev = to_vp_device(vdev); - struct virtio_pci_vq_info *info = kmalloc_obj(*info, GFP_KERNEL); + struct virtio_pci_vq_info *info = kmalloc_obj(*info); struct virtqueue *vq; unsigned long flags; @@ -386,7 +386,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned int nvqs, bool per_vq_vectors; u16 avq_num = 0; - vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs, GFP_KERNEL); + vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs); if (!vp_dev->vqs) return -ENOMEM; @@ -463,7 +463,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vq; u16 avq_num = 0; - vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs, GFP_KERNEL); + vp_dev->vqs = kzalloc_objs(*vp_dev->vqs, nvqs); if (!vp_dev->vqs) return -ENOMEM; @@ -685,7 +685,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, int rc; /* allocate our structure and fill it out */ - vp_dev = kzalloc_obj(struct virtio_pci_device, GFP_KERNEL); + vp_dev = kzalloc_obj(struct virtio_pci_device); if (!vp_dev) return -ENOMEM; diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index 041a7fd72835..6d8ae2a6a8ca 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -137,11 +137,11 @@ int vp_modern_admin_cmd_exec(struct virtio_device *vdev, if (!virtio_has_feature(vdev, VIRTIO_F_ADMIN_VQ)) return -EOPNOTSUPP; - va_status = kzalloc_obj(*va_status, GFP_KERNEL); + va_status = kzalloc_obj(*va_status); if (!va_status) return -ENOMEM; - va_hdr = kzalloc_obj(*va_hdr, GFP_KERNEL); + va_hdr = kzalloc_obj(*va_hdr); if (!va_hdr) { ret = -ENOMEM; goto err_alloc; @@ -204,7 +204,7 @@ static void virtio_pci_admin_cmd_list_init(struct virtio_device *virtio_dev) __le64 *data; int ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return; @@ -246,11 +246,11 @@ virtio_pci_admin_cmd_dev_parts_objects_enable(struct virtio_device *virtio_dev) u16 set_data_size; int ret; - get_data = kzalloc_obj(*get_data, GFP_KERNEL); + get_data = kzalloc_obj(*get_data); if (!get_data) return; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) goto end; @@ -310,7 +310,7 @@ static void virtio_pci_admin_cmd_cap_init(struct virtio_device *virtio_dev) struct scatterlist result_sg; int ret; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return; @@ -929,7 +929,7 @@ int virtio_pci_admin_mode_set(struct pci_dev *pdev, u8 flags) if (vf_id < 0) return vf_id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -1054,7 +1054,7 @@ int virtio_pci_admin_obj_destroy(struct pci_dev *pdev, u16 obj_type, u32 id) if (obj_type != VIRTIO_RESOURCE_OBJ_DEV_PARTS) return -EINVAL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; @@ -1109,11 +1109,11 @@ int virtio_pci_admin_dev_parts_metadata_get(struct pci_dev *pdev, u16 obj_type, if (vf_id < 0) return vf_id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; - result = kzalloc_obj(*result, GFP_KERNEL); + result = kzalloc_obj(*result); if (!result) { ret = -ENOMEM; goto end; @@ -1173,7 +1173,7 @@ int virtio_pci_admin_dev_parts_get(struct pci_dev *pdev, u16 obj_type, u32 id, if (vf_id < 0) return vf_id; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return -ENOMEM; diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 2cab954906cd..335692d41617 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1209,7 +1209,7 @@ static int vring_alloc_state_extra_split(struct vring_virtqueue_split *vring_spl struct vring_desc_extra *extra; u32 num = vring_split->vring.num; - state = kmalloc_objs(struct vring_desc_state_split, num, GFP_KERNEL); + state = kmalloc_objs(struct vring_desc_state_split, num); if (!state) goto err_state; @@ -1308,7 +1308,7 @@ static struct virtqueue *__vring_new_virtqueue_split(unsigned int index, struct vring_virtqueue *vq; int err; - vq = kmalloc_obj(*vq, GFP_KERNEL); + vq = kmalloc_obj(*vq); if (!vq) return NULL; @@ -2349,7 +2349,7 @@ static struct vring_desc_extra *vring_alloc_desc_extra(unsigned int num) struct vring_desc_extra *desc_extra; unsigned int i; - desc_extra = kmalloc_objs(struct vring_desc_extra, num, GFP_KERNEL); + desc_extra = kmalloc_objs(struct vring_desc_extra, num); if (!desc_extra) return NULL; @@ -2449,7 +2449,7 @@ static int vring_alloc_state_extra_packed(struct vring_virtqueue_packed *vring_p struct vring_desc_extra *extra; u32 num = vring_packed->vring.num; - state = kmalloc_objs(struct vring_desc_state_packed, num, GFP_KERNEL); + state = kmalloc_objs(struct vring_desc_state_packed, num); if (!state) goto err_desc_state; @@ -2528,7 +2528,7 @@ static struct virtqueue *__vring_new_virtqueue_packed(unsigned int index, struct vring_virtqueue *vq; int err; - vq = kmalloc_obj(*vq, GFP_KERNEL); + vq = kmalloc_obj(*vq); if (!vq) return NULL; diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 6c0d2f946817..de2af696de6c 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -287,7 +287,7 @@ create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) if (!affvecs) return NULL; - masks = kzalloc_objs(*masks, nvecs, GFP_KERNEL); + masks = kzalloc_objs(*masks, nvecs); if (!masks) return NULL; @@ -462,7 +462,7 @@ static int virtio_vdpa_probe(struct vdpa_device *vdpa) struct virtio_vdpa_device *vd_dev, *reg_dev = NULL; int ret = -EINVAL; - vd_dev = kzalloc_obj(*vd_dev, GFP_KERNEL); + vd_dev = kzalloc_obj(*vd_dev); if (!vd_dev) return -ENOMEM; |
