diff options
author | Julia Lawall <Julia.Lawall@inria.fr> | 2022-03-13 15:18:47 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-03-15 00:52:05 -0400 |
commit | dc2646417d54f002fb127067b5848dbef975e8ff (patch) | |
tree | 5132621680e23ad82c03cb2744ecba2e966025b1 /drivers/scsi/lpfc/lpfc_debugfs.c | |
parent | 9d05790f518744e0341e2d6c988b9db9143ce535 (diff) | |
download | lwn-dc2646417d54f002fb127067b5848dbef975e8ff.tar.gz lwn-dc2646417d54f002fb127067b5848dbef975e8ff.zip |
scsi: lpfc: Use kcalloc()
Use kcalloc() instead of kmalloc() + memset().
Link: https://lore.kernel.org/r/20220313141847.109804-1-Julia.Lawall@inria.fr
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_debugfs.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_debugfs.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 30fac2f6fb06..7b24c932e812 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -6272,9 +6272,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) phba->hba_debugfs_root, phba, &lpfc_debugfs_op_slow_ring_trc); if (!phba->slow_ring_trc) { - phba->slow_ring_trc = kmalloc( - (sizeof(struct lpfc_debugfs_trc) * - lpfc_debugfs_max_slow_ring_trc), + phba->slow_ring_trc = kcalloc( + lpfc_debugfs_max_slow_ring_trc, + sizeof(struct lpfc_debugfs_trc), GFP_KERNEL); if (!phba->slow_ring_trc) { lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, @@ -6283,9 +6283,6 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) goto debug_failed; } atomic_set(&phba->slow_ring_trc_cnt, 0); - memset(phba->slow_ring_trc, 0, - (sizeof(struct lpfc_debugfs_trc) * - lpfc_debugfs_max_slow_ring_trc)); } snprintf(name, sizeof(name), "nvmeio_trc"); |