* [PATCH 4/6 v2] scsi: lpfc: use kcalloc
@ 2022-03-13 14:18 Julia Lawall
2022-03-15 4:54 ` Martin K. Petersen
2022-03-19 3:56 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2022-03-13 14:18 UTC (permalink / raw)
To: James Smart, Joe Perches
Cc: kernel-janitors, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, linux-scsi, linux-kernel
Use kcalloc instead of kmalloc + memset.
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
---
v2: Use kcalloc instead of kzalloc
drivers/scsi/lpfc/lpfc_debugfs.c | 9 +++------
1 file 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");
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 4/6 v2] scsi: lpfc: use kcalloc
2022-03-13 14:18 [PATCH 4/6 v2] scsi: lpfc: use kcalloc Julia Lawall
@ 2022-03-15 4:54 ` Martin K. Petersen
2022-03-19 3:56 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-03-15 4:54 UTC (permalink / raw)
To: Julia Lawall
Cc: James Smart, Joe Perches, kernel-janitors, Dick Kennedy,
James E.J. Bottomley, Martin K. Petersen, linux-scsi,
linux-kernel
Julia,
> Use kcalloc instead of kmalloc + memset.
Applied to 5.18/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 4/6 v2] scsi: lpfc: use kcalloc
2022-03-13 14:18 [PATCH 4/6 v2] scsi: lpfc: use kcalloc Julia Lawall
2022-03-15 4:54 ` Martin K. Petersen
@ 2022-03-19 3:56 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-03-19 3:56 UTC (permalink / raw)
To: Joe Perches, Julia Lawall, James Smart
Cc: Martin K . Petersen, linux-kernel, linux-scsi, Dick Kennedy,
James E.J. Bottomley, kernel-janitors
On Sun, 13 Mar 2022 15:18:47 +0100, Julia Lawall wrote:
> Use kcalloc instead of kmalloc + memset.
>
>
Applied to 5.18/scsi-queue, thanks!
[4/6] scsi: lpfc: use kcalloc
https://git.kernel.org/mkp/scsi/c/dc2646417d54
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-19 3:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-13 14:18 [PATCH 4/6 v2] scsi: lpfc: use kcalloc Julia Lawall
2022-03-15 4:54 ` Martin K. Petersen
2022-03-19 3:56 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).