summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 16:37:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:09:51 -0800
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/infiniband/core
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/infiniband/core')
-rw-r--r--drivers/infiniband/core/addr.c2
-rw-r--r--drivers/infiniband/core/agent.c2
-rw-r--r--drivers/infiniband/core/cache.c8
-rw-r--r--drivers/infiniband/core/cm.c6
-rw-r--r--drivers/infiniband/core/cma.c30
-rw-r--r--drivers/infiniband/core/cma_configfs.c4
-rw-r--r--drivers/infiniband/core/cq.c4
-rw-r--r--drivers/infiniband/core/device.c2
-rw-r--r--drivers/infiniband/core/ib_core_uverbs.c2
-rw-r--r--drivers/infiniband/core/iwcm.c4
-rw-r--r--drivers/infiniband/core/iwpm_util.c2
-rw-r--r--drivers/infiniband/core/mad.c8
-rw-r--r--drivers/infiniband/core/mad_rmpp.c2
-rw-r--r--drivers/infiniband/core/restrack.c2
-rw-r--r--drivers/infiniband/core/rw.c8
-rw-r--r--drivers/infiniband/core/sa_query.c6
-rw-r--r--drivers/infiniband/core/security.c6
-rw-r--r--drivers/infiniband/core/sysfs.c6
-rw-r--r--drivers/infiniband/core/ucaps.c2
-rw-r--r--drivers/infiniband/core/ucma.c10
-rw-r--r--drivers/infiniband/core/umem.c2
-rw-r--r--drivers/infiniband/core/umem_dmabuf.c2
-rw-r--r--drivers/infiniband/core/umem_odp.c6
-rw-r--r--drivers/infiniband/core/user_mad.c4
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c18
-rw-r--r--drivers/infiniband/core/uverbs_main.c6
-rw-r--r--drivers/infiniband/core/uverbs_uapi.c2
-rw-r--r--drivers/infiniband/core/verbs.c4
28 files changed, 80 insertions, 80 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 0764d71a9dd5..866746695712 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -646,7 +646,7 @@ int rdma_resolve_ip(struct sockaddr *src_addr, const struct sockaddr *dst_addr,
struct addr_req *req;
int ret = 0;
- req = kzalloc_obj(*req, GFP_KERNEL);
+ req = kzalloc_obj(*req);
if (!req)
return -ENOMEM;
diff --git a/drivers/infiniband/core/agent.c b/drivers/infiniband/core/agent.c
index 8b889cb85c59..7847ede210bf 100644
--- a/drivers/infiniband/core/agent.c
+++ b/drivers/infiniband/core/agent.c
@@ -162,7 +162,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
int ret;
/* Create new device info */
- port_priv = kzalloc_obj(*port_priv, GFP_KERNEL);
+ port_priv = kzalloc_obj(*port_priv);
if (!port_priv) {
ret = -ENOMEM;
goto error1;
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index c3d542187129..c066befec91b 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -296,7 +296,7 @@ alloc_gid_entry(const struct ib_gid_attr *attr)
struct ib_gid_table_entry *entry;
struct net_device *ndev;
- entry = kzalloc_obj(*entry, GFP_KERNEL);
+ entry = kzalloc_obj(*entry);
if (!entry)
return NULL;
@@ -771,12 +771,12 @@ const struct ib_gid_attr *rdma_find_gid_by_filter(
static struct ib_gid_table *alloc_gid_table(int sz)
{
- struct ib_gid_table *table = kzalloc_obj(*table, GFP_KERNEL);
+ struct ib_gid_table *table = kzalloc_obj(*table);
if (!table)
return NULL;
- table->data_vec = kzalloc_objs(*table->data_vec, sz, GFP_KERNEL);
+ table->data_vec = kzalloc_objs(*table->data_vec, sz);
if (!table->data_vec)
goto err_free_table;
@@ -1452,7 +1452,7 @@ ib_cache_update(struct ib_device *device, u32 port, bool update_gids,
if (!rdma_is_port_valid(device, port))
return -EINVAL;
- tprops = kmalloc_obj(*tprops, GFP_KERNEL);
+ tprops = kmalloc_obj(*tprops);
if (!tprops)
return -ENOMEM;
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index c2fb11197d02..9cc26c9d1e47 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -827,7 +827,7 @@ static struct cm_id_private *cm_alloc_id_priv(struct ib_device *device,
u32 id;
int ret;
- cm_id_priv = kzalloc_obj(*cm_id_priv, GFP_KERNEL);
+ cm_id_priv = kzalloc_obj(*cm_id_priv);
if (!cm_id_priv)
return ERR_PTR(-ENOMEM);
@@ -976,7 +976,7 @@ static struct cm_timewait_info *cm_create_timewait_info(__be32 local_id)
{
struct cm_timewait_info *timewait_info;
- timewait_info = kzalloc_obj(*timewait_info, GFP_KERNEL);
+ timewait_info = kzalloc_obj(*timewait_info);
if (!timewait_info)
return ERR_PTR(-ENOMEM);
@@ -4366,7 +4366,7 @@ static int cm_add_one(struct ib_device *ib_device)
if (!rdma_cap_ib_cm(ib_device, i))
continue;
- port = kzalloc_obj(*port, GFP_KERNEL);
+ port = kzalloc_obj(*port);
if (!port) {
ret = -ENOMEM;
goto error1;
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index e4bd705cc046..df6f34d5e041 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -490,7 +490,7 @@ static int cma_add_id_to_tree(struct rdma_id_private *node_id_priv)
unsigned long flags;
int result;
- node = kzalloc_obj(*node, GFP_KERNEL);
+ node = kzalloc_obj(*node);
if (!node)
return -ENOMEM;
@@ -1013,7 +1013,7 @@ __rdma_create_id(struct net *net, rdma_cm_event_handler event_handler,
{
struct rdma_id_private *id_priv;
- id_priv = kzalloc_obj(*id_priv, GFP_KERNEL);
+ id_priv = kzalloc_obj(*id_priv);
if (!id_priv)
return ERR_PTR(-ENOMEM);
@@ -3083,14 +3083,14 @@ static int cma_resolve_ib_route(struct rdma_id_private *id_priv,
struct cma_work *work;
int ret;
- work = kzalloc_obj(*work, GFP_KERNEL);
+ work = kzalloc_obj(*work);
if (!work)
return -ENOMEM;
cma_init_resolve_route_work(work, id_priv);
if (!route->path_rec)
- route->path_rec = kmalloc_obj(*route->path_rec, GFP_KERNEL);
+ route->path_rec = kmalloc_obj(*route->path_rec);
if (!route->path_rec) {
ret = -ENOMEM;
goto err1;
@@ -3204,7 +3204,7 @@ static int cma_resolve_iw_route(struct rdma_id_private *id_priv)
{
struct cma_work *work;
- work = kzalloc_obj(*work, GFP_KERNEL);
+ work = kzalloc_obj(*work);
if (!work)
return -ENOMEM;
@@ -3311,11 +3311,11 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
tos = id_priv->tos_set ? id_priv->tos : default_roce_tos;
mutex_unlock(&id_priv->qp_mutex);
- work = kzalloc_obj(*work, GFP_KERNEL);
+ work = kzalloc_obj(*work);
if (!work)
return -ENOMEM;
- route->path_rec = kzalloc_obj(*route->path_rec, GFP_KERNEL);
+ route->path_rec = kzalloc_obj(*route->path_rec);
if (!route->path_rec) {
ret = -ENOMEM;
goto err1;
@@ -3560,7 +3560,7 @@ static int cma_resolve_loopback(struct rdma_id_private *id_priv)
union ib_gid gid;
int ret;
- work = kzalloc_obj(*work, GFP_KERNEL);
+ work = kzalloc_obj(*work);
if (!work)
return -ENOMEM;
@@ -3585,7 +3585,7 @@ static int cma_resolve_ib_addr(struct rdma_id_private *id_priv)
struct cma_work *work;
int ret;
- work = kzalloc_obj(*work, GFP_KERNEL);
+ work = kzalloc_obj(*work);
if (!work)
return -ENOMEM;
@@ -3685,7 +3685,7 @@ static int cma_alloc_port(enum rdma_ucm_port_space ps,
lockdep_assert_held(&lock);
- bind_list = kzalloc_obj(*bind_list, GFP_KERNEL);
+ bind_list = kzalloc_obj(*bind_list);
if (!bind_list)
return -ENOMEM;
@@ -5100,7 +5100,7 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
if (id_priv->id.qp_type != IB_QPT_UD)
return -EINVAL;
- mc = kzalloc_obj(*mc, GFP_KERNEL);
+ mc = kzalloc_obj(*mc);
if (!mc)
return -ENOMEM;
@@ -5166,7 +5166,7 @@ static int cma_netdev_change(struct net_device *ndev, struct rdma_id_private *id
memcmp(dev_addr->src_dev_addr, ndev->dev_addr, ndev->addr_len)) {
pr_info("RDMA CM addr change for ndev %s used by id %p\n",
ndev->name, &id_priv->id);
- work = kzalloc_obj(*work, GFP_KERNEL);
+ work = kzalloc_obj(*work);
if (!work)
return -ENOMEM;
@@ -5373,7 +5373,7 @@ static int cma_add_one(struct ib_device *device)
if (!cma_supported(device))
return -EOPNOTSUPP;
- cma_dev = kmalloc_obj(*cma_dev, GFP_KERNEL);
+ cma_dev = kmalloc_obj(*cma_dev);
if (!cma_dev)
return -ENOMEM;
@@ -5570,7 +5570,7 @@ static void cma_query_ib_service_handler(int status,
}
id_priv->id.route.service_recs =
- kmalloc_objs(*recs, num_recs, GFP_KERNEL);
+ kmalloc_objs(*recs, num_recs);
if (!id_priv->id.route.service_recs) {
status = -ENOMEM;
goto fail;
@@ -5610,7 +5610,7 @@ static int cma_resolve_ib_service(struct rdma_id_private *id_priv,
ib_sa_comp_mask mask = 0;
struct cma_work *work;
- work = kzalloc_obj(*work, GFP_KERNEL);
+ work = kzalloc_obj(*work);
if (!work)
return -ENOMEM;
diff --git a/drivers/infiniband/core/cma_configfs.c b/drivers/infiniband/core/cma_configfs.c
index a914edb8ffef..819927ce4f0e 100644
--- a/drivers/infiniband/core/cma_configfs.c
+++ b/drivers/infiniband/core/cma_configfs.c
@@ -210,7 +210,7 @@ static int make_cma_ports(struct cma_dev_group *cma_dev_group,
return -ENODEV;
ports_num = ibdev->phys_port_cnt;
- ports = kzalloc_objs(*cma_dev_group->ports, ports_num, GFP_KERNEL);
+ ports = kzalloc_objs(*cma_dev_group->ports, ports_num);
if (!ports)
return -ENOMEM;
@@ -284,7 +284,7 @@ static struct config_group *make_cma_dev(struct config_group *group,
if (!cma_dev)
goto fail;
- cma_dev_group = kzalloc_obj(*cma_dev_group, GFP_KERNEL);
+ cma_dev_group = kzalloc_obj(*cma_dev_group);
if (!cma_dev_group) {
err = -ENOMEM;
diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c
index ffe357d01dce..81316228f614 100644
--- a/drivers/infiniband/core/cq.c
+++ b/drivers/infiniband/core/cq.c
@@ -58,7 +58,7 @@ static void rdma_dim_init(struct ib_cq *cq)
cq->poll_ctx == IB_POLL_DIRECT)
return;
- dim = kzalloc_obj(struct dim, GFP_KERNEL);
+ dim = kzalloc_obj(struct dim);
if (!dim)
return;
@@ -230,7 +230,7 @@ struct ib_cq *__ib_alloc_cq(struct ib_device *dev, void *private, int nr_cqe,
atomic_set(&cq->usecnt, 0);
cq->comp_vector = comp_vector;
- cq->wc = kmalloc_objs(*cq->wc, IB_POLL_BATCH, GFP_KERNEL);
+ cq->wc = kmalloc_objs(*cq->wc, IB_POLL_BATCH);
if (!cq->wc)
goto out_free_cq;
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 8d50ee81a6d1..358ffe6756a4 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -957,7 +957,7 @@ static int add_one_compat_dev(struct ib_device *device,
if (ret)
goto done;
- cdev = kzalloc_obj(*cdev, GFP_KERNEL);
+ cdev = kzalloc_obj(*cdev);
if (!cdev) {
ret = -ENOMEM;
goto cdev_err;
diff --git a/drivers/infiniband/core/ib_core_uverbs.c b/drivers/infiniband/core/ib_core_uverbs.c
index 9e26868e50b6..d3836a62a004 100644
--- a/drivers/infiniband/core/ib_core_uverbs.c
+++ b/drivers/infiniband/core/ib_core_uverbs.c
@@ -87,7 +87,7 @@ int rdma_user_mmap_io(struct ib_ucontext *ucontext, struct vm_area_struct *vma,
return -EINVAL;
lockdep_assert_held(&ufile->device->disassociate_srcu);
- priv = kzalloc_obj(*priv, GFP_KERNEL);
+ priv = kzalloc_obj(*priv);
if (!priv)
return -ENOMEM;
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index 73e6849140fb..9761d9365ffd 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -171,7 +171,7 @@ static int alloc_work_entries(struct iwcm_id_private *cm_id_priv, int count)
BUG_ON(!list_empty(&cm_id_priv->work_free_list));
while (count--) {
- work = kmalloc_obj(struct iwcm_work, GFP_KERNEL);
+ work = kmalloc_obj(struct iwcm_work);
if (!work) {
dealloc_work_entries(cm_id_priv);
return -ENOMEM;
@@ -242,7 +242,7 @@ struct iw_cm_id *iw_create_cm_id(struct ib_device *device,
{
struct iwcm_id_private *cm_id_priv;
- cm_id_priv = kzalloc_obj(*cm_id_priv, GFP_KERNEL);
+ cm_id_priv = kzalloc_obj(*cm_id_priv);
if (!cm_id_priv)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c
index 96c707a49a71..7817b7dab7f9 100644
--- a/drivers/infiniband/core/iwpm_util.c
+++ b/drivers/infiniband/core/iwpm_util.c
@@ -113,7 +113,7 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr,
unsigned long flags;
int ret = -EINVAL;
- map_info = kzalloc_obj(struct iwpm_mapping_info, GFP_KERNEL);
+ map_info = kzalloc_obj(struct iwpm_mapping_info);
if (!map_info)
return -ENOMEM;
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index a2b2cd4f8e0a..8d19613179e3 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -386,7 +386,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
}
/* Allocate structures */
- mad_agent_priv = kzalloc_obj(*mad_agent_priv, GFP_KERNEL);
+ mad_agent_priv = kzalloc_obj(*mad_agent_priv);
if (!mad_agent_priv) {
ret = ERR_PTR(-ENOMEM);
goto error1;
@@ -2612,7 +2612,7 @@ static bool ib_mad_send_error(struct ib_mad_port_private *port_priv,
struct ib_qp_attr *attr;
/* Transition QP to RTS and fail offending send */
- attr = kmalloc_obj(*attr, GFP_KERNEL);
+ attr = kmalloc_obj(*attr);
if (attr) {
attr->qp_state = IB_QPS_RTS;
attr->cur_qp_state = IB_QPS_SQE;
@@ -3042,7 +3042,7 @@ static int ib_mad_port_start(struct ib_mad_port_private *port_priv)
struct ib_qp *qp;
u16 pkey_index;
- attr = kmalloc_obj(*attr, GFP_KERNEL);
+ attr = kmalloc_obj(*attr);
if (!attr)
return -ENOMEM;
@@ -3207,7 +3207,7 @@ static int ib_mad_port_open(struct ib_device *device,
return -EFAULT;
/* Create new device info */
- port_priv = kzalloc_obj(*port_priv, GFP_KERNEL);
+ port_priv = kzalloc_obj(*port_priv);
if (!port_priv)
return -ENOMEM;
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c
index 7d577d26f3eb..17c4c52a19e4 100644
--- a/drivers/infiniband/core/mad_rmpp.c
+++ b/drivers/infiniband/core/mad_rmpp.c
@@ -279,7 +279,7 @@ create_rmpp_recv(struct ib_mad_agent_private *agent,
struct mad_rmpp_recv *rmpp_recv;
struct ib_mad_hdr *mad_hdr;
- rmpp_recv = kmalloc_obj(*rmpp_recv, GFP_KERNEL);
+ rmpp_recv = kmalloc_obj(*rmpp_recv);
if (!rmpp_recv)
return NULL;
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
index 87a9ac4bf987..ac3688952cab 100644
--- a/drivers/infiniband/core/restrack.c
+++ b/drivers/infiniband/core/restrack.c
@@ -25,7 +25,7 @@ int rdma_restrack_init(struct ib_device *dev)
struct rdma_restrack_root *rt;
int i;
- dev->res = kzalloc_objs(*rt, RDMA_RESTRACK_MAX, GFP_KERNEL);
+ dev->res = kzalloc_objs(*rt, RDMA_RESTRACK_MAX);
if (!dev->res)
return -ENOMEM;
diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
index 71345ccf1bf8..5a3092abb4e6 100644
--- a/drivers/infiniband/core/rw.c
+++ b/drivers/infiniband/core/rw.c
@@ -162,7 +162,7 @@ static int rdma_rw_init_mr_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
int i, j, ret = 0, count = 0;
ctx->nr_ops = DIV_ROUND_UP(sg_cnt, pages_per_mr);
- ctx->reg = kzalloc_objs(*ctx->reg, ctx->nr_ops, GFP_KERNEL);
+ ctx->reg = kzalloc_objs(*ctx->reg, ctx->nr_ops);
if (!ctx->reg) {
ret = -ENOMEM;
goto out;
@@ -297,11 +297,11 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
ctx->nr_ops = DIV_ROUND_UP(sg_cnt, max_sge);
- ctx->map.sges = sge = kzalloc_objs(*sge, sg_cnt, GFP_KERNEL);
+ ctx->map.sges = sge = kzalloc_objs(*sge, sg_cnt);
if (!ctx->map.sges)
goto out;
- ctx->map.wrs = kzalloc_objs(*ctx->map.wrs, ctx->nr_ops, GFP_KERNEL);
+ ctx->map.wrs = kzalloc_objs(*ctx->map.wrs, ctx->nr_ops);
if (!ctx->map.wrs)
goto out_free_sges;
@@ -756,7 +756,7 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
ctx->type = RDMA_RW_SIG_MR;
ctx->nr_ops = 1;
- ctx->reg = kzalloc_obj(*ctx->reg, GFP_KERNEL);
+ ctx->reg = kzalloc_obj(*ctx->reg);
if (!ctx->reg) {
ret = -ENOMEM;
goto out_unmap_prot_sg;
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index cbea6fdd0e75..dbd452efe7aa 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -1607,7 +1607,7 @@ static void ib_sa_service_rec_callback(struct ib_sa_query *sa_query, int status,
return;
}
- rec = kmalloc_objs(*rec, num_services, GFP_KERNEL);
+ rec = kmalloc_objs(*rec, num_services);
if (!rec) {
query->callback(-ENOMEM, NULL, 0, query->context);
return;
@@ -2188,7 +2188,7 @@ static void update_ib_cpi(struct work_struct *work)
}
spin_unlock_irqrestore(&port->classport_lock, flags);
- cb_context = kmalloc_obj(*cb_context, GFP_KERNEL);
+ cb_context = kmalloc_obj(*cb_context);
if (!cb_context)
goto err_nomem;
@@ -2306,7 +2306,7 @@ static void update_sm_ah(struct work_struct *work)
return;
}
- new_ah = kmalloc_obj(*new_ah, GFP_KERNEL);
+ new_ah = kmalloc_obj(*new_ah);
if (!new_ah)
return;
diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c
index deccd7b7eb51..9af31d1d9d70 100644
--- a/drivers/infiniband/core/security.c
+++ b/drivers/infiniband/core/security.c
@@ -258,7 +258,7 @@ static int port_pkey_list_insert(struct ib_port_pkey *pp)
if (!pkey) {
bool found = false;
- pkey = kzalloc_obj(*pkey, GFP_KERNEL);
+ pkey = kzalloc_obj(*pkey);
if (!pkey)
return -ENOMEM;
@@ -335,7 +335,7 @@ static struct ib_ports_pkeys *get_new_pps(const struct ib_qp *qp,
struct ib_ports_pkeys *new_pps;
struct ib_ports_pkeys *qp_pps = qp->qp_sec->ports_pkeys;
- new_pps = kzalloc_obj(*new_pps, GFP_KERNEL);
+ new_pps = kzalloc_obj(*new_pps);
if (!new_pps)
return NULL;
@@ -428,7 +428,7 @@ int ib_create_qp_security(struct ib_qp *qp, struct ib_device *dev)
if (!is_ib)
return 0;
- qp->qp_sec = kzalloc_obj(*qp->qp_sec, GFP_KERNEL);
+ qp->qp_sec = kzalloc_obj(*qp->qp_sec);
if (!qp->qp_sec)
return -ENOMEM;
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index c2becb0b39a2..d55f6a98c456 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -515,8 +515,8 @@ static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr,
if (!dev->ops.process_mad)
return -ENOSYS;
- in_mad = kzalloc_obj(*in_mad, GFP_KERNEL);
- out_mad = kzalloc_obj(*out_mad, GFP_KERNEL);
+ in_mad = kzalloc_obj(*in_mad);
+ out_mad = kzalloc_obj(*out_mad);
if (!in_mad || !out_mad) {
ret = -ENOMEM;
goto out;
@@ -1054,7 +1054,7 @@ alloc_port_table_group(const char *name, struct attribute_group *group,
struct attribute **attr_list;
int i;
- attr_list = kzalloc_objs(*attr_list, num + 1, GFP_KERNEL);
+ attr_list = kzalloc_objs(*attr_list, num + 1);
if (!attr_list)
return -ENOMEM;
diff --git a/drivers/infiniband/core/ucaps.c b/drivers/infiniband/core/ucaps.c
index d5524f69b981..948093260dbd 100644
--- a/drivers/infiniband/core/ucaps.c
+++ b/drivers/infiniband/core/ucaps.c
@@ -160,7 +160,7 @@ int ib_create_ucap(enum rdma_user_cap type)
return 0;
}
- ucap = kzalloc_obj(*ucap, GFP_KERNEL);
+ ucap = kzalloc_obj(*ucap);
if (!ucap) {
ret = -ENOMEM;
goto unlock;
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index f84c6a02eaff..878561fa1cb5 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -195,7 +195,7 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file)
{
struct ucma_context *ctx;
- ctx = kzalloc_obj(*ctx, GFP_KERNEL);
+ ctx = kzalloc_obj(*ctx);
if (!ctx)
return NULL;
@@ -262,7 +262,7 @@ static struct ucma_event *ucma_create_uevent(struct ucma_context *ctx,
{
struct ucma_event *uevent;
- uevent = kzalloc_obj(*uevent, GFP_KERNEL);
+ uevent = kzalloc_obj(*uevent);
if (!uevent)
return NULL;
@@ -1529,7 +1529,7 @@ static ssize_t ucma_process_join(struct ucma_file *file,
if (IS_ERR(ctx))
return PTR_ERR(ctx);
- mc = kzalloc_obj(*mc, GFP_KERNEL);
+ mc = kzalloc_obj(*mc);
if (!mc) {
ret = -ENOMEM;
goto err_put_ctx;
@@ -1770,7 +1770,7 @@ static ssize_t ucma_write_cm_event(struct ucma_file *file,
event.status = cmd.status;
event.param.arg = cmd.param.arg;
- uevent = kzalloc_obj(*uevent, GFP_KERNEL);
+ uevent = kzalloc_obj(*uevent);
if (!uevent) {
ret = -ENOMEM;
goto out;
@@ -1885,7 +1885,7 @@ static int ucma_open(struct inode *inode, struct file *filp)
{
struct ucma_file *file;
- file = kmalloc_obj(*file, GFP_KERNEL);
+ file = kmalloc_obj(*file);
if (!file)
return -ENOMEM;
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index 8863fd1b85d8..cff4fcca2c34 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -189,7 +189,7 @@ struct ib_umem *ib_umem_get(struct ib_device *device, unsigned long addr,
if (access & IB_ACCESS_ON_DEMAND)
return ERR_PTR(-EOPNOTSUPP);
- umem = kzalloc_obj(*umem, GFP_KERNEL);
+ umem = kzalloc_obj(*umem);
if (!umem)
return ERR_PTR(-ENOMEM);
umem->ibdev = device;
diff --git a/drivers/infiniband/core/umem_dmabuf.c b/drivers/infiniband/core/umem_dmabuf.c
index dc35dbe18951..f5298c33e581 100644
--- a/drivers/infiniband/core/umem_dmabuf.c
+++ b/drivers/infiniband/core/umem_dmabuf.c
@@ -136,7 +136,7 @@ ib_umem_dmabuf_get_with_dma_device(struct ib_device *device,
if (dmabuf->size < end)
goto out_release_dmabuf;
- umem_dmabuf = kzalloc_obj(*umem_dmabuf, GFP_KERNEL);
+ umem_dmabuf = kzalloc_obj(*umem_dmabuf);
if (!umem_dmabuf) {
ret = ERR_PTR(-ENOMEM);
goto out_release_dmabuf;
diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c
index d14bd597a2b7..404fa1cc3254 100644
--- a/drivers/infiniband/core/umem_odp.c
+++ b/drivers/infiniband/core/umem_odp.c
@@ -140,7 +140,7 @@ struct ib_umem_odp *ib_umem_odp_alloc_implicit(struct ib_device *device,
if (access & IB_ACCESS_HUGETLB)
return ERR_PTR(-EINVAL);
- umem_odp = kzalloc_obj(*umem_odp, GFP_KERNEL);
+ umem_odp = kzalloc_obj(*umem_odp);
if (!umem_odp)
return ERR_PTR(-ENOMEM);
umem = &umem_odp->umem;
@@ -181,7 +181,7 @@ ib_umem_odp_alloc_child(struct ib_umem_odp *root, unsigned long addr,
if (WARN_ON(!root->is_implicit_odp))
return ERR_PTR(-EINVAL);
- odp_data = kzalloc_obj(*odp_data, GFP_KERNEL);
+ odp_data = kzalloc_obj(*odp_data);
if (!odp_data)
return ERR_PTR(-ENOMEM);
umem = &odp_data->umem;
@@ -241,7 +241,7 @@ struct ib_umem_odp *ib_umem_odp_get(struct ib_device *device,
if (WARN_ON_ONCE(!(access & IB_ACCESS_ON_DEMAND)))
return ERR_PTR(-EINVAL);
- umem_odp = kzalloc_obj(struct ib_umem_odp, GFP_KERNEL);
+ umem_odp = kzalloc_obj(struct ib_umem_odp);
if (!umem_odp)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 0ff2b7ba6b79..d9991d1f6e9a 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -247,7 +247,7 @@ static void recv_handler(struct ib_mad_agent *agent,
if (mad_recv_wc->wc->status != IB_WC_SUCCESS)
goto err1;
- packet = kzalloc_obj(*packet, GFP_KERNEL);
+ packet = kzalloc_obj(*packet);
if (!packet)
goto err1;
@@ -1018,7 +1018,7 @@ static int ib_umad_open(struct inode *inode, struct file *filp)
goto out;
}
- file = kzalloc_obj(*file, GFP_KERNEL);
+ file = kzalloc_obj(*file);
if (!file) {
ret = -ENOMEM;
goto out;
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 7aa7f1692c73..02abeed9c75d 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -510,7 +510,7 @@ static int xrcd_table_insert(struct ib_uverbs_device *dev,
struct rb_node **p = &dev->xrcd_tree.rb_node;
struct rb_node *parent = NULL;
- entry = kmalloc_obj(*entry, GFP_KERNEL);
+ entry = kmalloc_obj(*entry);
if (!entry)
return -ENOMEM;
@@ -1672,8 +1672,8 @@ static int ib_uverbs_query_qp(struct uverbs_attr_bundle *attrs)
if (ret)
return ret;
- attr = kmalloc_obj(*attr, GFP_KERNEL);
- init_attr = kmalloc_obj(*init_attr, GFP_KERNEL);
+ attr = kmalloc_obj(*attr);
+ init_attr = kmalloc_obj(*init_attr);
if (!attr || !init_attr) {
ret = -ENOMEM;
goto out;
@@ -1780,7 +1780,7 @@ static int modify_qp(struct uverbs_attr_bundle *attrs,
struct ib_qp *qp;
int ret;
- attr = kzalloc_obj(*attr, GFP_KERNEL);
+ attr = kzalloc_obj(*attr);
if (!attr)
return -ENOMEM;
@@ -2525,7 +2525,7 @@ static int ib_uverbs_attach_mcast(struct uverbs_attr_bundle *attrs)
goto out_put;
}
- mcast = kmalloc_obj(*mcast, GFP_KERNEL);
+ mcast = kmalloc_obj(*mcast);
if (!mcast) {
ret = -ENOMEM;
goto out_put;
@@ -2595,7 +2595,7 @@ struct ib_uflow_resources *flow_resources_alloc(size_t num_specs)
{
struct ib_uflow_resources *resources;
- resources = kzalloc_obj(*resources, GFP_KERNEL);
+ resources = kzalloc_obj(*resources);
if (!resources)
return NULL;
@@ -2604,9 +2604,9 @@ struct ib_uflow_resources *flow_resources_alloc(size_t num_specs)
goto out;
resources->counters =
- kzalloc_objs(*resources->counters, num_specs, GFP_KERNEL);
+ kzalloc_objs(*resources->counters, num_specs);
resources->collection =
- kzalloc_objs(*resources->collection, num_specs, GFP_KERNEL);
+ kzalloc_objs(*resources->collection, num_specs);
if (!resources->counters || !resources->collection)
goto err;
@@ -3116,7 +3116,7 @@ static int ib_uverbs_ex_create_rwq_ind_table(struct uverbs_attr_bundle *attrs)
if (err)
goto err_free;
- wqs = kzalloc_objs(*wqs, num_wq_handles, GFP_KERNEL);
+ wqs = kzalloc_objs(*wqs, num_wq_handles);
if (!wqs) {
err = -ENOMEM;
goto err_free;
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 2a3c8a5ead1c..7b68967a6301 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -737,7 +737,7 @@ static void rdma_umap_open(struct vm_area_struct *vma)
if (!ufile->ucontext)
goto out_unlock;
- priv = kzalloc_obj(*priv, GFP_KERNEL);
+ priv = kzalloc_obj(*priv);
if (!priv)
goto out_unlock;
rdma_umap_priv_init(priv, vma, opriv->entry);
@@ -966,7 +966,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp)
}
}
- file = kzalloc_obj(*file, GFP_KERNEL);
+ file = kzalloc_obj(*file);
if (!file) {
ret = -ENOMEM;
if (module_dependent)
@@ -1154,7 +1154,7 @@ static int ib_uverbs_add_one(struct ib_device *device)
device->type == RDMA_DEVICE_TYPE_SMI)
return -EOPNOTSUPP;
- uverbs_dev = kzalloc_obj(*uverbs_dev, GFP_KERNEL);
+ uverbs_dev = kzalloc_obj(*uverbs_dev);
if (!uverbs_dev)
return -ENOMEM;
diff --git a/drivers/infiniband/core/uverbs_uapi.c b/drivers/infiniband/core/uverbs_uapi.c
index 7e8b04658526..7ed69890d87a 100644
--- a/drivers/infiniband/core/uverbs_uapi.c
+++ b/drivers/infiniband/core/uverbs_uapi.c
@@ -648,7 +648,7 @@ struct uverbs_api *uverbs_alloc_api(struct ib_device *ibdev)
struct uverbs_api *uapi;
int rc;
- uapi = kzalloc_obj(*uapi, GFP_KERNEL);
+ uapi = kzalloc_obj(*uapi);
if (!uapi)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 2e98f1e2e53f..9b3d7088e3e1 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1186,7 +1186,7 @@ static struct ib_qp *__ib_open_qp(struct ib_qp *real_qp,
unsigned long flags;
int err;
- qp = kzalloc_obj(*qp, GFP_KERNEL);
+ qp = kzalloc_obj(*qp);
if (!qp)
return ERR_PTR(-ENOMEM);
@@ -2420,7 +2420,7 @@ struct ib_mr *ib_alloc_mr_integrity(struct ib_pd *pd,
goto out;
}
- sig_attrs = kzalloc_obj(struct ib_sig_attrs, GFP_KERNEL);
+ sig_attrs = kzalloc_obj(struct ib_sig_attrs);
if (!sig_attrs) {
mr = ERR_PTR(-ENOMEM);
goto out;