1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 06:01:16 +02:00

treewide: Drop most cases of sizeof(struct ...)

Spelling out the struct type name hurts readability and introduces
opportunities for bugs to happen when the pointer variable type is
changed but the corresponding sizeof is (are) not.

TEST=`make CONFIG_EVERYTHING=yes CONFIG_JLINK_SPI=no VERSION=none -j`
with and without this patch; the flashrom executable does not change.

Change-Id: Icc0b60ca6ef9f5ece6ed2a0e03600bb6ccd7dcc6
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55266
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
Angel Pons
2021-06-07 12:33:53 +02:00
committed by Nico Huber
parent 14c916d380
commit 3bd47524c0
18 changed files with 21 additions and 21 deletions

View File

@ -446,7 +446,7 @@ int lspcon_i2c_spi_init(void)
return ret;
}
struct lspcon_i2c_spi_data *data = calloc(1, sizeof(struct lspcon_i2c_spi_data));
struct lspcon_i2c_spi_data *data = calloc(1, sizeof(*data));
if (!data) {
msg_perr("Unable to allocate space for extra SPI master data.\n");
i2c_close(fd);