diff options
author | Nico Huber <nico.huber@secunet.com> | 2021-06-09 18:08:48 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2021-06-11 10:28:54 +0000 |
commit | 6d438d42952e65be8cff6e6c6a148e238221b156 (patch) | |
tree | 1d299c0c41c2f6c6c76fa15c42ee31c956bf5b5a | |
parent | a6e4df66243691971ab7fc0915bf80b223aae6d0 (diff) | |
download | flashrom-6d438d42952e65be8cff6e6c6a148e238221b156.tar.gz flashrom-6d438d42952e65be8cff6e6c6a148e238221b156.tar.bz2 flashrom-6d438d42952e65be8cff6e6c6a148e238221b156.zip |
dummyflasher: Replace another case of `sizeof(struct ...)`
Using the pointer's type instead ensures that we get the right size even
if code changes in the future.
Change-Id: If88ba394095f86c598dcc5cf1751e1c23b132d04
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55358
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
-rw-r--r-- | dummyflasher.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dummyflasher.c b/dummyflasher.c index b75cddb3..6a75506d 100644 --- a/dummyflasher.c +++ b/dummyflasher.c @@ -947,7 +947,7 @@ static int dummy_init(void) { struct stat image_stat; - struct emu_data *data = calloc(1, sizeof(struct emu_data)); + struct emu_data *data = calloc(1, sizeof(*data)); if (!data) { msg_perr("Out of memory!\n"); return 1; |