diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-06-23 18:55:34 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-06-26 12:03:06 +0000 |
commit | 8cbafe8723bec983cab5e00db347551a27f74875 (patch) | |
tree | 748b31928b91d99d2e4a033777f76279c0c4faf1 /src/soc | |
parent | 50cbb933a312c4fd57b8f3bdf6fc938e4179f2f0 (diff) |
soc/amd/common/block/acpi/ivrs: use size of instance instead of type
To determine the length parameter of memset, use sizeof with the
instance as argument instead of the type. The behavior is the same, but
it clarifies parameters in the memset call a bit.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I63674fbed7097a583cd77fa6e700652d6dcc5565
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76078
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/amd/common/block/acpi/ivrs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/amd/common/block/acpi/ivrs.c b/src/soc/amd/common/block/acpi/ivrs.c index d5a409f2eb..71b9c626e3 100644 --- a/src/soc/amd/common/block/acpi/ivrs.c +++ b/src/soc/amd/common/block/acpi/ivrs.c @@ -203,7 +203,7 @@ static unsigned long acpi_fill_ivrs40(unsigned long current, acpi_ivrs_ivhd_t *i acpi_ivrs_ivhd40_t *ivhd_40 = (acpi_ivrs_ivhd40_t *)current; unsigned long current_backup; - memset(ivhd_40, 0, sizeof(acpi_ivrs_ivhd40_t)); + memset(ivhd_40, 0, sizeof(*ivhd_40)); /* Enable EFR */ ivhd_40->type = IVHD_BLOCK_TYPE_FULL__ACPI_HID; @@ -260,7 +260,7 @@ static unsigned long acpi_fill_ivrs11(unsigned long current, acpi_ivrs_ivhd_t *i * In order to utilize all features, firmware should expose type 11h * IVHD which supersedes the type 10h. */ - memset(ivhd_11, 0, sizeof(acpi_ivrs_ivhd11_t)); + memset(ivhd_11, 0, sizeof(*ivhd_11)); /* Enable EFR */ ivhd_11->type = IVHD_BLOCK_TYPE_FULL__FIXED; |