@@ -852,8 +852,7 @@ static int spinand_probe(struct spi_device *spi_nand)
struct spinand_state *state;
struct mtd_part_parser_data ppdata;
- info = devm_kzalloc(&spi_nand->dev, sizeof(struct spinand_info),
- GFP_KERNEL);
+ info = devm_kzalloc(&spi_nand->dev, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -861,8 +860,7 @@ static int spinand_probe(struct spi_device *spi_nand)
spinand_lock_block(spi_nand, BL_ALL_UNLOCKED);
- state = devm_kzalloc(&spi_nand->dev, sizeof(struct spinand_state),
- GFP_KERNEL);
+ state = devm_kzalloc(&spi_nand->dev, sizeof(*state), GFP_KERNEL);
if (!state)
return -ENOMEM;
@@ -872,8 +870,7 @@ static int spinand_probe(struct spi_device *spi_nand)
if (!state->buf)
return -ENOMEM;
- chip = devm_kzalloc(&spi_nand->dev, sizeof(struct nand_chip),
- GFP_KERNEL);
+ chip = devm_kzalloc(&spi_nand->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
@@ -903,7 +900,7 @@ static int spinand_probe(struct spi_device *spi_nand)
chip->options |= NAND_CACHEPRG;
chip->select_chip = spinand_select_chip;
- mtd = devm_kzalloc(&spi_nand->dev, sizeof(struct mtd_info), GFP_KERNEL);
+ mtd = devm_kzalloc(&spi_nand->dev, sizeof(*mtd), GFP_KERNEL);
if (!mtd)
return -ENOMEM;
According to CodingStyle, sizeof(*p) is better than sizeof(struct foo). Signed-off-by: Manuel Pégourié-Gonnard <mpg@elzevir.fr> --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)