summaryrefslogtreecommitdiff
path: root/drivers/xen
diff options
context:
space:
mode:
authorLinus Torvalds2026-02-21 16:37:42 -0800
committerLinus Torvalds2026-02-21 17:09:51 -0800
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/xen
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (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/xen')
-rw-r--r--drivers/xen/arm-device.c6
-rw-r--r--drivers/xen/balloon.c2
-rw-r--r--drivers/xen/events/events_base.c2
-rw-r--r--drivers/xen/evtchn.c6
-rw-r--r--drivers/xen/gntalloc.c6
-rw-r--r--drivers/xen/gntdev-dmabuf.c12
-rw-r--r--drivers/xen/gntdev.c18
-rw-r--r--drivers/xen/grant-table.c4
-rw-r--r--drivers/xen/mcelog.c2
-rw-r--r--drivers/xen/pci.c2
-rw-r--r--drivers/xen/pcpu.c2
-rw-r--r--drivers/xen/privcmd-buf.c2
-rw-r--r--drivers/xen/privcmd.c12
-rw-r--r--drivers/xen/pvcalls-back.c6
-rw-r--r--drivers/xen/pvcalls-front.c6
-rw-r--r--drivers/xen/sys-hypervisor.c8
-rw-r--r--drivers/xen/unpopulated-alloc.c6
-rw-r--r--drivers/xen/xen-front-pgdir-shbuf.c6
-rw-r--r--drivers/xen/xen-pciback/conf_space.c2
-rw-r--r--drivers/xen/xen-pciback/conf_space_header.c4
-rw-r--r--drivers/xen/xen-pciback/conf_space_quirks.c2
-rw-r--r--drivers/xen/xen-pciback/passthrough.c4
-rw-r--r--drivers/xen/xen-pciback/pci_stub.c8
-rw-r--r--drivers/xen/xen-pciback/pciback_ops.c2
-rw-r--r--drivers/xen/xen-pciback/vpci.c4
-rw-r--r--drivers/xen/xen-pciback/xenbus.c2
-rw-r--r--drivers/xen/xen-scsiback.c10
-rw-r--r--drivers/xen/xenbus/xenbus_client.c4
-rw-r--r--drivers/xen/xenbus/xenbus_dev_frontend.c6
-rw-r--r--drivers/xen/xlate_mmu.c4
30 files changed, 80 insertions, 80 deletions
diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c
index 009c76546d85..7bc0fc400fd1 100644
--- a/drivers/xen/arm-device.c
+++ b/drivers/xen/arm-device.c
@@ -59,9 +59,9 @@ static int xen_map_device_mmio(const struct resource *resources,
if ((resource_type(r) != IORESOURCE_MEM) || (nr == 0))
continue;
- gpfns = kzalloc_objs(xen_pfn_t, nr, GFP_KERNEL);
- idxs = kzalloc_objs(xen_ulong_t, nr, GFP_KERNEL);
- errs = kzalloc_objs(int, nr, GFP_KERNEL);
+ gpfns = kzalloc_objs(xen_pfn_t, nr);
+ idxs = kzalloc_objs(xen_ulong_t, nr);
+ errs = kzalloc_objs(int, nr);
if (!gpfns || !idxs || !errs) {
kfree(gpfns);
kfree(idxs);
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 6cbff7e90947..e7f1d4ca6d75 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -242,7 +242,7 @@ static struct resource *additional_memory_resource(phys_addr_t size)
struct resource *res;
int ret;
- res = kzalloc_obj(*res, GFP_KERNEL);
+ res = kzalloc_obj(*res);
if (!res)
return NULL;
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 515bb5708e7f..679e807c3663 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -714,7 +714,7 @@ static struct irq_info *xen_irq_init(unsigned int irq)
{
struct irq_info *info;
- info = kzalloc_obj(*info, GFP_KERNEL);
+ info = kzalloc_obj(*info);
if (info) {
info->irq = irq;
info->type = IRQT_UNBOUND;
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index 568f1830f3a3..b7665bf2774c 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -332,7 +332,7 @@ static int evtchn_resize_ring(struct per_user_data *u)
else
new_size = 2 * u->ring_size;
- new_ring = kvmalloc_objs(*new_ring, new_size, GFP_KERNEL);
+ new_ring = kvmalloc_objs(*new_ring, new_size);
if (!new_ring)
return -ENOMEM;
@@ -386,7 +386,7 @@ static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port,
* serialized bind operations.)
*/
- evtchn = kzalloc_obj(*evtchn, GFP_KERNEL);
+ evtchn = kzalloc_obj(*evtchn);
if (!evtchn)
return -ENOMEM;
@@ -642,7 +642,7 @@ static int evtchn_open(struct inode *inode, struct file *filp)
{
struct per_user_data *u;
- u = kzalloc_obj(*u, GFP_KERNEL);
+ u = kzalloc_obj(*u);
if (u == NULL)
return -ENOMEM;
diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c
index 8204135c31f9..eadedd1e963e 100644
--- a/drivers/xen/gntalloc.c
+++ b/drivers/xen/gntalloc.c
@@ -128,7 +128,7 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op,
readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE);
for (i = 0; i < op->count; i++) {
- gref = kzalloc_obj(*gref, GFP_KERNEL);
+ gref = kzalloc_obj(*gref);
if (!gref) {
rc = -ENOMEM;
goto undo;
@@ -229,7 +229,7 @@ static int gntalloc_open(struct inode *inode, struct file *filp)
{
struct gntalloc_file_private_data *priv;
- priv = kzalloc_obj(*priv, GFP_KERNEL);
+ priv = kzalloc_obj(*priv);
if (!priv)
goto out_nomem;
INIT_LIST_HEAD(&priv->list);
@@ -501,7 +501,7 @@ static int gntalloc_mmap(struct file *filp, struct vm_area_struct *vma)
return -EINVAL;
}
- vm_priv = kmalloc_obj(*vm_priv, GFP_KERNEL);
+ vm_priv = kmalloc_obj(*vm_priv);
if (!vm_priv)
return -ENOMEM;
diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c
index 649d3a912d20..4a6f4325ad04 100644
--- a/drivers/xen/gntdev-dmabuf.c
+++ b/drivers/xen/gntdev-dmabuf.c
@@ -95,7 +95,7 @@ dmabuf_exp_wait_obj_new(struct gntdev_dmabuf_priv *priv,
{
struct gntdev_dmabuf_wait_obj *obj;
- obj = kzalloc_obj(*obj, GFP_KERNEL);
+ obj = kzalloc_obj(*obj);
if (!obj)
return ERR_PTR(-ENOMEM);
@@ -198,7 +198,7 @@ dmabuf_pages_to_sgt(struct page **pages, unsigned int nr_pages)
struct sg_table *sgt;
int ret;
- sgt = kmalloc_obj(*sgt, GFP_KERNEL);
+ sgt = kmalloc_obj(*sgt);
if (!sgt) {
ret = -ENOMEM;
goto out;
@@ -222,7 +222,7 @@ static int dmabuf_exp_ops_attach(struct dma_buf *dma_buf,
{
struct gntdev_dmabuf_attachment *gntdev_dmabuf_attach;
- gntdev_dmabuf_attach = kzalloc_obj(*gntdev_dmabuf_attach, GFP_KERNEL);
+ gntdev_dmabuf_attach = kzalloc_obj(*gntdev_dmabuf_attach);
if (!gntdev_dmabuf_attach)
return -ENOMEM;
@@ -362,7 +362,7 @@ static int dmabuf_exp_from_pages(struct gntdev_dmabuf_export_args *args)
if (ret < 0)
return ret;
- gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf, GFP_KERNEL);
+ gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf);
if (!gntdev_dmabuf)
return -ENOMEM;
@@ -530,7 +530,7 @@ static struct gntdev_dmabuf *dmabuf_imp_alloc_storage(int count)
struct gntdev_dmabuf *gntdev_dmabuf;
int i;
- gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf, GFP_KERNEL);
+ gntdev_dmabuf = kzalloc_obj(*gntdev_dmabuf);
if (!gntdev_dmabuf)
goto fail_no_free;
@@ -816,7 +816,7 @@ struct gntdev_dmabuf_priv *gntdev_dmabuf_init(struct file *filp)
{
struct gntdev_dmabuf_priv *priv;
- priv = kzalloc_obj(*priv, GFP_KERNEL);
+ priv = kzalloc_obj(*priv);
if (!priv)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 1a986cb7324a..a16e21d2ca91 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -141,16 +141,16 @@ struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count,
struct gntdev_grant_map *add;
int i;
- add = kzalloc_obj(*add, GFP_KERNEL);
+ add = kzalloc_obj(*add);
if (NULL == add)
return NULL;
- add->grants = kvmalloc_objs(add->grants[0], count, GFP_KERNEL);
- add->map_ops = kvmalloc_objs(add->map_ops[0], count, GFP_KERNEL);
- add->unmap_ops = kvmalloc_objs(add->unmap_ops[0], count, GFP_KERNEL);
- add->pages = kvzalloc_objs(add->pages[0], count, GFP_KERNEL);
+ add->grants = kvmalloc_objs(add->grants[0], count);
+ add->map_ops = kvmalloc_objs(add->map_ops[0], count);
+ add->unmap_ops = kvmalloc_objs(add->unmap_ops[0], count);
+ add->pages = kvzalloc_objs(add->pages[0], count);
add->being_removed =
- kvzalloc_objs(add->being_removed[0], count, GFP_KERNEL);
+ kvzalloc_objs(add->being_removed[0], count);
if (NULL == add->grants ||
NULL == add->map_ops ||
NULL == add->unmap_ops ||
@@ -176,7 +176,7 @@ struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count,
if (dma_flags & (GNTDEV_DMA_FLAG_WC | GNTDEV_DMA_FLAG_COHERENT)) {
struct gnttab_dma_alloc_args args;
- add->frames = kvzalloc_objs(add->frames[0], count, GFP_KERNEL);
+ add->frames = kvzalloc_objs(add->frames[0], count);
if (!add->frames)
goto err;
@@ -583,7 +583,7 @@ static int gntdev_open(struct inode *inode, struct file *flip)
{
struct gntdev_priv *priv;
- priv = kzalloc_obj(*priv, GFP_KERNEL);
+ priv = kzalloc_obj(*priv);
if (!priv)
return -ENOMEM;
@@ -968,7 +968,7 @@ static long gntdev_ioctl_grant_copy(struct gntdev_priv *priv, void __user *u)
mutex_lock(&priv->batch_lock);
if (!priv->batch) {
- batch = kmalloc_obj(*batch, GFP_KERNEL);
+ batch = kmalloc_obj(*batch);
} else {
batch = priv->batch;
priv->batch = batch->next;
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 6fcd5a7f6605..908d009f70fd 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -831,7 +831,7 @@ int gnttab_setup_auto_xlat_frames(phys_addr_t addr)
&addr);
return -ENOMEM;
}
- pfn = kzalloc_objs(pfn[0], max_nr_gframes, GFP_KERNEL);
+ pfn = kzalloc_objs(pfn[0], max_nr_gframes);
if (!pfn) {
memunmap(vaddr);
return -ENOMEM;
@@ -868,7 +868,7 @@ int gnttab_pages_set_private(int nr_pages, struct page **pages)
#if BITS_PER_LONG < 64
struct xen_page_foreign *foreign;
- foreign = kzalloc_obj(*foreign, GFP_KERNEL);
+ foreign = kzalloc_obj(*foreign);
if (!foreign)
return -ENOMEM;
diff --git a/drivers/xen/mcelog.c b/drivers/xen/mcelog.c
index ca8dbb9be419..53a8720f5cae 100644
--- a/drivers/xen/mcelog.c
+++ b/drivers/xen/mcelog.c
@@ -373,7 +373,7 @@ static int bind_virq_for_mce(void)
/* Fetch each CPU Physical Info for later reference*/
ncpus = mc_op.u.mc_physcpuinfo.ncpus;
- g_physinfo = kzalloc_objs(struct mcinfo_logical_cpu, ncpus, GFP_KERNEL);
+ g_physinfo = kzalloc_objs(struct mcinfo_logical_cpu, ncpus);
if (!g_physinfo)
return -ENOMEM;
set_xen_guest_handle(mc_op.u.mc_physcpuinfo.info, g_physinfo);
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
index 07e6b811c9d3..385d2587bd1b 100644
--- a/drivers/xen/pci.c
+++ b/drivers/xen/pci.c
@@ -336,7 +336,7 @@ int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain)
{
struct xen_device_domain_owner *owner;
- owner = kzalloc_obj(struct xen_device_domain_owner, GFP_KERNEL);
+ owner = kzalloc_obj(struct xen_device_domain_owner);
if (!owner)
return -ENODEV;
diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c
index 1d9f3874d099..0a20bb7c5438 100644
--- a/drivers/xen/pcpu.c
+++ b/drivers/xen/pcpu.c
@@ -247,7 +247,7 @@ static struct pcpu *create_and_register_pcpu(struct xenpf_pcpuinfo *info)
if (info->flags & XEN_PCPU_FLAGS_INVALID)
return ERR_PTR(-ENODEV);
- pcpu = kzalloc_obj(struct pcpu, GFP_KERNEL);
+ pcpu = kzalloc_obj(struct pcpu);
if (!pcpu)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/xen/privcmd-buf.c b/drivers/xen/privcmd-buf.c
index 95d2d5ca5e4f..c0178ea010cf 100644
--- a/drivers/xen/privcmd-buf.c
+++ b/drivers/xen/privcmd-buf.c
@@ -39,7 +39,7 @@ static int privcmd_buf_open(struct inode *ino, struct file *file)
{
struct privcmd_buf_private *file_priv;
- file_priv = kzalloc_obj(*file_priv, GFP_KERNEL);
+ file_priv = kzalloc_obj(*file_priv);
if (!file_priv)
return -ENOMEM;
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index a5d9211f36c3..1759cc18753f 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -433,7 +433,7 @@ static int alloc_empty_pages(struct vm_area_struct *vma, int numpgs)
int rc;
struct page **pages;
- pages = kvzalloc_objs(pages[0], numpgs, GFP_KERNEL);
+ pages = kvzalloc_objs(pages[0], numpgs);
if (pages == NULL)
return -ENOMEM;
@@ -653,7 +653,7 @@ static long privcmd_ioctl_dm_op(struct file *file, void __user *udata)
if (kdata.num > privcmd_dm_op_max_num)
return -E2BIG;
- kbufs = kzalloc_objs(*kbufs, kdata.num, GFP_KERNEL);
+ kbufs = kzalloc_objs(*kbufs, kdata.num);
if (!kbufs)
return -ENOMEM;
@@ -680,13 +680,13 @@ static long privcmd_ioctl_dm_op(struct file *file, void __user *udata)
PAGE_SIZE);
}
- pages = kzalloc_objs(*pages, nr_pages, GFP_KERNEL);
+ pages = kzalloc_objs(*pages, nr_pages);
if (!pages) {
rc = -ENOMEM;
goto out;
}
- xbufs = kzalloc_objs(*xbufs, kdata.num, GFP_KERNEL);
+ xbufs = kzalloc_objs(*xbufs, kdata.num);
if (!xbufs) {
rc = -ENOMEM;
goto out;
@@ -1355,7 +1355,7 @@ static int privcmd_ioeventfd_assign(struct privcmd_ioeventfd *ioeventfd)
if (!ioeventfd->vcpus || ioeventfd->vcpus > 4096)
return -EINVAL;
- kioeventfd = kzalloc_obj(*kioeventfd, GFP_KERNEL);
+ kioeventfd = kzalloc_obj(*kioeventfd);
if (!kioeventfd)
return -ENOMEM;
@@ -1563,7 +1563,7 @@ static long privcmd_ioctl(struct file *file,
static int privcmd_open(struct inode *ino, struct file *file)
{
- struct privcmd_data *data = kzalloc_obj(*data, GFP_KERNEL);
+ struct privcmd_data *data = kzalloc_obj(*data);
if (!data)
return -ENOMEM;
diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
index 8a5dafcaab03..ba62651a7f33 100644
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -324,7 +324,7 @@ static struct sock_mapping *pvcalls_new_active_socket(
struct sock_mapping *map;
void *page;
- map = kzalloc_obj(*map, GFP_KERNEL);
+ map = kzalloc_obj(*map);
if (map == NULL) {
sock_release(sock);
return NULL;
@@ -632,7 +632,7 @@ static int pvcalls_back_bind(struct xenbus_device *dev,
fedata = dev_get_drvdata(&dev->dev);
- map = kzalloc_obj(*map, GFP_KERNEL);
+ map = kzalloc_obj(*map);
if (map == NULL) {
ret = -ENOMEM;
goto out;
@@ -934,7 +934,7 @@ static int backend_connect(struct xenbus_device *dev)
grant_ref_t ring_ref;
struct pvcalls_fedata *fedata = NULL;
- fedata = kzalloc_obj(struct pvcalls_fedata, GFP_KERNEL);
+ fedata = kzalloc_obj(struct pvcalls_fedata);
if (!fedata)
return -ENOMEM;
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index c32fd69482e9..50ce4820f7ee 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -291,7 +291,7 @@ int pvcalls_front_socket(struct socket *sock)
}
bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
- map = kzalloc_obj(*map, GFP_KERNEL);
+ map = kzalloc_obj(*map);
if (map == NULL) {
pvcalls_exit();
return -ENOMEM;
@@ -820,7 +820,7 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock,
}
}
- map2 = kzalloc_obj(*map2, GFP_KERNEL);
+ map2 = kzalloc_obj(*map2);
if (map2 == NULL) {
clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
(void *)&map->passive.flags);
@@ -1179,7 +1179,7 @@ static int pvcalls_front_probe(struct xenbus_device *dev,
return -ENODEV;
pr_info("%s max-page-order is %u\n", __func__, max_page_order);
- bedata = kzalloc_obj(struct pvcalls_bedata, GFP_KERNEL);
+ bedata = kzalloc_obj(struct pvcalls_bedata);
if (!bedata)
return -ENOMEM;
diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index 25f4e1ff13f6..b1bb01ba82f8 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -182,7 +182,7 @@ static ssize_t compiler_show(struct hyp_sysfs_attr *attr, char *buffer)
int ret = -ENOMEM;
struct xen_compile_info *info;
- info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL);
+ info = kmalloc_obj(struct xen_compile_info);
if (info) {
ret = HYPERVISOR_xen_version(XENVER_compile_info, info);
if (!ret)
@@ -200,7 +200,7 @@ static ssize_t compiled_by_show(struct hyp_sysfs_attr *attr, char *buffer)
int ret = -ENOMEM;
struct xen_compile_info *info;
- info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL);
+ info = kmalloc_obj(struct xen_compile_info);
if (info) {
ret = HYPERVISOR_xen_version(XENVER_compile_info, info);
if (!ret)
@@ -218,7 +218,7 @@ static ssize_t compile_date_show(struct hyp_sysfs_attr *attr, char *buffer)
int ret = -ENOMEM;
struct xen_compile_info *info;
- info = kmalloc_obj(struct xen_compile_info, GFP_KERNEL);
+ info = kmalloc_obj(struct xen_compile_info);
if (info) {
ret = HYPERVISOR_xen_version(XENVER_compile_info, info);
if (!ret)
@@ -291,7 +291,7 @@ static ssize_t virtual_start_show(struct hyp_sysfs_attr *attr, char *buffer)
int ret = -ENOMEM;
struct xen_platform_parameters *parms;
- parms = kmalloc_obj(struct xen_platform_parameters, GFP_KERNEL);
+ parms = kmalloc_obj(struct xen_platform_parameters);
if (parms) {
ret = HYPERVISOR_xen_version(XENVER_platform_parameters,
parms);
diff --git a/drivers/xen/unpopulated-alloc.c b/drivers/xen/unpopulated-alloc.c
index 4cfb6abdc3d8..9cdabf18451e 100644
--- a/drivers/xen/unpopulated-alloc.c
+++ b/drivers/xen/unpopulated-alloc.c
@@ -43,7 +43,7 @@ static int fill_list(unsigned int nr_pages)
struct range mhp_range;
int ret;
- res = kzalloc_obj(*res, GFP_KERNEL);
+ res = kzalloc_obj(*res);
if (!res)
return -ENOMEM;
@@ -65,7 +65,7 @@ static int fill_list(unsigned int nr_pages)
* re-using it by someone else.
*/
if (target_resource != &iomem_resource) {
- tmp_res = kzalloc_obj(*tmp_res, GFP_KERNEL);
+ tmp_res = kzalloc_obj(*tmp_res);
if (!tmp_res) {
ret = -ENOMEM;
goto err_insert;
@@ -84,7 +84,7 @@ static int fill_list(unsigned int nr_pages)
}
}
- pgmap = kzalloc_obj(*pgmap, GFP_KERNEL);
+ pgmap = kzalloc_obj(*pgmap);
if (!pgmap) {
ret = -ENOMEM;
goto err_pgmap;
diff --git a/drivers/xen/xen-front-pgdir-shbuf.c b/drivers/xen/xen-front-pgdir-shbuf.c
index 32e28f044b33..f693b963a2e8 100644
--- a/drivers/xen/xen-front-pgdir-shbuf.c
+++ b/drivers/xen/xen-front-pgdir-shbuf.c
@@ -205,7 +205,7 @@ static int backend_unmap(struct xen_front_pgdir_shbuf *buf)
if (!buf->pages || !buf->backend_map_handles || !buf->grefs)
return 0;
- unmap_ops = kzalloc_objs(*unmap_ops, buf->num_pages, GFP_KERNEL);
+ unmap_ops = kzalloc_objs(*unmap_ops, buf->num_pages);
if (!unmap_ops)
return -ENOMEM;
@@ -249,7 +249,7 @@ static int backend_map(struct xen_front_pgdir_shbuf *buf)
unsigned char *ptr;
int ret, cur_gref, cur_dir_page, cur_page, grefs_left;
- map_ops = kzalloc_objs(*map_ops, buf->num_pages, GFP_KERNEL);
+ map_ops = kzalloc_objs(*map_ops, buf->num_pages);
if (!map_ops)
return -ENOMEM;
@@ -472,7 +472,7 @@ static int grant_references(struct xen_front_pgdir_shbuf *buf)
*/
static int alloc_storage(struct xen_front_pgdir_shbuf *buf)
{
- buf->grefs = kzalloc_objs(*buf->grefs, buf->num_grefs, GFP_KERNEL);
+ buf->grefs = kzalloc_objs(*buf->grefs, buf->num_grefs);
if (!buf->grefs)
return -ENOMEM;
diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c
index fbc40acd593f..a2ae8de6f9e2 100644
--- a/drivers/xen/xen-pciback/conf_space.c
+++ b/drivers/xen/xen-pciback/conf_space.c
@@ -401,7 +401,7 @@ int xen_pcibk_config_add_field_offset(struct pci_dev *dev,
struct config_field_entry *cfg_entry;
void *tmp;
- cfg_entry = kmalloc_obj(*cfg_entry, GFP_KERNEL);
+ cfg_entry = kmalloc_obj(*cfg_entry);
if (!cfg_entry) {
err = -ENOMEM;
goto out;
diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c
index 0efbd85cf7e1..8b50cbcbdfe1 100644
--- a/drivers/xen/xen-pciback/conf_space_header.c
+++ b/drivers/xen/xen-pciback/conf_space_header.c
@@ -33,7 +33,7 @@ struct pci_bar_info {
static void *command_init(struct pci_dev *dev, int offset)
{
- struct pci_cmd_info *cmd = kmalloc_obj(*cmd, GFP_KERNEL);
+ struct pci_cmd_info *cmd = kmalloc_obj(*cmd);
int err;
if (!cmd)
@@ -211,7 +211,7 @@ static void *bar_init(struct pci_dev *dev, int offset)
{
unsigned int pos;
const struct resource *res = dev->resource;
- struct pci_bar_info *bar = kzalloc_obj(*bar, GFP_KERNEL);
+ struct pci_bar_info *bar = kzalloc_obj(*bar);
if (!bar)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/xen/xen-pciback/conf_space_quirks.c b/drivers/xen/xen-pciback/conf_space_quirks.c
index 52c8d38cb434..675519b51287 100644
--- a/drivers/xen/xen-pciback/conf_space_quirks.c
+++ b/drivers/xen/xen-pciback/conf_space_quirks.c
@@ -97,7 +97,7 @@ int xen_pcibk_config_quirks_init(struct pci_dev *dev)
struct xen_pcibk_config_quirk *quirk;
int ret = 0;
- quirk = kzalloc_obj(*quirk, GFP_KERNEL);
+ quirk = kzalloc_obj(*quirk);
if (!quirk) {
ret = -ENOMEM;
goto out;
diff --git a/drivers/xen/xen-pciback/passthrough.c b/drivers/xen/xen-pciback/passthrough.c
index 9d2583a7a19a..7a6df524c071 100644
--- a/drivers/xen/xen-pciback/passthrough.c
+++ b/drivers/xen/xen-pciback/passthrough.c
@@ -51,7 +51,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
unsigned int domain, bus, devfn;
int err;
- dev_entry = kmalloc_obj(*dev_entry, GFP_KERNEL);
+ dev_entry = kmalloc_obj(*dev_entry);
if (!dev_entry)
return -ENOMEM;
dev_entry->dev = dev;
@@ -101,7 +101,7 @@ static int __xen_pcibk_init_devices(struct xen_pcibk_device *pdev)
{
struct passthrough_dev_data *dev_data;
- dev_data = kmalloc_obj(*dev_data, GFP_KERNEL);
+ dev_data = kmalloc_obj(*dev_data);
if (!dev_data)
return -ENOMEM;
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index ffc70ce61c8f..e4b27aecbf05 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -79,7 +79,7 @@ static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
dev_dbg(&dev->dev, "pcistub_device_alloc\n");
- psdev = kzalloc_obj(*psdev, GFP_KERNEL);
+ psdev = kzalloc_obj(*psdev);
if (!psdev)
return NULL;
@@ -623,7 +623,7 @@ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id)
}
if (!match) {
- pci_dev_id = kmalloc_obj(*pci_dev_id, GFP_KERNEL);
+ pci_dev_id = kmalloc_obj(*pci_dev_id);
if (!pci_dev_id) {
err = -ENOMEM;
goto out;
@@ -1129,7 +1129,7 @@ static int pcistub_device_id_add(int domain, int bus, int slot, int func)
|| PCI_FUNC(devfn) != func)
return -EINVAL;
- pci_dev_id = kmalloc_obj(*pci_dev_id, GFP_KERNEL);
+ pci_dev_id = kmalloc_obj(*pci_dev_id);
if (!pci_dev_id)
return -ENOMEM;
@@ -1189,7 +1189,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func,
}
dev = psdev->dev;
- field = kzalloc_obj(*field, GFP_KERNEL);
+ field = kzalloc_obj(*field);
if (!field) {
err = -ENOMEM;
goto out;
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index 2755ab0b0d85..bfc186bf05bc 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -219,7 +219,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
if (dev->msi_enabled || !(cmd & PCI_COMMAND_MEMORY))
return -ENXIO;
- entries = kmalloc_objs(*entries, op->value, GFP_KERNEL);
+ entries = kmalloc_objs(*entries, op->value);
if (entries == NULL)
return -ENOMEM;
diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c
index 391ea1040b16..df292c19effb 100644
--- a/drivers/xen/xen-pciback/vpci.c
+++ b/drivers/xen/xen-pciback/vpci.c
@@ -81,7 +81,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
goto out;
}
- dev_entry = kmalloc_obj(*dev_entry, GFP_KERNEL);
+ dev_entry = kmalloc_obj(*dev_entry);
if (!dev_entry) {
err = -ENOMEM;
xenbus_dev_fatal(pdev->xdev, err,
@@ -186,7 +186,7 @@ static int __xen_pcibk_init_devices(struct xen_pcibk_device *pdev)
int slot;
struct vpci_dev_data *vpci_dev;
- vpci_dev = kmalloc_obj(*vpci_dev, GFP_KERNEL);
+ vpci_dev = kmalloc_obj(*vpci_dev);
if (!vpci_dev)
return -ENOMEM;
diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c
index d5e001ff0489..22ff9cf35fc4 100644
--- a/drivers/xen/xen-pciback/xenbus.c
+++ b/drivers/xen/xen-pciback/xenbus.c
@@ -38,7 +38,7 @@ static struct xen_pcibk_device *alloc_pdev(struct xenbus_device *xdev)
{
struct xen_pcibk_device *pdev;
- pdev = kzalloc_obj(struct xen_pcibk_device, GFP_KERNEL);
+ pdev = kzalloc_obj(struct xen_pcibk_device);
if (pdev == NULL)
goto out;
dev_dbg(&xdev->dev, "allocated pdev @ 0x%p\n", pdev);
diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index 66758c72d5d1..dee1a05fdd44 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -974,7 +974,7 @@ static int scsiback_add_translation_entry(struct vscsibk_info *info,
return -ENODEV;
}
- new = kmalloc_obj(struct v2p_entry, GFP_KERNEL);
+ new = kmalloc_obj(struct v2p_entry);
if (new == NULL) {
err = -ENOMEM;
goto out_free;
@@ -1270,7 +1270,7 @@ static int scsiback_probe(struct xenbus_device *dev,
{
int err;
- struct vscsibk_info *info = kzalloc_obj(struct vscsibk_info, GFP_KERNEL);
+ struct vscsibk_info *info = kzalloc_obj(struct vscsibk_info);
pr_debug("%s %p %d\n", __func__, dev, dev->otherend_id);
@@ -1351,7 +1351,7 @@ scsiback_make_tport(struct target_fabric_configfs *tf,
u64 wwpn = 0;
int off = 0;
- tport = kzalloc_obj(struct scsiback_tport, GFP_KERNEL);
+ tport = kzalloc_obj(struct scsiback_tport);
if (!tport)
return ERR_PTR(-ENOMEM);
@@ -1531,7 +1531,7 @@ static int scsiback_make_nexus(struct scsiback_tpg *tpg,
goto out_unlock;
}
- tv_nexus = kzalloc_obj(struct scsiback_nexus, GFP_KERNEL);
+ tv_nexus = kzalloc_obj(struct scsiback_nexus);
if (!tv_nexus) {
ret = -ENOMEM;
goto out_unlock;
@@ -1758,7 +1758,7 @@ scsiback_make_tpg(struct se_wwn *wwn, const char *name)
if (ret)
return ERR_PTR(ret);
- tpg = kzalloc_obj(struct scsiback_tpg, GFP_KERNEL);
+ tpg = kzalloc_obj(struct scsiback_tpg);
if (!tpg)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
index 61739961838c..0ab1329e79de 100644
--- a/drivers/xen/xenbus/xenbus_client.c
+++ b/drivers/xen/xenbus/xenbus_client.c
@@ -535,11 +535,11 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs,
if (nr_grefs > XENBUS_MAX_RING_GRANTS)
return -EINVAL;
- info = kzalloc_obj(*info, GFP_KERNEL);
+ info = kzalloc_obj(*info);
if (!info)
return -ENOMEM;
- info->node = kzalloc_obj(*info->node, GFP_KERNEL);
+ info->node = kzalloc_obj(*info->node);
if (!info->node)
err = -ENOMEM;
else
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
index 7b37d80b82ed..417631350eb0 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -242,7 +242,7 @@ static struct watch_adapter *alloc_watch_adapter(const char *path,
{
struct watch_adapter *watch;
- watch = kzalloc_obj(*watch, GFP_KERNEL);
+ watch = kzalloc_obj(*watch);
if (watch == NULL)
goto out_fail;
@@ -454,7 +454,7 @@ static int xenbus_write_transaction(unsigned msg_type,
} *msg = (void *)u->u.buffer;
if (msg_type == XS_TRANSACTION_START) {
- trans = kzalloc_obj(*trans, GFP_KERNEL);
+ trans = kzalloc_obj(*trans);
if (!trans) {
rc = -ENOMEM;
goto out;
@@ -655,7 +655,7 @@ static int xenbus_file_open(struct inode *inode, struct file *filp)
stream_open(inode, filp);
- u = kzalloc_obj(*u, GFP_KERNEL);
+ u = kzalloc_obj(*u);
if (u == NULL)
return -ENOMEM;
diff --git a/drivers/xen/xlate_mmu.c b/drivers/xen/xlate_mmu.c
index b40ec40eb9a2..8efd7b55223f 100644
--- a/drivers/xen/xlate_mmu.c
+++ b/drivers/xen/xlate_mmu.c
@@ -223,11 +223,11 @@ int __init xen_xlate_map_ballooned_pages(xen_pfn_t **gfns, void **virt,
BUG_ON(nr_grant_frames == 0);
nr_pages = DIV_ROUND_UP(nr_grant_frames, XEN_PFN_PER_PAGE);
- pages = kzalloc_objs(pages[0], nr_pages, GFP_KERNEL);
+ pages = kzalloc_objs(pages[0], nr_pages);
if (!pages)
return -ENOMEM;
- pfns = kzalloc_objs(pfns[0], nr_grant_frames, GFP_KERNEL);
+ pfns = kzalloc_objs(pfns[0], nr_grant_frames);
if (!pfns) {
kfree(pages);
return -ENOMEM;