mtd: ssfdc: Improve a size determination in ssfdcr_add_mtd()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 27 Dec 2023 14:30:06 +0000 (15:30 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 5 Feb 2024 13:22:39 +0000 (14:22 +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@users.sourceforge.net>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/b7ee7d1b-49a2-41d8-9c8f-3674f1aecc43@web.de
drivers/mtd/ssfdc.c

index e6de2508764796650775aa715f569e01b8e9c4dd..46c01fa2ec46fc5af8221b6a80e93139c31e04be 100644 (file)
@@ -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;