summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-10-17 13:21:05 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-10-19 14:57:17 +0000
commit14643b33b0f7ea9cde6ce8230793562d4a1b475c (patch)
tree437715af86a62e127f119200b2738d03d6779aab
parent3b9be63bd32daff1083f38b409beab71f2655b4f (diff)
soc/intel/*/acpi.c: Don't copy structs with `memcpy()`
A regular assignment works just as well and also allows type-checking. Change-Id: Id772771f000ba3bad5d4af05f5651c0f0ee43d6d Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58390 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
-rw-r--r--src/soc/intel/alderlake/acpi.c2
-rw-r--r--src/soc/intel/cannonlake/acpi.c2
-rw-r--r--src/soc/intel/elkhartlake/acpi.c2
-rw-r--r--src/soc/intel/icelake/acpi.c2
-rw-r--r--src/soc/intel/jasperlake/acpi.c2
-rw-r--r--src/soc/intel/tigerlake/acpi.c2
6 files changed, 6 insertions, 6 deletions
diff --git a/src/soc/intel/alderlake/acpi.c b/src/soc/intel/alderlake/acpi.c
index 9f4fa880a0..075b4d6623 100644
--- a/src/soc/intel/alderlake/acpi.c
+++ b/src/soc/intel/alderlake/acpi.c
@@ -131,7 +131,7 @@ acpi_cstate_t *soc_get_cstate_map(size_t *entries)
}
for (i = 0; i < *entries; i++) {
- memcpy(&map[i], &cstate_map[set[i]], sizeof(acpi_cstate_t));
+ map[i] = cstate_map[set[i]];
map[i].ctype = i + 1;
}
return map;
diff --git a/src/soc/intel/cannonlake/acpi.c b/src/soc/intel/cannonlake/acpi.c
index d0f38747cb..5e2d1425d3 100644
--- a/src/soc/intel/cannonlake/acpi.c
+++ b/src/soc/intel/cannonlake/acpi.c
@@ -131,7 +131,7 @@ acpi_cstate_t *soc_get_cstate_map(size_t *entries)
}
for (i = 0; i < *entries; i++) {
- memcpy(&map[i], &cstate_map[set[i]], sizeof(acpi_cstate_t));
+ map[i] = cstate_map[set[i]];
map[i].ctype = i + 1;
}
return map;
diff --git a/src/soc/intel/elkhartlake/acpi.c b/src/soc/intel/elkhartlake/acpi.c
index 7531331d25..e44a5d4eba 100644
--- a/src/soc/intel/elkhartlake/acpi.c
+++ b/src/soc/intel/elkhartlake/acpi.c
@@ -130,7 +130,7 @@ acpi_cstate_t *soc_get_cstate_map(size_t *entries)
}
for (i = 0; i < *entries; i++) {
- memcpy(&map[i], &cstate_map[set[i]], sizeof(acpi_cstate_t));
+ map[i] = cstate_map[set[i]];
map[i].ctype = i + 1;
}
return map;
diff --git a/src/soc/intel/icelake/acpi.c b/src/soc/intel/icelake/acpi.c
index fa6d038a51..f822e8323b 100644
--- a/src/soc/intel/icelake/acpi.c
+++ b/src/soc/intel/icelake/acpi.c
@@ -127,7 +127,7 @@ acpi_cstate_t *soc_get_cstate_map(size_t *entries)
}
for (i = 0; i < *entries; i++) {
- memcpy(&map[i], &cstate_map[set[i]], sizeof(acpi_cstate_t));
+ map[i] = cstate_map[set[i]];
map[i].ctype = i + 1;
}
return map;
diff --git a/src/soc/intel/jasperlake/acpi.c b/src/soc/intel/jasperlake/acpi.c
index cc7b8ae62f..28ed1f1970 100644
--- a/src/soc/intel/jasperlake/acpi.c
+++ b/src/soc/intel/jasperlake/acpi.c
@@ -130,7 +130,7 @@ acpi_cstate_t *soc_get_cstate_map(size_t *entries)
}
for (i = 0; i < *entries; i++) {
- memcpy(&map[i], &cstate_map[set[i]], sizeof(acpi_cstate_t));
+ map[i] = cstate_map[set[i]];
map[i].ctype = i + 1;
}
return map;
diff --git a/src/soc/intel/tigerlake/acpi.c b/src/soc/intel/tigerlake/acpi.c
index e560f11f69..bf03269344 100644
--- a/src/soc/intel/tigerlake/acpi.c
+++ b/src/soc/intel/tigerlake/acpi.c
@@ -130,7 +130,7 @@ acpi_cstate_t *soc_get_cstate_map(size_t *entries)
}
for (i = 0; i < *entries; i++) {
- memcpy(&map[i], &cstate_map[set[i]], sizeof(acpi_cstate_t));
+ map[i] = cstate_map[set[i]];
map[i].ctype = i + 1;
}
return map;