[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40059711-eec1-4e52-9ef8-1ebf066aa11d@web.de>
Date: Wed, 27 Dec 2023 18:18:07 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-nvme@...ts.infradead.org, kernel-janitors@...r.kernel.org,
Chaitanya Kulkarni <kch@...dia.com>, Christoph Hellwig <hch@....de>,
James Smart <james.smart@...adcom.com>, Sagi Grimberg <sagi@...mberg.me>
Cc: LKML <linux-kernel@...r.kernel.org>, cocci@...ia.fr
Subject: [PATCH 2/2] nvmet-fc: Improve a size determination in
nvmet_fc_alloc_ls_iodlist()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 27 Dec 2023 18:03:10 +0100
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/nvme/target/fc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 856a68404f32..ada257b3c681 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -537,8 +537,7 @@ nvmet_fc_alloc_ls_iodlist(struct nvmet_fc_tgtport *tgtport)
struct nvmet_fc_ls_iod *iod;
int i;
- iod = kcalloc(NVMET_LS_CTX_COUNT, sizeof(struct nvmet_fc_ls_iod),
- GFP_KERNEL);
+ iod = kcalloc(NVMET_LS_CTX_COUNT, sizeof(*iod), GFP_KERNEL);
if (!iod)
return -ENOMEM;
--
2.43.0
Powered by blists - more mailing lists