From: Markus Elfring Date: Wed, 27 Dec 2023 14:30:06 +0000 (+0100) Subject: mtd: ssfdc: Improve a size determination in ssfdcr_add_mtd() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0d9a4164ba4929bbc231eef438d4cba1caee9d25;p=linux.git mtd: ssfdc: Improve a size determination in ssfdcr_add_mtd() 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 Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/b7ee7d1b-49a2-41d8-9c8f-3674f1aecc43@web.de --- diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c index e6de250876479..46c01fa2ec46f 100644 --- a/drivers/mtd/ssfdc.c +++ b/drivers/mtd/ssfdc.c @@ -295,7 +295,7 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) if (cis_sector == -1) return; - ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL); + ssfdc = kzalloc(sizeof(*ssfdc), GFP_KERNEL); if (!ssfdc) return;