summaryrefslogtreecommitdiff
path: root/src/soc/intel/pantherlake/acpi.c
diff options
context:
space:
mode:
authorJeremy Compostella <jeremy.compostella@intel.com>2024-09-26 10:50:09 -0700
committerSubrata Banik <subratabanik@google.com>2024-09-27 17:04:24 +0000
commit2a3b9b2ad5849fa3980196f8733548b8976d804a (patch)
tree650cff0963d5572a4c9c613294180c865d46c68b /src/soc/intel/pantherlake/acpi.c
parentb29b66c5f5935e0dfab18cca10b69101b75ce508 (diff)
soc/intel/pantherlake: Comply with the no typedef coding style rule
As https://doc.coreboot.org/contributing/coding_style.html#typedefs states: "In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef". This commit makes the Intel Panther Lake SoC code comply with this by using explicitly `struct soc_intel_pantherlake_config' in the soc/intel/pantherlake code as I have been suggested to for the `fsp_params.c' files. The rule being the rule and consistency across a project matters more than personal preferences. The documentation lists five exceptions and none on them cover the use of `config_t' instead `struct soc_intel_pantherlake' but I believe it does not make the code better for the following three reasons: 1. It is repetitive, make the line longer and the code is in soc/intel/pantherlake so obviously the config_t data structure is the pantherlake soc configuration. 2. It makes re-usability from one generation to another unnecessarily harder. 3. This config_t abstraction is required for and used by some common block code anyway. Hence, we end-up with some code using `config_t' and other using the final structure which break the consistency of the code when the project in looked as a whole. BUG=348678529 TEST=Google fatcat mainboard compiles Change-Id: Ibe382615db1a7c7a0841d8fe4ae43c226e2c2021 Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84561 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Ronak Kanabar <ronak.kanabar@intel.com>
Diffstat (limited to 'src/soc/intel/pantherlake/acpi.c')
-rw-r--r--src/soc/intel/pantherlake/acpi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/soc/intel/pantherlake/acpi.c b/src/soc/intel/pantherlake/acpi.c
index 79e47e805e..fd17ef5ae2 100644
--- a/src/soc/intel/pantherlake/acpi.c
+++ b/src/soc/intel/pantherlake/acpi.c
@@ -126,7 +126,7 @@ const acpi_cstate_t *soc_get_cstate_map(size_t *entries)
if (c_state_initialized)
return map;
- config_t *config = config_of_soc();
+ const struct soc_intel_pantherlake_config *config = config_of_soc();
if (config == NULL) {
printk(BIOS_ERR, "Error: Configuration could not be retrieved.\n");
return NULL;
@@ -152,7 +152,7 @@ const acpi_cstate_t *soc_get_cstate_map(size_t *entries)
void soc_power_states_generation(int core_id, int cores_per_package)
{
- config_t *config = config_of_soc();
+ const struct soc_intel_pantherlake_config *config = config_of_soc();
if (config == NULL) {
printk(BIOS_ERR, "Error: Configuration could not be retrieved.\n");
return;
@@ -166,7 +166,7 @@ void soc_fill_fadt(acpi_fadt_t *fadt)
{
const uint16_t pmbase = ACPI_BASE_ADDRESS;
- config_t *config = config_of_soc();
+ const struct soc_intel_pantherlake_config *config = config_of_soc();
if (config == NULL) {
printk(BIOS_ERR, "Error: Configuration could not be retrieved.\n");
return;
@@ -339,7 +339,7 @@ unsigned long sa_write_acpi_tables(const struct device *dev, unsigned long curre
void soc_fill_gnvs(struct global_nvs *gnvs)
{
- config_t *config = config_of_soc();
+ const struct soc_intel_pantherlake_config *config = config_of_soc();
if (config == NULL) {
printk(BIOS_ERR, "Configuration could not be retrieved.\n");
return;