summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2026-02-21 23:46:04 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-22 08:26:33 -0800
commit189f164e573e18d9f8876dbd3ad8fcbe11f93037 (patch)
tree733382723a15ea29b7c9f3dde3bcb281f0b3c287 /drivers/scsi
parent32a92f8c89326985e05dce8b22d3f0aa07a3e1bd (diff)
downloadlinux-next-189f164e573e18d9f8876dbd3ad8fcbe11f93037.tar.gz
linux-next-189f164e573e18d9f8876dbd3ad8fcbe11f93037.zip
Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Conversion performed via this Coccinelle script: // SPDX-License-Identifier: GPL-2.0-only // Options: --include-headers-for-types --all-includes --include-headers --keep-comments virtual patch @gfp depends on patch && !(file in "tools") && !(file in "samples")@ identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex, kzalloc_obj,kzalloc_objs,kzalloc_flex, kvmalloc_obj,kvmalloc_objs,kvmalloc_flex, kvzalloc_obj,kvzalloc_objs,kvzalloc_flex}; @@ ALLOC(... - , GFP_KERNEL ) $ make coccicheck MODE=patch COCCI=gfp.cocci Build and boot tested x86_64 with Fedora 42's GCC and Clang: Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01 Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01 Signed-off-by: Kees Cook <kees@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/aacraid/aachba.c2
-rw-r--r--drivers/scsi/be2iscsi/be_main.c22
-rw-r--r--drivers/scsi/csiostor/csio_wr.c2
-rw-r--r--drivers/scsi/esas2r/esas2r_init.c2
-rw-r--r--drivers/scsi/hpsa.c4
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c2
-rw-r--r--drivers/scsi/ipr.c7
-rw-r--r--drivers/scsi/lpfc/lpfc_debugfs.c3
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c27
-rw-r--r--drivers/scsi/lpfc/lpfc_nvmet.c3
-rw-r--r--drivers/scsi/mac53c94.c2
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c2
-rw-r--r--drivers/scsi/mpi3mr/mpi3mr_fw.c5
-rw-r--r--drivers/scsi/mpi3mr/mpi3mr_transport.c2
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_base.c15
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_ctl.c2
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c5
-rw-r--r--drivers/scsi/pmcraid.c2
-rw-r--r--drivers/scsi/qedi/qedi_main.c9
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c6
-rw-r--r--drivers/scsi/smartpqi/smartpqi_init.c5
22 files changed, 53 insertions, 79 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 2e8119ce4411..df9492247631 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -493,7 +493,7 @@ int aac_get_containers(struct aac_dev *dev)
fsa_dev_ptr = dev->fsa_dev;
dev->fsa_dev = kzalloc_objs(*fsa_dev_ptr,
- maximum_num_containers, GFP_KERNEL);
+ maximum_num_containers);
kfree(fsa_dev_ptr);
fsa_dev_ptr = NULL;
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index faab6fd9bc29..fd18d4d3d219 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -2477,8 +2477,7 @@ static int beiscsi_alloc_mem(struct beiscsi_hba *phba)
/* Allocate memory for wrb_context */
phwi_ctrlr = phba->phwi_ctrlr;
phwi_ctrlr->wrb_context = kzalloc_objs(struct hwi_wrb_context,
- phba->params.cxns_per_ctrl,
- GFP_KERNEL);
+ phba->params.cxns_per_ctrl);
if (!phwi_ctrlr->wrb_context) {
kfree(phba->phwi_ctrlr);
return -ENOMEM;
@@ -2626,8 +2625,7 @@ static int beiscsi_init_wrb_handle(struct beiscsi_hba *phba)
/* Allocate memory for WRBQ */
phwi_ctxt = phwi_ctrlr->phwi_ctxt;
phwi_ctxt->be_wrbq = kzalloc_objs(struct be_queue_info,
- phba->params.cxns_per_ctrl,
- GFP_KERNEL);
+ phba->params.cxns_per_ctrl);
if (!phwi_ctxt->be_wrbq) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : WRBQ Mem Alloc Failed\n");
@@ -2638,8 +2636,7 @@ static int beiscsi_init_wrb_handle(struct beiscsi_hba *phba)
pwrb_context = &phwi_ctrlr->wrb_context[index];
pwrb_context->pwrb_handle_base =
kzalloc_objs(struct wrb_handle *,
- phba->params.wrbs_per_cxn,
- GFP_KERNEL);
+ phba->params.wrbs_per_cxn);
if (!pwrb_context->pwrb_handle_base) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : Mem Alloc Failed. Failing to load\n");
@@ -2647,8 +2644,7 @@ static int beiscsi_init_wrb_handle(struct beiscsi_hba *phba)
}
pwrb_context->pwrb_handle_basestd =
kzalloc_objs(struct wrb_handle *,
- phba->params.wrbs_per_cxn,
- GFP_KERNEL);
+ phba->params.wrbs_per_cxn);
if (!pwrb_context->pwrb_handle_basestd) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : Mem Alloc Failed. Failing to load\n");
@@ -3897,8 +3893,7 @@ static int beiscsi_init_sgl_handle(struct beiscsi_hba *phba)
mem_descr_sglh += HWI_MEM_SGLH;
if (1 == mem_descr_sglh->num_elements) {
phba->io_sgl_hndl_base = kzalloc_objs(struct sgl_handle *,
- phba->params.ios_per_ctrl,
- GFP_KERNEL);
+ phba->params.ios_per_ctrl);
if (!phba->io_sgl_hndl_base) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : Mem Alloc Failed. Failing to load\n");
@@ -3906,8 +3901,7 @@ static int beiscsi_init_sgl_handle(struct beiscsi_hba *phba)
}
phba->eh_sgl_hndl_base =
kzalloc_objs(struct sgl_handle *,
- phba->params.icds_per_ctrl - phba->params.ios_per_ctrl,
- GFP_KERNEL);
+ phba->params.icds_per_ctrl - phba->params.ios_per_ctrl);
if (!phba->eh_sgl_hndl_base) {
kfree(phba->io_sgl_hndl_base);
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
@@ -4025,7 +4019,7 @@ static int hba_setup_cid_tbls(struct beiscsi_hba *phba)
}
}
phba->ep_array = kzalloc_objs(struct iscsi_endpoint *,
- phba->params.cxns_per_ctrl, GFP_KERNEL);
+ phba->params.cxns_per_ctrl);
if (!phba->ep_array) {
ret = -ENOMEM;
@@ -4033,7 +4027,7 @@ static int hba_setup_cid_tbls(struct beiscsi_hba *phba)
}
phba->conn_table = kzalloc_objs(struct beiscsi_conn *,
- phba->params.cxns_per_ctrl, GFP_KERNEL);
+ phba->params.cxns_per_ctrl);
if (!phba->conn_table) {
kfree(phba->ep_array);
phba->ep_array = NULL;
diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c
index 4769e39a8b64..aa6007a21868 100644
--- a/drivers/scsi/csiostor/csio_wr.c
+++ b/drivers/scsi/csiostor/csio_wr.c
@@ -279,7 +279,7 @@ csio_wr_alloc_q(struct csio_hw *hw, uint32_t qsize, uint32_t wrsize,
flq = wrm->q_arr[q->un.iq.flq_idx];
flq->un.fl.bufs = kzalloc_objs(struct csio_dma_buf,
- flq->credits, GFP_KERNEL);
+ flq->credits);
if (!flq->un.fl.bufs) {
csio_err(hw,
"Failed to allocate FL queue bufs"
diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c
index a895ff0d15ba..0a35f1953768 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -802,7 +802,7 @@ bool esas2r_init_adapter_struct(struct esas2r_adapter *a,
/* allocate the request table */
a->req_table =
kzalloc_objs(struct esas2r_request *,
- num_requests + num_ae_requests + 1, GFP_KERNEL);
+ num_requests + num_ae_requests + 1);
if (a->req_table == NULL) {
esas2r_log(ESAS2R_LOG_CRIT,
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index adb3b7d8c6fb..a1b116cd4723 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2206,7 +2206,7 @@ static int hpsa_allocate_ioaccel2_sg_chain_blocks(struct ctlr_info *h)
for (i = 0; i < h->nr_cmds; i++) {
h->ioaccel2_cmd_sg_list[i] =
kmalloc_objs(*h->ioaccel2_cmd_sg_list[i],
- h->maxsgentries, GFP_KERNEL);
+ h->maxsgentries);
if (!h->ioaccel2_cmd_sg_list[i])
goto clean;
}
@@ -2244,7 +2244,7 @@ static int hpsa_alloc_sg_chain_blocks(struct ctlr_info *h)
for (i = 0; i < h->nr_cmds; i++) {
h->cmd_sg_list[i] = kmalloc_objs(*h->cmd_sg_list[i],
- h->chainsize, GFP_KERNEL);
+ h->chainsize);
if (!h->cmd_sg_list[i])
goto clean;
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 5d5d9f97904b..a20fce04fe79 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -6210,7 +6210,7 @@ static int ibmvfc_alloc_mem(struct ibmvfc_host *vhost)
goto free_login_buffer;
vhost->trace = kzalloc_objs(struct ibmvfc_trace_entry,
- IBMVFC_NUM_TRACE_ENTRIES, GFP_KERNEL);
+ IBMVFC_NUM_TRACE_ENTRIES);
atomic_set(&vhost->trace_index, -1);
if (!vhost->trace)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 03f78c07f87f..d207e5e81afe 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -8860,7 +8860,7 @@ static int ipr_alloc_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
return -ENOMEM;
ioa_cfg->ipr_cmnd_list = kzalloc_objs(struct ipr_cmnd *,
- IPR_NUM_CMD_BLKS, GFP_KERNEL);
+ IPR_NUM_CMD_BLKS);
ioa_cfg->ipr_cmnd_list_dma = kzalloc_objs(dma_addr_t, IPR_NUM_CMD_BLKS);
if (!ioa_cfg->ipr_cmnd_list || !ioa_cfg->ipr_cmnd_list_dma) {
@@ -8965,8 +8965,7 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
ENTER;
ioa_cfg->res_entries = kzalloc_objs(struct ipr_resource_entry,
- ioa_cfg->max_devs_supported,
- GFP_KERNEL);
+ ioa_cfg->max_devs_supported);
if (!ioa_cfg->res_entries)
goto out;
@@ -9028,7 +9027,7 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
}
ioa_cfg->trace = kzalloc_objs(struct ipr_trace_entry,
- IPR_NUM_TRACE_ENTRIES, GFP_KERNEL);
+ IPR_NUM_TRACE_ENTRIES);
if (!ioa_cfg->trace)
goto out_free_hostrcb_dma;
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index 1d9b3fcaa27e..052023fc1733 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -6211,8 +6211,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
&lpfc_debugfs_op_slow_ring_trc);
if (!phba->slow_ring_trc) {
phba->slow_ring_trc = kzalloc_objs(struct lpfc_debugfs_trc,
- lpfc_debugfs_max_slow_ring_trc,
- GFP_KERNEL);
+ lpfc_debugfs_max_slow_ring_trc);
if (!phba->slow_ring_trc) {
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"0416 Cannot create debugfs "
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index a25a78a5332d..94ad253d65a0 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -7771,8 +7771,7 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba)
if (!phba->sli.sli3_ring)
phba->sli.sli3_ring = kzalloc_objs(struct lpfc_sli_ring,
- LPFC_SLI3_MAX_RING,
- GFP_KERNEL);
+ LPFC_SLI3_MAX_RING);
if (!phba->sli.sli3_ring)
return -ENOMEM;
@@ -8355,8 +8354,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
}
phba->sli4_hba.hba_eq_hdl = kzalloc_objs(struct lpfc_hba_eq_hdl,
- phba->cfg_irq_chann,
- GFP_KERNEL);
+ phba->cfg_irq_chann);
if (!phba->sli4_hba.hba_eq_hdl) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"2572 Failed allocate memory for "
@@ -8366,8 +8364,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
}
phba->sli4_hba.cpu_map = kzalloc_objs(struct lpfc_vector_map_info,
- phba->sli4_hba.num_possible_cpu,
- GFP_KERNEL);
+ phba->sli4_hba.num_possible_cpu);
if (!phba->sli4_hba.cpu_map) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3327 Failed allocate memory for msi-x "
@@ -8385,8 +8382,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
}
phba->sli4_hba.idle_stat = kzalloc_objs(*phba->sli4_hba.idle_stat,
- phba->sli4_hba.num_possible_cpu,
- GFP_KERNEL);
+ phba->sli4_hba.num_possible_cpu);
if (!phba->sli4_hba.idle_stat) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3390 Failed allocation for idle_stat\n");
@@ -10440,8 +10436,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba)
if (!phba->sli4_hba.hdwq) {
phba->sli4_hba.hdwq = kzalloc_objs(struct lpfc_sli4_hdw_queue,
- phba->cfg_hdw_queue,
- GFP_KERNEL);
+ phba->cfg_hdw_queue);
if (!phba->sli4_hba.hdwq) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"6427 Failed allocate memory for "
@@ -10471,8 +10466,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba)
if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) {
if (phba->nvmet_support) {
phba->sli4_hba.nvmet_cqset = kzalloc_objs(struct lpfc_queue *,
- phba->cfg_nvmet_mrq,
- GFP_KERNEL);
+ phba->cfg_nvmet_mrq);
if (!phba->sli4_hba.nvmet_cqset) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3121 Fail allocate memory for "
@@ -10480,8 +10474,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba)
goto out_error;
}
phba->sli4_hba.nvmet_mrq_hdr = kzalloc_objs(struct lpfc_queue *,
- phba->cfg_nvmet_mrq,
- GFP_KERNEL);
+ phba->cfg_nvmet_mrq);
if (!phba->sli4_hba.nvmet_mrq_hdr) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3122 Fail allocate memory for "
@@ -10489,8 +10482,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba)
goto out_error;
}
phba->sli4_hba.nvmet_mrq_data = kzalloc_objs(struct lpfc_queue *,
- phba->cfg_nvmet_mrq,
- GFP_KERNEL);
+ phba->cfg_nvmet_mrq);
if (!phba->sli4_hba.nvmet_mrq_data) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3124 Fail allocate memory for "
@@ -11376,8 +11368,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba)
if (phba->sli4_hba.cq_max) {
kfree(phba->sli4_hba.cq_lookup);
phba->sli4_hba.cq_lookup = kzalloc_objs(struct lpfc_queue *,
- (phba->sli4_hba.cq_max + 1),
- GFP_KERNEL);
+ (phba->sli4_hba.cq_max + 1));
if (!phba->sli4_hba.cq_lookup) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"0549 Failed setup of CQ Lookup table: "
diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index ea5f24e28ef0..debd9317103a 100644
--- a/drivers/scsi/lpfc/lpfc_nvmet.c
+++ b/drivers/scsi/lpfc/lpfc_nvmet.c
@@ -1508,8 +1508,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba)
phba->sli4_hba.nvmet_xri_cnt);
phba->sli4_hba.nvmet_ctx_info = kzalloc_objs(struct lpfc_nvmet_ctx_info,
- phba->sli4_hba.num_possible_cpu * phba->cfg_nvmet_mrq,
- GFP_KERNEL);
+ phba->sli4_hba.num_possible_cpu * phba->cfg_nvmet_mrq);
if (!phba->sli4_hba.nvmet_ctx_info) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"6419 Failed allocate memory for "
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index 74b92a56099a..de2bd860b9d7 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -463,7 +463,7 @@ static int mac53c94_probe(struct macio_dev *mdev, const struct of_device_id *mat
* XXX FIXME: Use DMA consistent routines
*/
dma_cmd_space = kmalloc_objs(struct dbdma_cmd,
- host->sg_tablesize + 2, GFP_KERNEL);
+ host->sg_tablesize + 2);
if (!dma_cmd_space) {
printk(KERN_ERR "mac53c94: couldn't allocate dma "
"command space for %pOF\n", node);
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index c98064200390..ac71ea4898b2 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6376,7 +6376,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
if (instance->adapter_type >= VENTURA_SERIES) {
fusion->stream_detect_by_ld =
kzalloc_objs(struct LD_STREAM_DETECT *,
- MAX_LOGICAL_DRIVES_EXT, GFP_KERNEL);
+ MAX_LOGICAL_DRIVES_EXT);
if (!fusion->stream_detect_by_ld) {
dev_err(&instance->pdev->dev,
"unable to allocate stream detection for pool of LDs\n");
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index 07bdb95dd7e2..81150bef1145 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -2111,8 +2111,7 @@ static int mpi3mr_alloc_op_reply_q_segments(struct mpi3mr_ioc *mrioc, u16 qidx)
op_reply_q->segment_qd);
op_reply_q->q_segments = kzalloc_objs(struct segments,
- op_reply_q->num_segments,
- GFP_KERNEL);
+ op_reply_q->num_segments);
if (!op_reply_q->q_segments)
return -ENOMEM;
@@ -2170,7 +2169,7 @@ static int mpi3mr_alloc_op_req_q_segments(struct mpi3mr_ioc *mrioc, u16 qidx)
op_req_q->segment_qd);
op_req_q->q_segments = kzalloc_objs(struct segments,
- op_req_q->num_segments, GFP_KERNEL);
+ op_req_q->num_segments);
if (!op_req_q->q_segments)
return -ENOMEM;
diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
index dc23efc79741..240f67a8e2e3 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
@@ -2116,7 +2116,7 @@ int mpi3mr_expander_add(struct mpi3mr_ioc *mrioc, u16 handle)
goto out_fail;
}
sas_expander->phy = kzalloc_objs(struct mpi3mr_sas_phy,
- sas_expander->num_phys, GFP_KERNEL);
+ sas_expander->num_phys);
if (!sas_expander->phy) {
rc = -1;
goto out_fail;
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 06ad016e367e..79052f2accbd 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3462,8 +3462,7 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
if (iopoll_q_count) {
ioc->io_uring_poll_queues = kzalloc_objs(struct io_uring_poll_queue,
- iopoll_q_count,
- GFP_KERNEL);
+ iopoll_q_count);
if (!ioc->io_uring_poll_queues)
iopoll_q_count = 0;
}
@@ -3728,8 +3727,7 @@ mpt3sas_base_map_resources(struct MPT3SAS_ADAPTER *ioc)
* MPT3_SUP_REPLY_POST_HOST_INDEX_REG_OFFSET from previous one.
*/
ioc->replyPostRegisterIndex = kzalloc_objs(resource_size_t *,
- ioc->combined_reply_index_count,
- GFP_KERNEL);
+ ioc->combined_reply_index_count);
if (!ioc->replyPostRegisterIndex) {
ioc_err(ioc,
"allocation for replyPostRegisterIndex failed!\n");
@@ -6562,7 +6560,7 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc)
/* initialize hi-priority queue smid's */
ioc->hpr_lookup = kzalloc_objs(struct request_tracker,
- ioc->hi_priority_depth, GFP_KERNEL);
+ ioc->hi_priority_depth);
if (!ioc->hpr_lookup) {
ioc_err(ioc, "hpr_lookup: kcalloc failed\n");
goto out;
@@ -6575,7 +6573,7 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc)
/* initialize internal queue smid's */
ioc->internal_lookup = kzalloc_objs(struct request_tracker,
- ioc->internal_depth, GFP_KERNEL);
+ ioc->internal_depth);
if (!ioc->internal_lookup) {
ioc_err(ioc, "internal_lookup: kcalloc failed\n");
goto out;
@@ -8430,8 +8428,7 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
if (ioc->is_warpdrive) {
ioc->reply_post_host_index = kzalloc_objs(resource_size_t *,
- ioc->cpu_msix_table_sz,
- GFP_KERNEL);
+ ioc->cpu_msix_table_sz);
if (!ioc->reply_post_host_index) {
ioc_info(ioc, "Allocation for reply_post_host_index failed!!!\n");
r = -ENOMEM;
@@ -8521,7 +8518,7 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
goto out_free_resources;
ioc->pfacts = kzalloc_objs(struct mpt3sas_port_facts,
- ioc->facts.NumberOfPorts, GFP_KERNEL);
+ ioc->facts.NumberOfPorts);
if (!ioc->pfacts) {
r = -ENOMEM;
goto out_free_resources;
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index b2c9a3b0236a..8bb947004885 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -1332,7 +1332,7 @@ _ctl_eventenable(struct MPT3SAS_ADAPTER *ioc, void __user *arg)
ioc->event_context = 0;
ioc->aen_event_read_flag = 0;
ioc->event_log = kzalloc_objs(struct MPT3_IOCTL_EVENTS,
- MPT3SAS_CTL_EVENT_LOG_SIZE, GFP_KERNEL);
+ MPT3SAS_CTL_EVENT_LOG_SIZE);
if (!ioc->event_log) {
pr_err("failure at %s:%d/%s()!\n",
__FILE__, __LINE__, __func__);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 3b6e17e0dbfa..6ff788557294 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -7028,8 +7028,7 @@ _scsih_sas_host_add(struct MPT3SAS_ADAPTER *ioc)
ioc->sas_hba.nr_phys_allocated = max_t(u8,
MPT_MAX_HBA_NUM_PHYS, num_phys);
ioc->sas_hba.phy = kzalloc_objs(struct _sas_phy,
- ioc->sas_hba.nr_phys_allocated,
- GFP_KERNEL);
+ ioc->sas_hba.nr_phys_allocated);
if (!ioc->sas_hba.phy) {
ioc_err(ioc, "failure at %s:%d/%s()!\n",
__FILE__, __LINE__, __func__);
@@ -7283,7 +7282,7 @@ _scsih_expander_add(struct MPT3SAS_ADAPTER *ioc, u16 handle)
goto out_fail;
}
sas_expander->phy = kzalloc_objs(struct _sas_phy,
- sas_expander->num_phys, GFP_KERNEL);
+ sas_expander->num_phys);
if (!sas_expander->phy) {
ioc_err(ioc, "failure at %s:%d/%s()!\n",
__FILE__, __LINE__, __func__);
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index ce76c9dd6171..942a99393204 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4386,7 +4386,7 @@ static int pmcraid_allocate_config_buffers(struct pmcraid_instance *pinstance)
pinstance->res_entries =
kzalloc_objs(struct pmcraid_resource_entry,
- PMCRAID_MAX_RESOURCES, GFP_KERNEL);
+ PMCRAID_MAX_RESOURCES);
if (NULL == pinstance->res_entries) {
pmcraid_err("failed to allocate memory for resource table\n");
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index d5e0b3d653f5..227ff7bd1bdc 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -411,7 +411,7 @@ static int qedi_alloc_fp(struct qedi_ctx *qedi)
int ret = 0;
qedi->fp_array = kzalloc_objs(struct qedi_fastpath,
- MIN_NUM_CPUS_MSIX(qedi), GFP_KERNEL);
+ MIN_NUM_CPUS_MSIX(qedi));
if (!qedi->fp_array) {
QEDI_ERR(&qedi->dbg_ctx,
"fastpath fp array allocation failed.\n");
@@ -419,7 +419,7 @@ static int qedi_alloc_fp(struct qedi_ctx *qedi)
}
qedi->sb_array = kzalloc_objs(struct qed_sb_info,
- MIN_NUM_CPUS_MSIX(qedi), GFP_KERNEL);
+ MIN_NUM_CPUS_MSIX(qedi));
if (!qedi->sb_array) {
QEDI_ERR(&qedi->dbg_ctx,
"fastpath sb array allocation failed.\n");
@@ -499,8 +499,7 @@ static int qedi_setup_cid_que(struct qedi_ctx *qedi)
return -ENOMEM;
qedi->cid_que.conn_cid_tbl = kmalloc_objs(struct qedi_conn *,
- qedi->max_active_conns,
- GFP_KERNEL);
+ qedi->max_active_conns);
if (!qedi->cid_que.conn_cid_tbl) {
kfree(qedi->cid_que.cid_que_base);
qedi->cid_que.cid_que_base = NULL;
@@ -1895,7 +1894,7 @@ struct qedi_cmd *qedi_get_cmd_from_tid(struct qedi_ctx *qedi, u32 tid)
static int qedi_alloc_itt(struct qedi_ctx *qedi)
{
qedi->itt_map = kzalloc_objs(struct qedi_itt_map,
- MAX_ISCSI_TASK_ENTRIES, GFP_KERNEL);
+ MAX_ISCSI_TASK_ENTRIES);
if (!qedi->itt_map) {
QEDI_ERR(&qedi->dbg_ctx,
"Unable to allocate itt map array memory\n");
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 2493b7208222..730c42b1a7b9 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -4042,8 +4042,7 @@ qla2x00_alloc_outstanding_cmds(struct qla_hw_data *ha, struct req_que *req)
*/
req->num_outstanding_cmds = MIN_OUTSTANDING_COMMANDS;
req->outstanding_cmds = kzalloc_objs(srb_t *,
- req->num_outstanding_cmds,
- GFP_KERNEL);
+ req->num_outstanding_cmds);
if (!req->outstanding_cmds) {
ql_log(ql_log_fatal, NULL, 0x0126,
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 8dff71007358..72b1c28e4dae 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -463,7 +463,7 @@ static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req,
if ((ql2xmqsupport || ql2xnvmeenable) && ha->max_qpairs) {
ha->queue_pair_map = kzalloc_objs(struct qla_qpair *,
- ha->max_qpairs, GFP_KERNEL);
+ ha->max_qpairs);
if (!ha->queue_pair_map) {
ql_log(ql_log_fatal, vha, 0x0180,
"Unable to allocate memory for queue pair ptrs.\n");
@@ -4150,7 +4150,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
if (QLA_TGT_MODE_ENABLED() || EDIF_CAP(ha)) {
ha->vp_map = kzalloc_objs(struct qla_vp_map,
- MAX_MULTI_ID_FABRIC, GFP_KERNEL);
+ MAX_MULTI_ID_FABRIC);
if (!ha->vp_map)
goto fail;
}
@@ -4376,7 +4376,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
/* Allocate memory for NVRAM data for vports */
if (ha->nvram_npiv_size) {
ha->npiv_info = kzalloc_objs(struct qla_npiv_entry,
- ha->nvram_npiv_size, GFP_KERNEL);
+ ha->nvram_npiv_size);
if (!ha->npiv_info) {
ql_log_pci(ql_log_fatal, ha->pdev, 0x002d,
"Failed to allocate memory for npiv_info.\n");
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 5c25381ef800..b4ed991976d0 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -1253,7 +1253,7 @@ static inline int pqi_report_phys_luns(struct pqi_ctrl_info *ctrl_info, void **b
num_physicals = get_unaligned_be32(&rpl_8byte_wwid_list->header.list_length) / sizeof(rpl_8byte_wwid_list->lun_entries[0]);
rpl_16byte_wwid_list = kmalloc_flex(*rpl_16byte_wwid_list, lun_entries,
- num_physicals, GFP_KERNEL);
+ num_physicals);
if (!rpl_16byte_wwid_list) {
rc = -ENOMEM;
goto out_free_rpl_list;
@@ -5206,8 +5206,7 @@ static int pqi_alloc_io_resources(struct pqi_ctrl_info *ctrl_info)
struct pqi_io_request *io_request;
ctrl_info->io_request_pool = kzalloc_objs(ctrl_info->io_request_pool[0],
- ctrl_info->max_io_slots,
- GFP_KERNEL);
+ ctrl_info->max_io_slots);
if (!ctrl_info->io_request_pool) {
dev_err(&ctrl_info->pci_dev->dev,