Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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

authored by

Markus Elfring and committed by
Miquel Raynal
0d9a4164 086cd7a6

+1 -1
+1 -1
drivers/mtd/ssfdc.c
··· 295 295 if (cis_sector == -1) 296 296 return; 297 297 298 - ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL); 298 + ssfdc = kzalloc(sizeof(*ssfdc), GFP_KERNEL); 299 299 if (!ssfdc) 300 300 return; 301 301