From bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 21 Feb 2026 16:37:42 -0800 Subject: Convert 'alloc_obj' family to use the new default GFP_KERNEL argument This was done entirely with mindless brute force, using git grep -l '\ --- drivers/target/iscsi/cxgbit/cxgbit_cm.c | 4 ++-- drivers/target/iscsi/cxgbit/cxgbit_main.c | 2 +- drivers/target/iscsi/iscsi_target.c | 10 +++++----- drivers/target/iscsi/iscsi_target_auth.c | 2 +- drivers/target/iscsi/iscsi_target_erl2.c | 2 +- drivers/target/iscsi/iscsi_target_login.c | 10 +++++----- drivers/target/iscsi/iscsi_target_parameters.c | 10 +++++----- drivers/target/iscsi/iscsi_target_tpg.c | 4 ++-- drivers/target/loopback/tcm_loop.c | 4 ++-- drivers/target/sbp/sbp_target.c | 14 +++++++------- drivers/target/target_core_configfs.c | 4 ++-- drivers/target/target_core_device.c | 6 +++--- drivers/target/target_core_fabric_configfs.c | 2 +- drivers/target/target_core_file.c | 8 ++++---- drivers/target/target_core_hba.c | 4 ++-- drivers/target/target_core_iblock.c | 6 +++--- drivers/target/target_core_pr.c | 2 +- drivers/target/target_core_pscsi.c | 6 +++--- drivers/target/target_core_rd.c | 10 +++++----- drivers/target/target_core_tpg.c | 2 +- drivers/target/target_core_transport.c | 4 ++-- drivers/target/target_core_user.c | 4 ++-- drivers/target/target_core_xcopy.c | 2 +- drivers/target/tcm_fc/tfc_conf.c | 4 ++-- drivers/target/tcm_fc/tfc_sess.c | 4 ++-- drivers/target/tcm_remote/tcm_remote.c | 2 +- 26 files changed, 66 insertions(+), 66 deletions(-) (limited to 'drivers/target') diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c index 0aa4cb9e494e..146705845fa3 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c @@ -79,7 +79,7 @@ static struct np_info * cxgbit_np_hash_add(struct cxgbit_device *cdev, struct cxgbit_np *cnp, unsigned int stid) { - struct np_info *p = kzalloc_obj(*p, GFP_KERNEL); + struct np_info *p = kzalloc_obj(*p); if (p) { int bucket = cxgbit_np_hashfn(cnp); @@ -431,7 +431,7 @@ int cxgbit_setup_np(struct iscsi_np *np, struct sockaddr_storage *ksockaddr) (ksockaddr->ss_family != AF_INET6)) return -EINVAL; - cnp = kzalloc_obj(*cnp, GFP_KERNEL); + cnp = kzalloc_obj(*cnp); if (!cnp) return -ENOMEM; diff --git a/drivers/target/iscsi/cxgbit/cxgbit_main.c b/drivers/target/iscsi/cxgbit/cxgbit_main.c index e1985e1187b0..b6036820fc95 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_main.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_main.c @@ -57,7 +57,7 @@ static void *cxgbit_uld_add(const struct cxgb4_lld_info *lldi) if (is_t4(lldi->adapter_type)) return ERR_PTR(-ENODEV); - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 6ff807754304..e80449f6ce15 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -121,7 +121,7 @@ struct iscsi_tiqn *iscsit_add_tiqn(unsigned char *buf) return ERR_PTR(-EINVAL); } - tiqn = kzalloc_obj(*tiqn, GFP_KERNEL); + tiqn = kzalloc_obj(*tiqn); if (!tiqn) return ERR_PTR(-ENOMEM); @@ -352,7 +352,7 @@ struct iscsi_np *iscsit_add_np( return np; } - np = kzalloc_obj(*np, GFP_KERNEL); + np = kzalloc_obj(*np); if (!np) { mutex_unlock(&np_lock); return ERR_PTR(-ENOMEM); @@ -674,7 +674,7 @@ static int __init iscsi_target_init_module(void) int ret = 0, size; pr_debug("iSCSI-Target "ISCSIT_VERSION"\n"); - iscsit_global = kzalloc_obj(*iscsit_global, GFP_KERNEL); + iscsit_global = kzalloc_obj(*iscsit_global); if (!iscsit_global) return -1; @@ -981,7 +981,7 @@ static int iscsit_allocate_iovecs(struct iscsit_cmd *cmd) u32 iov_count = max(1UL, DIV_ROUND_UP(cmd->se_cmd.data_length, PAGE_SIZE)); iov_count += ISCSI_IOV_DATA_BUFFER; - cmd->iov_data = kzalloc_objs(*cmd->iov_data, iov_count, GFP_KERNEL); + cmd->iov_data = kzalloc_objs(*cmd->iov_data, iov_count); if (!cmd->iov_data) return -ENOMEM; @@ -1992,7 +1992,7 @@ iscsit_handle_task_mgt_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, hdr->refcmdsn = cpu_to_be32(ISCSI_RESERVED_TAG); cmd->data_direction = DMA_NONE; - cmd->tmr_req = kzalloc_obj(*cmd->tmr_req, GFP_KERNEL); + cmd->tmr_req = kzalloc_obj(*cmd->tmr_req); if (!cmd->tmr_req) { return iscsit_add_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_NO_RESOURCES, diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi/iscsi_target_auth.c index d6f3611c0d4b..c46c69a28e97 100644 --- a/drivers/target/iscsi/iscsi_target_auth.c +++ b/drivers/target/iscsi/iscsi_target_auth.c @@ -152,7 +152,7 @@ static struct iscsi_chap *chap_server_open( return NULL; } - conn->auth_protocol = kzalloc_obj(struct iscsi_chap, GFP_KERNEL); + conn->auth_protocol = kzalloc_obj(struct iscsi_chap); if (!conn->auth_protocol) return NULL; diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c index 7e7193a40959..bda254a0d4ed 100644 --- a/drivers/target/iscsi/iscsi_target_erl2.c +++ b/drivers/target/iscsi/iscsi_target_erl2.c @@ -268,7 +268,7 @@ int iscsit_prepare_cmds_for_reallegiance(struct iscsit_conn *conn) * (struct iscsit_cmd->cr) so we need to allocate this before preparing the * connection's command list for connection recovery. */ - cr = kzalloc_obj(struct iscsi_conn_recovery, GFP_KERNEL); + cr = kzalloc_obj(struct iscsi_conn_recovery); if (!cr) { pr_err("Unable to allocate memory for" " struct iscsi_conn_recovery.\n"); diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 8a5a711b505b..aafc94bcb635 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -38,7 +38,7 @@ static struct iscsi_login *iscsi_login_init_conn(struct iscsit_conn *conn) { struct iscsi_login *login; - login = kzalloc_obj(struct iscsi_login, GFP_KERNEL); + login = kzalloc_obj(struct iscsi_login); if (!login) { pr_err("Unable to allocate memory for struct iscsi_login.\n"); return NULL; @@ -219,7 +219,7 @@ static int iscsi_login_zero_tsih_s1( struct iscsi_login_req *pdu = (struct iscsi_login_req *)buf; int ret; - sess = kzalloc_obj(struct iscsit_session, GFP_KERNEL); + sess = kzalloc_obj(struct iscsit_session); if (!sess) { iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ISCSI_LOGIN_STATUS_NO_RESOURCES); @@ -267,7 +267,7 @@ static int iscsi_login_zero_tsih_s1( */ atomic_set(&sess->max_cmd_sn, be32_to_cpu(pdu->cmdsn)); - sess->sess_ops = kzalloc_obj(struct iscsi_sess_ops, GFP_KERNEL); + sess->sess_ops = kzalloc_obj(struct iscsi_sess_ops); if (!sess->sess_ops) { iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, ISCSI_LOGIN_STATUS_NO_RESOURCES); @@ -1002,7 +1002,7 @@ static struct iscsit_conn *iscsit_alloc_conn(struct iscsi_np *np) { struct iscsit_conn *conn; - conn = kzalloc_obj(struct iscsit_conn, GFP_KERNEL); + conn = kzalloc_obj(struct iscsit_conn); if (!conn) { pr_err("Could not allocate memory for new connection\n"); return NULL; @@ -1040,7 +1040,7 @@ static struct iscsit_conn *iscsit_alloc_conn(struct iscsi_np *np) if (iscsit_conn_set_transport(conn, np->np_transport) < 0) goto free_conn; - conn->conn_ops = kzalloc_obj(struct iscsi_conn_ops, GFP_KERNEL); + conn->conn_ops = kzalloc_obj(struct iscsi_conn_ops); if (!conn->conn_ops) { pr_err("Unable to allocate memory for struct iscsi_conn_ops.\n"); goto put_transport; diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index fce6c91ac157..4ed578c7b98d 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c @@ -73,7 +73,7 @@ static struct iscsi_param *iscsi_set_default_param(struct iscsi_param_list *para { struct iscsi_param *param = NULL; - param = kzalloc_obj(struct iscsi_param, GFP_KERNEL); + param = kzalloc_obj(struct iscsi_param); if (!param) { pr_err("Unable to allocate memory for parameter.\n"); goto out; @@ -148,7 +148,7 @@ int iscsi_create_default_params(struct iscsi_param_list **param_list_ptr) struct iscsi_param *param = NULL; struct iscsi_param_list *pl; - pl = kzalloc_obj(struct iscsi_param_list, GFP_KERNEL); + pl = kzalloc_obj(struct iscsi_param_list); if (!pl) { pr_err("Unable to allocate memory for" " struct iscsi_param_list.\n"); @@ -519,7 +519,7 @@ int iscsi_copy_param_list( struct iscsi_param *new_param = NULL; struct iscsi_param_list *param_list = NULL; - param_list = kzalloc_obj(struct iscsi_param_list, GFP_KERNEL); + param_list = kzalloc_obj(struct iscsi_param_list); if (!param_list) { pr_err("Unable to allocate memory for struct iscsi_param_list.\n"); return -ENOMEM; @@ -535,7 +535,7 @@ int iscsi_copy_param_list( continue; } - new_param = kzalloc_obj(struct iscsi_param, GFP_KERNEL); + new_param = kzalloc_obj(struct iscsi_param); if (!new_param) { pr_err("Unable to allocate memory for struct iscsi_param.\n"); goto err_out; @@ -670,7 +670,7 @@ static int iscsi_add_notunderstood_response( return -1; } - extra_response = kzalloc_obj(struct iscsi_extra_response, GFP_KERNEL); + extra_response = kzalloc_obj(struct iscsi_extra_response); if (!extra_response) { pr_err("Unable to allocate memory for" " struct iscsi_extra_response.\n"); diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 82463efca798..99772364c88e 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -26,7 +26,7 @@ struct iscsi_portal_group *iscsit_alloc_portal_group(struct iscsi_tiqn *tiqn, u1 { struct iscsi_portal_group *tpg; - tpg = kzalloc_obj(struct iscsi_portal_group, GFP_KERNEL); + tpg = kzalloc_obj(struct iscsi_portal_group); if (!tpg) { pr_err("Unable to allocate struct iscsi_portal_group\n"); return NULL; @@ -464,7 +464,7 @@ struct iscsi_tpg_np *iscsit_tpg_add_network_portal( } } - tpg_np = kzalloc_obj(struct iscsi_tpg_np, GFP_KERNEL); + tpg_np = kzalloc_obj(struct iscsi_tpg_np); if (!tpg_np) { pr_err("Unable to allocate memory for" " struct iscsi_tpg_np.\n"); diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 94e191809e1c..d668bd19fd4a 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -693,7 +693,7 @@ static int tcm_loop_make_nexus( return -EEXIST; } - tl_nexus = kzalloc_obj(*tl_nexus, GFP_KERNEL); + tl_nexus = kzalloc_obj(*tl_nexus); if (!tl_nexus) return -ENOMEM; @@ -994,7 +994,7 @@ static struct se_wwn *tcm_loop_make_scsi_hba( char *ptr; int ret, off = 0; - tl_hba = kzalloc_obj(*tl_hba, GFP_KERNEL); + tl_hba = kzalloc_obj(*tl_hba); if (!tl_hba) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index ef69c1321dd0..ad1da7edbb08 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c @@ -186,7 +186,7 @@ static struct sbp_session *sbp_session_create( snprintf(guid_str, sizeof(guid_str), "%016llx", guid); - sess = kmalloc_obj(*sess, GFP_KERNEL); + sess = kmalloc_obj(*sess); if (!sess) return ERR_PTR(-ENOMEM); @@ -391,7 +391,7 @@ static void sbp_management_request_login( 1 << LOGIN_ORB_RECONNECT(be32_to_cpu(req->orb.misc)), tport->max_reconnect_timeout) - 1; - login = kmalloc_obj(*login, GFP_KERNEL); + login = kmalloc_obj(*login); if (!login) { pr_err("failed to allocate login descriptor\n"); @@ -428,7 +428,7 @@ static void sbp_management_request_login( spin_unlock_bh(&sess->lock); already_logged_in: - response = kzalloc_obj(*response, GFP_KERNEL); + response = kzalloc_obj(*response); if (!response) { pr_err("failed to allocate login response block\n"); @@ -1014,7 +1014,7 @@ static struct sbp_target_agent *sbp_target_agent_register( struct sbp_target_agent *agent; int ret; - agent = kmalloc_obj(*agent, GFP_KERNEL); + agent = kmalloc_obj(*agent); if (!agent) return ERR_PTR(-ENOMEM); @@ -1636,7 +1636,7 @@ static struct sbp_management_agent *sbp_management_agent_register( int ret; struct sbp_management_agent *agent; - agent = kmalloc_obj(*agent, GFP_KERNEL); + agent = kmalloc_obj(*agent); if (!agent) return ERR_PTR(-ENOMEM); @@ -1973,7 +1973,7 @@ static struct se_portal_group *sbp_make_tpg(struct se_wwn *wwn, return ERR_PTR(-EBUSY); } - tpg = kzalloc_obj(*tpg, GFP_KERNEL); + tpg = kzalloc_obj(*tpg); if (!tpg) return ERR_PTR(-ENOMEM); @@ -2030,7 +2030,7 @@ static struct se_wwn *sbp_make_tport( if (sbp_parse_wwn(name, &guid) < 0) return ERR_PTR(-EINVAL); - tport = kzalloc_obj(*tport, GFP_KERNEL); + tport = kzalloc_obj(*tport); if (!tport) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index a63de1b6c2b4..17608ea39d5a 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -475,12 +475,12 @@ int target_register_template(const struct target_core_fabric_ops *fo) if (ret) return ret; - tf = kzalloc_obj(struct target_fabric_configfs, GFP_KERNEL); + tf = kzalloc_obj(struct target_fabric_configfs); if (!tf) { pr_err("%s: could not allocate memory!\n", __func__); return -ENOMEM; } - tfo = kzalloc_obj(struct target_core_fabric_ops, GFP_KERNEL); + tfo = kzalloc_obj(struct target_core_fabric_ops); if (!tfo) { kfree(tf); pr_err("%s: could not allocate memory!\n", __func__); diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index f082cbc79751..74c6383f9eed 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -324,7 +324,7 @@ int core_enable_device_list_for_node( struct se_dev_entry *orig, *new; int ret = 0; - new = kzalloc_obj(*new, GFP_KERNEL); + new = kzalloc_obj(*new); if (!new) { pr_err("Unable to allocate se_dev_entry memory\n"); return -ENOMEM; @@ -591,7 +591,7 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl( *ret = -EOVERFLOW; return NULL; } - lacl = kzalloc_obj(struct se_lun_acl, GFP_KERNEL); + lacl = kzalloc_obj(struct se_lun_acl); if (!lacl) { pr_err("Unable to allocate memory for struct se_lun_acl.\n"); *ret = -ENOMEM; @@ -726,7 +726,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) if (!dev->stats) goto free_device; - dev->queues = kzalloc_objs(*dev->queues, nr_cpu_ids, GFP_KERNEL); + dev->queues = kzalloc_objs(*dev->queues, nr_cpu_ids); if (!dev->queues) goto free_stats; diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 69590c570859..331689b30f85 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -899,7 +899,7 @@ target_fabric_setup_tpg_base_cit(struct target_fabric_configfs *tf) nr_attrs++; /* + 1 for final NULL in the array */ - attrs = kzalloc_objs(*attrs, nr_attrs + 1, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, nr_attrs + 1); if (!attrs) return -ENOMEM; diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 5347800a276d..80cc9196f145 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -38,7 +38,7 @@ static int fd_attach_hba(struct se_hba *hba, u32 host_id) { struct fd_host *fd_host; - fd_host = kzalloc_obj(struct fd_host, GFP_KERNEL); + fd_host = kzalloc_obj(struct fd_host); if (!fd_host) { pr_err("Unable to allocate memory for struct fd_host\n"); return -ENOMEM; @@ -73,7 +73,7 @@ static struct se_device *fd_alloc_device(struct se_hba *hba, const char *name) struct fd_dev *fd_dev; struct fd_host *fd_host = hba->hba_ptr; - fd_dev = kzalloc_obj(struct fd_dev, GFP_KERNEL); + fd_dev = kzalloc_obj(struct fd_dev); if (!fd_dev) { pr_err("Unable to allocate memory for struct fd_dev\n"); return NULL; @@ -320,7 +320,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd, loff_t pos = (cmd->t_task_lba * block_size); int ret = 0, i; - bvec = kzalloc_objs(struct bio_vec, sgl_nents, GFP_KERNEL); + bvec = kzalloc_objs(struct bio_vec, sgl_nents); if (!bvec) { pr_err("Unable to allocate fd_do_readv iov[]\n"); return -ENOMEM; @@ -455,7 +455,7 @@ fd_execute_write_same(struct se_cmd *cmd) return TCM_INVALID_CDB_FIELD; } - bvec = kzalloc_objs(struct bio_vec, nolb, GFP_KERNEL); + bvec = kzalloc_objs(struct bio_vec, nolb); if (!bvec) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; diff --git a/drivers/target/target_core_hba.c b/drivers/target/target_core_hba.c index deafced2c804..61c54b489b7f 100644 --- a/drivers/target/target_core_hba.c +++ b/drivers/target/target_core_hba.c @@ -39,7 +39,7 @@ int transport_backend_register(const struct target_backend_ops *ops) { struct target_backend *tb, *old; - tb = kzalloc_obj(*tb, GFP_KERNEL); + tb = kzalloc_obj(*tb); if (!tb) return -ENOMEM; tb->ops = ops; @@ -111,7 +111,7 @@ core_alloc_hba(const char *plugin_name, u32 plugin_dep_id, u32 hba_flags) struct se_hba *hba; int ret = 0; - hba = kzalloc_obj(*hba, GFP_KERNEL); + hba = kzalloc_obj(*hba); if (!hba) { pr_err("Unable to allocate struct se_hba\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 8a333c9bd294..c50828eb844a 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -59,7 +59,7 @@ static struct se_device *iblock_alloc_device(struct se_hba *hba, const char *nam { struct iblock_dev *ib_dev = NULL; - ib_dev = kzalloc_obj(struct iblock_dev, GFP_KERNEL); + ib_dev = kzalloc_obj(struct iblock_dev); if (!ib_dev) { pr_err("Unable to allocate struct iblock_dev\n"); return NULL; @@ -523,7 +523,7 @@ iblock_execute_write_same(struct se_cmd *cmd) return 0; } - ibr = kzalloc_obj(struct iblock_req, GFP_KERNEL); + ibr = kzalloc_obj(struct iblock_req); if (!ibr) goto fail; cmd->priv = ibr; @@ -783,7 +783,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, miter_dir = SG_MITER_FROM_SG; } - ibr = kzalloc_obj(struct iblock_req, GFP_KERNEL); + ibr = kzalloc_obj(struct iblock_req); if (!ibr) goto fail; cmd->priv = ibr; diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 1272c24512fa..24e0667483bd 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c @@ -1490,7 +1490,7 @@ core_scsi3_decode_spec_i_port( * local_node_acl pointer and add to struct list_head tid_dest_list * for add registration processing in the loop of tid_dest_list below. */ - tidh_new = kzalloc_obj(struct pr_transport_id_holder, GFP_KERNEL); + tidh_new = kzalloc_obj(struct pr_transport_id_holder); if (!tidh_new) { pr_err("Unable to allocate tidh_new\n"); return TCM_INSUFFICIENT_REGISTRATION_RESOURCES; diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 4f86030c9ad5..9ed2818c3028 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -51,7 +51,7 @@ static int pscsi_attach_hba(struct se_hba *hba, u32 host_id) { struct pscsi_hba_virt *phv; - phv = kzalloc_obj(struct pscsi_hba_virt, GFP_KERNEL); + phv = kzalloc_obj(struct pscsi_hba_virt); if (!phv) { pr_err("Unable to allocate struct pscsi_hba_virt\n"); return -ENOMEM; @@ -247,7 +247,7 @@ pscsi_get_inquiry_vpd_device_ident(struct scsi_device *sdev, } pr_debug("T10 VPD Identifier Length: %d\n", ident_len); - vpd = kzalloc_obj(struct t10_vpd, GFP_KERNEL); + vpd = kzalloc_obj(struct t10_vpd); if (!vpd) { pr_err("Unable to allocate memory for" " struct t10_vpd\n"); @@ -334,7 +334,7 @@ static struct se_device *pscsi_alloc_device(struct se_hba *hba, { struct pscsi_dev_virt *pdv; - pdv = kzalloc_obj(struct pscsi_dev_virt, GFP_KERNEL); + pdv = kzalloc_obj(struct pscsi_dev_virt); if (!pdv) { pr_err("Unable to allocate memory for struct pscsi_dev_virt\n"); return NULL; diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c index 90ee036ad5ce..092d9fe0d4e3 100644 --- a/drivers/target/target_core_rd.c +++ b/drivers/target/target_core_rd.c @@ -34,7 +34,7 @@ static int rd_attach_hba(struct se_hba *hba, u32 host_id) { struct rd_host *rd_host; - rd_host = kzalloc_obj(*rd_host, GFP_KERNEL); + rd_host = kzalloc_obj(*rd_host); if (!rd_host) return -ENOMEM; @@ -131,7 +131,7 @@ static int rd_allocate_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table * if (sg_per_table < total_sg_needed) chain_entry = 1; - sg = kmalloc_objs(*sg, sg_per_table + chain_entry, GFP_KERNEL); + sg = kmalloc_objs(*sg, sg_per_table + chain_entry); if (!sg) return -ENOMEM; @@ -191,7 +191,7 @@ static int rd_build_device_space(struct rd_dev *rd_dev) total_sg_needed = rd_dev->rd_page_count; sg_tables = (total_sg_needed / max_sg_per_table) + 1; - sg_table = kzalloc_objs(*sg_table, sg_tables, GFP_KERNEL); + sg_table = kzalloc_objs(*sg_table, sg_tables); if (!sg_table) return -ENOMEM; @@ -248,7 +248,7 @@ static int rd_build_prot_space(struct rd_dev *rd_dev, int prot_length, int block total_sg_needed = (rd_dev->rd_page_count * prot_length / block_size) + 1; sg_tables = (total_sg_needed / max_sg_per_table) + 1; - sg_table = kzalloc_objs(*sg_table, sg_tables, GFP_KERNEL); + sg_table = kzalloc_objs(*sg_table, sg_tables); if (!sg_table) return -ENOMEM; @@ -271,7 +271,7 @@ static struct se_device *rd_alloc_device(struct se_hba *hba, const char *name) struct rd_dev *rd_dev; struct rd_host *rd_host = hba->hba_ptr; - rd_dev = kzalloc_obj(*rd_dev, GFP_KERNEL); + rd_dev = kzalloc_obj(*rd_dev); if (!rd_dev) return NULL; diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index bb4eaace5e77..ccff9f6e4826 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -610,7 +610,7 @@ struct se_lun *core_tpg_alloc_lun( { struct se_lun *lun; - lun = kzalloc_obj(*lun, GFP_KERNEL); + lun = kzalloc_obj(*lun); if (!lun) { pr_err("Unable to allocate se_lun memory\n"); return ERR_PTR(-ENOMEM); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 4b6899a729f7..a7330c4fedde 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -233,7 +233,7 @@ struct target_cmd_counter *target_alloc_cmd_counter(void) struct target_cmd_counter *cmd_cnt; int rc; - cmd_cnt = kzalloc_obj(*cmd_cnt, GFP_KERNEL); + cmd_cnt = kzalloc_obj(*cmd_cnt); if (!cmd_cnt) return NULL; @@ -2740,7 +2740,7 @@ void *transport_kmap_data_sg(struct se_cmd *cmd) return kmap(sg_page(sg)) + sg->offset; /* >1 page. use vmap */ - pages = kmalloc_objs(*pages, cmd->t_data_nents, GFP_KERNEL); + pages = kmalloc_objs(*pages, cmd->t_data_nents); if (!pages) return NULL; diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 062e93231794..af95531ddd35 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -1582,7 +1582,7 @@ static int tcmu_attach_hba(struct se_hba *hba, u32 host_id) { struct tcmu_hba *tcmu_hba; - tcmu_hba = kzalloc_obj(struct tcmu_hba, GFP_KERNEL); + tcmu_hba = kzalloc_obj(struct tcmu_hba); if (!tcmu_hba) return -ENOMEM; @@ -1602,7 +1602,7 @@ static struct se_device *tcmu_alloc_device(struct se_hba *hba, const char *name) { struct tcmu_dev *udev; - udev = kzalloc_obj(struct tcmu_dev, GFP_KERNEL); + udev = kzalloc_obj(struct tcmu_dev); if (!udev) return NULL; kref_init(&udev->kref); diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 2447b4abe2cf..9e5e94f3aa5d 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -898,7 +898,7 @@ sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) return TCM_PARAMETER_LIST_LENGTH_ERROR; } - xop = kzalloc_obj(struct xcopy_op, GFP_KERNEL); + xop = kzalloc_obj(struct xcopy_op); if (!xop) goto err; xop->xop_se_cmd = se_cmd; diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c index 7643503f739c..88cf1e5a5810 100644 --- a/drivers/target/tcm_fc/tfc_conf.c +++ b/drivers/target/tcm_fc/tfc_conf.c @@ -244,7 +244,7 @@ static struct se_portal_group *ft_add_tpg(struct se_wwn *wwn, const char *name) } ft_wwn = container_of(wwn, struct ft_lport_wwn, se_wwn); - tpg = kzalloc_obj(*tpg, GFP_KERNEL); + tpg = kzalloc_obj(*tpg); if (!tpg) return NULL; tpg->index = index; @@ -334,7 +334,7 @@ static struct se_wwn *ft_add_wwn( pr_debug("add wwn %s\n", name); if (ft_parse_wwn(name, &wwpn, 1) < 0) return NULL; - ft_wwn = kzalloc_obj(*ft_wwn, GFP_KERNEL); + ft_wwn = kzalloc_obj(*ft_wwn); if (!ft_wwn) return NULL; ft_wwn->wwpn = wwpn; diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index 584785ada9a6..797be06ab71b 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c @@ -59,7 +59,7 @@ static struct ft_tport *ft_tport_get(struct fc_lport *lport) return tport; } - tport = kzalloc_obj(*tport, GFP_KERNEL); + tport = kzalloc_obj(*tport); if (!tport) return NULL; @@ -219,7 +219,7 @@ static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id, if (sess->port_id == port_id) return sess; - sess = kzalloc_obj(*sess, GFP_KERNEL); + sess = kzalloc_obj(*sess); if (!sess) return ERR_PTR(-ENOMEM); diff --git a/drivers/target/tcm_remote/tcm_remote.c b/drivers/target/tcm_remote/tcm_remote.c index 480efdccbf67..03b00f6eca58 100644 --- a/drivers/target/tcm_remote/tcm_remote.c +++ b/drivers/target/tcm_remote/tcm_remote.c @@ -156,7 +156,7 @@ static struct se_wwn *tcm_remote_make_wwn( char *ptr; int ret, off = 0; - remote_hba = kzalloc_obj(*remote_hba, GFP_KERNEL); + remote_hba = kzalloc_obj(*remote_hba); if (!remote_hba) return ERR_PTR(-ENOMEM); -- cgit v1.2.3