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/block | |
| 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/block')
26 files changed, 63 insertions, 63 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 9897dc9ae678..a4744a30a8af 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1699,17 +1699,17 @@ aoecmd_init(void) ncpus = num_online_cpus(); - iocq = kzalloc_objs(struct iocq_ktio, ncpus, GFP_KERNEL); + iocq = kzalloc_objs(struct iocq_ktio, ncpus); if (!iocq) return -ENOMEM; - kts = kzalloc_objs(struct ktstate, ncpus, GFP_KERNEL); + kts = kzalloc_objs(struct ktstate, ncpus); if (!kts) { ret = -ENOMEM; goto kts_fail; } - ktiowq = kzalloc_objs(wait_queue_head_t, ncpus, GFP_KERNEL); + ktiowq = kzalloc_objs(wait_queue_head_t, ncpus); if (!ktiowq) { ret = -ENOMEM; goto ktiowq_fail; diff --git a/drivers/block/brd.c b/drivers/block/brd.c index fe9b3b70f22d..00cc8122068f 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -272,7 +272,7 @@ static struct brd_device *brd_find_or_alloc_device(int i) } } - brd = kzalloc_obj(*brd, GFP_KERNEL); + brd = kzalloc_obj(*brd); if (!brd) { mutex_unlock(&brd_devices_mutex); return ERR_PTR(-ENOMEM); diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 2735ddb58b91..65ea6ec66bfd 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -434,7 +434,7 @@ int drbd_bm_init(struct drbd_device *device) { struct drbd_bitmap *b = device->bitmap; WARN_ON(b != NULL); - b = kzalloc_obj(struct drbd_bitmap, GFP_KERNEL); + b = kzalloc_obj(struct drbd_bitmap); if (!b) return -ENOMEM; spin_lock_init(&b->bm_lock); diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 64c545f5788c..b8f0eddf7e87 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2510,7 +2510,7 @@ struct drbd_resource *drbd_create_resource(const char *name) { struct drbd_resource *resource; - resource = kzalloc_obj(struct drbd_resource, GFP_KERNEL); + resource = kzalloc_obj(struct drbd_resource); if (!resource) goto fail; resource->name = kstrdup(name, GFP_KERNEL); @@ -2543,7 +2543,7 @@ struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts) struct drbd_resource *resource; struct drbd_connection *connection; - connection = kzalloc_obj(struct drbd_connection, GFP_KERNEL); + connection = kzalloc_obj(struct drbd_connection); if (!connection) return NULL; @@ -2552,7 +2552,7 @@ struct drbd_connection *conn_create(const char *name, struct res_opts *res_opts) if (drbd_alloc_socket(&connection->meta)) goto fail; - connection->current_epoch = kzalloc_obj(struct drbd_epoch, GFP_KERNEL); + connection->current_epoch = kzalloc_obj(struct drbd_epoch); if (!connection->current_epoch) goto fail; @@ -2666,7 +2666,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig return ERR_MINOR_OR_VOLUME_EXISTS; /* GFP_KERNEL, we are outside of all write-out paths */ - device = kzalloc_obj(struct drbd_device, GFP_KERNEL); + device = kzalloc_obj(struct drbd_device); if (!device) return ERR_NOMEM; kref_init(&device->kref); @@ -2725,7 +2725,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig INIT_LIST_HEAD(&device->peer_devices); INIT_LIST_HEAD(&device->pending_bitmap_io); for_each_connection(connection, resource) { - peer_device = kzalloc_obj(struct drbd_peer_device, GFP_KERNEL); + peer_device = kzalloc_obj(struct drbd_peer_device); if (!peer_device) goto out_idr_remove_from_resource; peer_device->connection = connection; diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index fbeb8061e549..e201f0087a0f 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -1536,7 +1536,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info) goto out; } - new_disk_conf = kmalloc_obj(struct disk_conf, GFP_KERNEL); + new_disk_conf = kmalloc_obj(struct disk_conf); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail; @@ -1785,14 +1785,14 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) atomic_set(&device->rs_pending_cnt, 0); /* allocation not in the IO path, drbdsetup context */ - nbc = kzalloc_obj(struct drbd_backing_dev, GFP_KERNEL); + nbc = kzalloc_obj(struct drbd_backing_dev); if (!nbc) { retcode = ERR_NOMEM; goto fail; } spin_lock_init(&nbc->md.uuid_lock); - new_disk_conf = kzalloc_obj(struct disk_conf, GFP_KERNEL); + new_disk_conf = kzalloc_obj(struct disk_conf); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail; @@ -2390,7 +2390,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) connection = adm_ctx.connection; mutex_lock(&adm_ctx.resource->adm_mutex); - new_net_conf = kzalloc_obj(struct net_conf, GFP_KERNEL); + new_net_conf = kzalloc_obj(struct net_conf); if (!new_net_conf) { retcode = ERR_NOMEM; goto out; @@ -2570,7 +2570,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) } /* allocation not in the IO path, drbdsetup / netlink process context */ - new_net_conf = kzalloc_obj(*new_net_conf, GFP_KERNEL); + new_net_conf = kzalloc_obj(*new_net_conf); if (!new_net_conf) { retcode = ERR_NOMEM; goto fail; @@ -2840,7 +2840,7 @@ int drbd_adm_resize(struct sk_buff *skb, struct genl_info *info) u_size = rcu_dereference(device->ldev->disk_conf)->disk_size; rcu_read_unlock(); if (u_size != (sector_t)rs.resize_size) { - new_disk_conf = kmalloc_obj(struct disk_conf, GFP_KERNEL); + new_disk_conf = kmalloc_obj(struct disk_conf); if (!new_disk_conf) { retcode = ERR_NOMEM; goto fail_ldev; diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 2545f949ce45..c2dd784bc14b 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3547,7 +3547,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in } } - new_net_conf = kmalloc_obj(struct net_conf, GFP_KERNEL); + new_net_conf = kmalloc_obj(struct net_conf); if (!new_net_conf) goto disconnect; @@ -3708,7 +3708,7 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i mutex_lock(&connection->resource->conf_update); old_net_conf = peer_device->connection->net_conf; if (get_ldev(device)) { - new_disk_conf = kzalloc_obj(struct disk_conf, GFP_KERNEL); + new_disk_conf = kzalloc_obj(struct disk_conf); if (!new_disk_conf) { put_ldev(device); mutex_unlock(&connection->resource->conf_update); @@ -3794,7 +3794,7 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i } if (verify_tfm || csums_tfm) { - new_net_conf = kzalloc_obj(struct net_conf, GFP_KERNEL); + new_net_conf = kzalloc_obj(struct net_conf); if (!new_net_conf) goto disconnect; diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 949bb4adc4bf..0000913f7efc 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -2009,7 +2009,7 @@ static int loop_add(int i) int err; err = -ENOMEM; - lo = kzalloc_obj(*lo, GFP_KERNEL); + lo = kzalloc_obj(*lo); if (!lo) goto out; lo->worker_tree = RB_ROOT; diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index d4993d7355dc..fe63f3c55d0d 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1274,7 +1274,7 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, goto put_socket; } - nsock = kzalloc_obj(*nsock, GFP_KERNEL); + nsock = kzalloc_obj(*nsock); if (!nsock) { err = -ENOMEM; goto put_socket; @@ -1322,7 +1322,7 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg) if (!sock) return err; - args = kzalloc_obj(*args, GFP_KERNEL); + args = kzalloc_obj(*args); if (!args) { sockfd_put(sock); return -ENOMEM; @@ -1510,7 +1510,7 @@ retry: for (i = 0; i < num_connections; i++) { struct recv_thread_args *args; - args = kzalloc_obj(*args, GFP_KERNEL); + args = kzalloc_obj(*args); if (!args) { sock_shutdown(nbd); /* @@ -1916,7 +1916,7 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs) struct gendisk *disk; int err = -ENOMEM; - nbd = kzalloc_obj(struct nbd_device, GFP_KERNEL); + nbd = kzalloc_obj(struct nbd_device); if (!nbd) goto out; diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 6eab18d814e5..f8c0fd57e041 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -778,7 +778,7 @@ static struct nullb_device *null_alloc_dev(void) { struct nullb_device *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return NULL; @@ -1818,7 +1818,7 @@ static int setup_queues(struct nullb *nullb) if (g_poll_queues) nqueues += g_poll_queues; - nullb->queues = kzalloc_objs(struct nullb_queue, nqueues, GFP_KERNEL); + nullb->queues = kzalloc_objs(struct nullb_queue, nqueues); if (!nullb->queues) return -ENOMEM; diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 4d4b6bcbfa5f..700dd0552cd7 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -416,7 +416,7 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev) __set_bit(devidx, &ps3disk_mask); mutex_unlock(&ps3disk_mask_mutex); - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { error = -ENOMEM; goto fail; diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 01c743c092be..7844424f7b17 100644 --- a/drivers/block/ps3vram.c +++ b/drivers/block/ps3vram.c @@ -612,7 +612,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev) reports_size, xdr_lpar; char *rest; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) { error = -ENOMEM; goto fail; diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c9cf07416fa5..e7da06200c1e 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -707,7 +707,7 @@ static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts) int ret = -ENOMEM; dout("%s:\n", __func__); - rbdc = kmalloc_obj(struct rbd_client, GFP_KERNEL); + rbdc = kmalloc_obj(struct rbd_client); if (!rbdc) goto out_opt; @@ -5289,7 +5289,7 @@ static struct rbd_spec *rbd_spec_alloc(void) { struct rbd_spec *spec; - spec = kzalloc_obj(*spec, GFP_KERNEL); + spec = kzalloc_obj(*spec); if (!spec) return NULL; @@ -5352,7 +5352,7 @@ static struct rbd_device *__rbd_dev_create(struct rbd_spec *spec) { struct rbd_device *rbd_dev; - rbd_dev = kzalloc_obj(*rbd_dev, GFP_KERNEL); + rbd_dev = kzalloc_obj(*rbd_dev); if (!rbd_dev) return NULL; @@ -6509,7 +6509,7 @@ static int rbd_add_parse_args(const char *buf, /* Initialize all rbd options to the defaults */ - pctx.opts = kzalloc_obj(*pctx.opts, GFP_KERNEL); + pctx.opts = kzalloc_obj(*pctx.opts); if (!pctx.opts) goto out_mem; diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c index 6ca1221693ff..eb485e4c12e2 100644 --- a/drivers/block/rnbd/rnbd-clt-sysfs.c +++ b/drivers/block/rnbd/rnbd-clt-sysfs.c @@ -591,7 +591,7 @@ static ssize_t rnbd_clt_map_device_store(struct kobject *kobj, opt.dest_port = &port_nr; opt.access_mode = &access_mode; opt.nr_poll_queues = &nr_poll_queues; - addrs = kzalloc_objs(*addrs, ARRAY_SIZE(paths) * 2, GFP_KERNEL); + addrs = kzalloc_objs(*addrs, ARRAY_SIZE(paths) * 2); if (!addrs) return -ENOMEM; diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c index 59896090d856..c60dafbe79e8 100644 --- a/drivers/block/rnbd/rnbd-clt.c +++ b/drivers/block/rnbd/rnbd-clt.c @@ -324,7 +324,7 @@ static struct rnbd_iu *rnbd_get_iu(struct rnbd_clt_session *sess, struct rnbd_iu *iu; struct rtrs_permit *permit; - iu = kzalloc_obj(*iu, GFP_KERNEL); + iu = kzalloc_obj(*iu); if (!iu) return NULL; @@ -541,7 +541,7 @@ static int send_msg_open(struct rnbd_clt_dev *dev, enum wait_type wait) }; int err, errno; - rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); if (!rsp) return -ENOMEM; @@ -587,7 +587,7 @@ static int send_msg_sess_info(struct rnbd_clt_session *sess, enum wait_type wait }; int err, errno; - rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); if (!rsp) return -ENOMEM; @@ -1564,7 +1564,7 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname, goto put_dev; } - rsp = kzalloc_obj(*rsp, GFP_KERNEL); + rsp = kzalloc_obj(*rsp); if (!rsp) { ret = -ENOMEM; goto del_dev; diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c index d644e59529ca..10e8c438bb43 100644 --- a/drivers/block/rnbd/rnbd-srv.c +++ b/drivers/block/rnbd/rnbd-srv.c @@ -128,7 +128,7 @@ static int process_rdma(struct rnbd_srv_session *srv_sess, trace_process_rdma(srv_sess, msg, id, datalen, usrlen); - priv = kmalloc_obj(*priv, GFP_KERNEL); + priv = kmalloc_obj(*priv); if (!priv) return -ENOMEM; @@ -287,7 +287,7 @@ static int create_sess(struct rtrs_srv_sess *rtrs) return err; } - srv_sess = kzalloc_obj(*srv_sess, GFP_KERNEL); + srv_sess = kzalloc_obj(*srv_sess); if (!srv_sess) return -ENOMEM; @@ -422,7 +422,7 @@ static struct rnbd_srv_sess_dev struct rnbd_srv_sess_dev *sess_dev; int error; - sess_dev = kzalloc_obj(*sess_dev, GFP_KERNEL); + sess_dev = kzalloc_obj(*sess_dev); if (!sess_dev) return ERR_PTR(-ENOMEM); @@ -441,7 +441,7 @@ static struct rnbd_srv_dev *rnbd_srv_init_srv_dev(struct block_device *bdev) { struct rnbd_srv_dev *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index 7cf8f8899892..020bd9f1a7b6 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c @@ -992,7 +992,7 @@ static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id) goto err_out_release_mdesc; } - port = kzalloc_obj(*port, GFP_KERNEL); + port = kzalloc_obj(*port); if (!port) { err = -ENOMEM; goto err_out_release_mdesc; diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 3b015a9c752f..0ccc12a72388 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -896,7 +896,7 @@ static int swim_probe(struct platform_device *dev) /* set platform driver data */ - swd = kzalloc_obj(struct swim_priv, GFP_KERNEL); + swd = kzalloc_obj(struct swim_priv); if (!swd) { ret = -ENOMEM; goto out_release_io; diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 1ee1ebe693bf..b1c9a27fe00f 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -991,12 +991,12 @@ static int init_vq(struct virtio_blk *vblk) vblk->io_queues[HCTX_TYPE_READ], vblk->io_queues[HCTX_TYPE_POLL]); - vblk->vqs = kmalloc_objs(*vblk->vqs, num_vqs, GFP_KERNEL); + vblk->vqs = kmalloc_objs(*vblk->vqs, num_vqs); if (!vblk->vqs) return -ENOMEM; - vqs_info = kzalloc_objs(*vqs_info, num_vqs, GFP_KERNEL); - vqs = kmalloc_objs(*vqs, num_vqs, GFP_KERNEL); + vqs_info = kzalloc_objs(*vqs_info, num_vqs); + vqs = kmalloc_objs(*vqs, num_vqs); if (!vqs_info || !vqs) { err = -ENOMEM; goto out; @@ -1455,7 +1455,7 @@ static int virtblk_probe(struct virtio_device *vdev) goto out; index = err; - vdev->priv = vblk = kmalloc_obj(*vblk, GFP_KERNEL); + vdev->priv = vblk = kmalloc_obj(*vblk); if (!vblk) { err = -ENOMEM; goto out_free_index; diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 448417097837..adfd61af86ee 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -628,7 +628,7 @@ static int xen_blkbk_probe(struct xenbus_device *dev, const struct xenbus_device_id *id) { int err; - struct backend_info *be = kzalloc_obj(struct backend_info, GFP_KERNEL); + struct backend_info *be = kzalloc_obj(struct backend_info); /* match the pr_debug in xen_blkbk_remove */ pr_debug("%s %p %d\n", __func__, dev, dev->otherend_id); @@ -1009,7 +1009,7 @@ static int read_per_ring_refs(struct xen_blkif_ring *ring, const char *dir) err = -ENOMEM; for (i = 0; i < nr_grefs * XEN_BLKIF_REQS_PER_PAGE; i++) { - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) goto fail; list_add_tail(&req->free_list, &ring->pending_free); diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index e8aec3857dd5..777a5ae0cd33 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1980,7 +1980,7 @@ static int blkfront_probe(struct xenbus_device *dev, } kfree(type); } - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) { xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c index 7dee3aacb2d8..f92a52a720d1 100644 --- a/drivers/block/zram/backend_deflate.c +++ b/drivers/block/zram/backend_deflate.c @@ -54,7 +54,7 @@ static int deflate_create(struct zcomp_params *params, struct zcomp_ctx *ctx) size_t sz; int ret; - zctx = kzalloc_obj(*zctx, GFP_KERNEL); + zctx = kzalloc_obj(*zctx); if (!zctx) return -ENOMEM; diff --git a/drivers/block/zram/backend_lz4.c b/drivers/block/zram/backend_lz4.c index 3416fec9e982..04e186614760 100644 --- a/drivers/block/zram/backend_lz4.c +++ b/drivers/block/zram/backend_lz4.c @@ -41,7 +41,7 @@ static int lz4_create(struct zcomp_params *params, struct zcomp_ctx *ctx) { struct lz4_ctx *zctx; - zctx = kzalloc_obj(*zctx, GFP_KERNEL); + zctx = kzalloc_obj(*zctx); if (!zctx) return -ENOMEM; @@ -51,11 +51,11 @@ static int lz4_create(struct zcomp_params *params, struct zcomp_ctx *ctx) if (!zctx->mem) goto error; } else { - zctx->dstrm = kzalloc_obj(*zctx->dstrm, GFP_KERNEL); + zctx->dstrm = kzalloc_obj(*zctx->dstrm); if (!zctx->dstrm) goto error; - zctx->cstrm = kzalloc_obj(*zctx->cstrm, GFP_KERNEL); + zctx->cstrm = kzalloc_obj(*zctx->cstrm); if (!zctx->cstrm) goto error; } diff --git a/drivers/block/zram/backend_lz4hc.c b/drivers/block/zram/backend_lz4hc.c index fd94df9193d3..f6a336acfe20 100644 --- a/drivers/block/zram/backend_lz4hc.c +++ b/drivers/block/zram/backend_lz4hc.c @@ -41,7 +41,7 @@ static int lz4hc_create(struct zcomp_params *params, struct zcomp_ctx *ctx) { struct lz4hc_ctx *zctx; - zctx = kzalloc_obj(*zctx, GFP_KERNEL); + zctx = kzalloc_obj(*zctx); if (!zctx) return -ENOMEM; @@ -51,11 +51,11 @@ static int lz4hc_create(struct zcomp_params *params, struct zcomp_ctx *ctx) if (!zctx->mem) goto error; } else { - zctx->dstrm = kzalloc_obj(*zctx->dstrm, GFP_KERNEL); + zctx->dstrm = kzalloc_obj(*zctx->dstrm); if (!zctx->dstrm) goto error; - zctx->cstrm = kzalloc_obj(*zctx->cstrm, GFP_KERNEL); + zctx->cstrm = kzalloc_obj(*zctx->cstrm); if (!zctx->cstrm) goto error; } diff --git a/drivers/block/zram/backend_zstd.c b/drivers/block/zram/backend_zstd.c index d9303269b90d..d00b548056dc 100644 --- a/drivers/block/zram/backend_zstd.c +++ b/drivers/block/zram/backend_zstd.c @@ -53,7 +53,7 @@ static int zstd_setup_params(struct zcomp_params *params) zstd_compression_parameters prm; struct zstd_params *zp; - zp = kzalloc_obj(*zp, GFP_KERNEL); + zp = kzalloc_obj(*zp); if (!zp) return -ENOMEM; @@ -122,7 +122,7 @@ static int zstd_create(struct zcomp_params *params, struct zcomp_ctx *ctx) zstd_parameters prm; size_t sz; - zctx = kzalloc_obj(*zctx, GFP_KERNEL); + zctx = kzalloc_obj(*zctx); if (!zctx) return -ENOMEM; diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c index b53fb5fbc041..a771a8ecc540 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c @@ -238,7 +238,7 @@ struct zcomp *zcomp_create(const char *alg, struct zcomp_params *params) */ BUILD_BUG_ON(ARRAY_SIZE(backends) <= 1); - comp = kzalloc_obj(struct zcomp, GFP_KERNEL); + comp = kzalloc_obj(struct zcomp); if (!comp) return ERR_PTR(-ENOMEM); diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 3cc82b88b07e..bca33403fc8b 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -250,7 +250,7 @@ static struct zram_pp_ctl *init_pp_ctl(void) struct zram_pp_ctl *ctl; u32 idx; - ctl = kmalloc_obj(*ctl, GFP_KERNEL); + ctl = kmalloc_obj(*ctl); if (!ctl) return NULL; @@ -855,7 +855,7 @@ static struct zram_wb_ctl *init_wb_ctl(struct zram *zram) struct zram_wb_ctl *wb_ctl; int i; - wb_ctl = kmalloc_obj(*wb_ctl, GFP_KERNEL); + wb_ctl = kmalloc_obj(*wb_ctl); if (!wb_ctl) return NULL; @@ -3079,7 +3079,7 @@ static int zram_add(void) struct zram *zram; int ret, device_id; - zram = kzalloc_obj(struct zram, GFP_KERNEL); + zram = kzalloc_obj(struct zram); if (!zram) return -ENOMEM; |
