From afd268a0cb440c1ccfaec5593bffbfe49bcfbf24 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sun, 17 Oct 2021 13:35:23 +0200 Subject: cpu/intel/speedstep: Constify `get_cst_entries()` Make the `get_cst_entries()` function provide a read-only pointer. Also, constify the actual data where applicable. Change-Id: Ib22b3e37b086a95af770465a45222e9b84202e54 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/58393 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/mainboard/lenovo/t400/cstates.c | 4 ++-- src/mainboard/lenovo/t60/cstates.c | 4 ++-- src/mainboard/lenovo/thinkcentre_a58/cstates.c | 2 +- src/mainboard/lenovo/x200/cstates.c | 4 ++-- src/mainboard/lenovo/x60/cstates.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/mainboard/lenovo') diff --git a/src/mainboard/lenovo/t400/cstates.c b/src/mainboard/lenovo/t400/cstates.c index 57d0288286..b435d83c01 100644 --- a/src/mainboard/lenovo/t400/cstates.c +++ b/src/mainboard/lenovo/t400/cstates.c @@ -2,7 +2,7 @@ #include -static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { /* ACPI C1 / CPU C1 */ 1, 0x01, 1000, @@ -20,7 +20,7 @@ static acpi_cstate_t cst_entries[] = { }, }; -int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { *entries = cst_entries; return ARRAY_SIZE(cst_entries); diff --git a/src/mainboard/lenovo/t60/cstates.c b/src/mainboard/lenovo/t60/cstates.c index 7a1e4d6001..cc3f566f2f 100644 --- a/src/mainboard/lenovo/t60/cstates.c +++ b/src/mainboard/lenovo/t60/cstates.c @@ -3,13 +3,13 @@ #include #include -static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { 1, 1, 1000, { 0x7f, 1, 2, 0, 1, 0 } }, { 2, 1, 500, { 0x01, 8, 0, 0, DEFAULT_PMBASE + LV2, 0 } }, { 3, 17, 250, { 0x01, 8, 0, 0, DEFAULT_PMBASE + LV3, 0 } }, }; -int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { *entries = cst_entries; return ARRAY_SIZE(cst_entries); diff --git a/src/mainboard/lenovo/thinkcentre_a58/cstates.c b/src/mainboard/lenovo/thinkcentre_a58/cstates.c index 21b18b9e8d..4adf0edc63 100644 --- a/src/mainboard/lenovo/thinkcentre_a58/cstates.c +++ b/src/mainboard/lenovo/thinkcentre_a58/cstates.c @@ -2,7 +2,7 @@ #include -int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/lenovo/x200/cstates.c b/src/mainboard/lenovo/x200/cstates.c index 57d0288286..b435d83c01 100644 --- a/src/mainboard/lenovo/x200/cstates.c +++ b/src/mainboard/lenovo/x200/cstates.c @@ -2,7 +2,7 @@ #include -static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { /* ACPI C1 / CPU C1 */ 1, 0x01, 1000, @@ -20,7 +20,7 @@ static acpi_cstate_t cst_entries[] = { }, }; -int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { *entries = cst_entries; return ARRAY_SIZE(cst_entries); diff --git a/src/mainboard/lenovo/x60/cstates.c b/src/mainboard/lenovo/x60/cstates.c index c6237bc592..840c8a0d76 100644 --- a/src/mainboard/lenovo/x60/cstates.c +++ b/src/mainboard/lenovo/x60/cstates.c @@ -13,7 +13,7 @@ .addrh = 0, \ } -static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { .ctype = 1, .latency = 1, @@ -34,7 +34,7 @@ static acpi_cstate_t cst_entries[] = { }, }; -int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { *entries = cst_entries; return ARRAY_SIZE(cst_entries); -- cgit v1.2.3