Attention is currently required from: Stefan Ott, Damien Zammit, Evgeny Zinoviev, Alexander Couzens, Patrick Rudolph. Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58393 )
Change subject: cpu/intel/speedstep: Constify `get_cst_entries()` ......................................................................
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 th3fanbus@gmail.com --- M src/cpu/intel/speedstep/acpi.c M src/include/acpi/acpigen.h M src/mainboard/acer/g43t-am3/cstates.c M src/mainboard/apple/macbook21/cstates.c M src/mainboard/asrock/g41c-gs/cstates.c M src/mainboard/asus/p5gc-mx/cstates.c M src/mainboard/asus/p5qc/cstates.c M src/mainboard/asus/p5ql-em/cstates.c M src/mainboard/asus/p5qpl-am/cstates.c M src/mainboard/foxconn/d41s/cstates.c M src/mainboard/foxconn/g41s-k/cstates.c M src/mainboard/getac/p470/cstates.c M src/mainboard/gigabyte/ga-945gcm-s2l/cstates.c M src/mainboard/gigabyte/ga-d510ud/cstates.c M src/mainboard/gigabyte/ga-g41m-es2l/cstates.c M src/mainboard/ibase/mb899/cstates.c M src/mainboard/intel/d510mo/cstates.c M src/mainboard/intel/d945gclf/cstates.c M src/mainboard/intel/dg41wv/cstates.c M src/mainboard/intel/dg43gt/cstates.c M src/mainboard/kontron/986lcd-m/cstates.c M src/mainboard/lenovo/t400/cstates.c M src/mainboard/lenovo/t60/cstates.c M src/mainboard/lenovo/thinkcentre_a58/cstates.c M src/mainboard/lenovo/x200/cstates.c M src/mainboard/lenovo/x60/cstates.c M src/mainboard/roda/rk886ex/cstates.c M src/mainboard/roda/rk9/cstates.c 28 files changed, 36 insertions(+), 36 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/58393/1
diff --git a/src/cpu/intel/speedstep/acpi.c b/src/cpu/intel/speedstep/acpi.c index f1c5b99..b340b6d 100644 --- a/src/cpu/intel/speedstep/acpi.c +++ b/src/cpu/intel/speedstep/acpi.c @@ -88,7 +88,7 @@ CPUs share the same layout. */ int num_cstates; - acpi_cstate_t *cstates; + const acpi_cstate_t *cstates; sst_table_t pstates; uint8_t coordination;
diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index cf14c7f..3af0959 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -499,7 +499,7 @@ void acpigen_write_indexfield(const char *idx, const char *data, struct fieldlist *l, size_t count, uint8_t flags);
-int get_cst_entries(acpi_cstate_t **); +int get_cst_entries(const acpi_cstate_t **);
/* * Get element from package into specified destination op: diff --git a/src/mainboard/acer/g43t-am3/cstates.c b/src/mainboard/acer/g43t-am3/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/acer/g43t-am3/cstates.c +++ b/src/mainboard/acer/g43t-am3/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/apple/macbook21/cstates.c b/src/mainboard/apple/macbook21/cstates.c index 8f29504..13d06f0 100644 --- a/src/mainboard/apple/macbook21/cstates.c +++ b/src/mainboard/apple/macbook21/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { .ctype = 1, .latency = 1, @@ -31,7 +31,7 @@ }, };
-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/asrock/g41c-gs/cstates.c b/src/mainboard/asrock/g41c-gs/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/asrock/g41c-gs/cstates.c +++ b/src/mainboard/asrock/g41c-gs/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/asus/p5gc-mx/cstates.c b/src/mainboard/asus/p5gc-mx/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/asus/p5gc-mx/cstates.c +++ b/src/mainboard/asus/p5gc-mx/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/asus/p5qc/cstates.c b/src/mainboard/asus/p5qc/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/asus/p5qc/cstates.c +++ b/src/mainboard/asus/p5qc/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/asus/p5ql-em/cstates.c b/src/mainboard/asus/p5ql-em/cstates.c index 791f78e..7f17b9f 100644 --- a/src/mainboard/asus/p5ql-em/cstates.c +++ b/src/mainboard/asus/p5ql-em/cstates.c @@ -3,7 +3,7 @@ #include <acpi/acpigen.h>
/* TODO: Could work... */ -int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/asus/p5qpl-am/cstates.c b/src/mainboard/asus/p5qpl-am/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/asus/p5qpl-am/cstates.c +++ b/src/mainboard/asus/p5qpl-am/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/foxconn/d41s/cstates.c b/src/mainboard/foxconn/d41s/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/foxconn/d41s/cstates.c +++ b/src/mainboard/foxconn/d41s/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/foxconn/g41s-k/cstates.c b/src/mainboard/foxconn/g41s-k/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/foxconn/g41s-k/cstates.c +++ b/src/mainboard/foxconn/g41s-k/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/getac/p470/cstates.c b/src/mainboard/getac/p470/cstates.c index 2b9997e..6c2d8bf 100644 --- a/src/mainboard/getac/p470/cstates.c +++ b/src/mainboard/getac/p470/cstates.c @@ -3,7 +3,7 @@ #include <acpi/acpigen.h> #include <southbridge/intel/i82801gx/i82801gx.h>
-static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { /* ACPI C1 / CPU C1 */ 1, 0x01, 1000, @@ -21,7 +21,7 @@ }, };
-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/gigabyte/ga-945gcm-s2l/cstates.c b/src/mainboard/gigabyte/ga-945gcm-s2l/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/gigabyte/ga-945gcm-s2l/cstates.c +++ b/src/mainboard/gigabyte/ga-945gcm-s2l/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/gigabyte/ga-d510ud/cstates.c b/src/mainboard/gigabyte/ga-d510ud/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/gigabyte/ga-d510ud/cstates.c +++ b/src/mainboard/gigabyte/ga-d510ud/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/gigabyte/ga-g41m-es2l/cstates.c b/src/mainboard/gigabyte/ga-g41m-es2l/cstates.c index 0a7b9b9..f4cf4ce 100644 --- a/src/mainboard/gigabyte/ga-g41m-es2l/cstates.c +++ b/src/mainboard/gigabyte/ga-g41m-es2l/cstates.c @@ -2,9 +2,9 @@
#include <acpi/acpigen.h>
-static acpi_cstate_t cst_entries[] = {}; +static const 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/ibase/mb899/cstates.c b/src/mainboard/ibase/mb899/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/ibase/mb899/cstates.c +++ b/src/mainboard/ibase/mb899/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/intel/d510mo/cstates.c b/src/mainboard/intel/d510mo/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/intel/d510mo/cstates.c +++ b/src/mainboard/intel/d510mo/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/intel/d945gclf/cstates.c b/src/mainboard/intel/d945gclf/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/intel/d945gclf/cstates.c +++ b/src/mainboard/intel/d945gclf/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/intel/dg41wv/cstates.c b/src/mainboard/intel/dg41wv/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/intel/dg41wv/cstates.c +++ b/src/mainboard/intel/dg41wv/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/intel/dg43gt/cstates.c b/src/mainboard/intel/dg43gt/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/intel/dg43gt/cstates.c +++ b/src/mainboard/intel/dg43gt/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/kontron/986lcd-m/cstates.c b/src/mainboard/kontron/986lcd-m/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/kontron/986lcd-m/cstates.c +++ b/src/mainboard/kontron/986lcd-m/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-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/t400/cstates.c b/src/mainboard/lenovo/t400/cstates.c index 57d0288..b435d83 100644 --- a/src/mainboard/lenovo/t400/cstates.c +++ b/src/mainboard/lenovo/t400/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { /* ACPI C1 / CPU C1 */ 1, 0x01, 1000, @@ -20,7 +20,7 @@ }, };
-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 7a1e4d6..cc3f566 100644 --- a/src/mainboard/lenovo/t60/cstates.c +++ b/src/mainboard/lenovo/t60/cstates.c @@ -3,13 +3,13 @@ #include <acpi/acpigen.h> #include <southbridge/intel/i82801gx/i82801gx.h>
-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 21b18b9..4adf0ed 100644 --- a/src/mainboard/lenovo/thinkcentre_a58/cstates.c +++ b/src/mainboard/lenovo/thinkcentre_a58/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-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 57d0288..b435d83 100644 --- a/src/mainboard/lenovo/x200/cstates.c +++ b/src/mainboard/lenovo/x200/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { /* ACPI C1 / CPU C1 */ 1, 0x01, 1000, @@ -20,7 +20,7 @@ }, };
-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 c6237bc..840c8a0 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 @@ }, };
-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/roda/rk886ex/cstates.c b/src/mainboard/roda/rk886ex/cstates.c index 21b18b9..4adf0ed 100644 --- a/src/mainboard/roda/rk886ex/cstates.c +++ b/src/mainboard/roda/rk886ex/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-int get_cst_entries(acpi_cstate_t **entries) +int get_cst_entries(const acpi_cstate_t **entries) { return 0; } diff --git a/src/mainboard/roda/rk9/cstates.c b/src/mainboard/roda/rk9/cstates.c index 0f85da1..ed49994 100644 --- a/src/mainboard/roda/rk9/cstates.c +++ b/src/mainboard/roda/rk9/cstates.c @@ -2,7 +2,7 @@
#include <acpi/acpigen.h>
-static acpi_cstate_t cst_entries[] = { +static const acpi_cstate_t cst_entries[] = { { /* ACPI C1 / CPU C1 */ 1, 0x01, 1000, @@ -15,7 +15,7 @@ }, };
-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);