From 2a3b9b2ad5849fa3980196f8733548b8976d804a Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Thu, 26 Sep 2024 10:50:09 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/84561 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Ronak Kanabar --- src/soc/intel/pantherlake/espi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/soc/intel/pantherlake/espi.c') diff --git a/src/soc/intel/pantherlake/espi.c b/src/soc/intel/pantherlake/espi.c index a3952a31aa..02bec6f197 100644 --- a/src/soc/intel/pantherlake/espi.c +++ b/src/soc/intel/pantherlake/espi.c @@ -16,7 +16,7 @@ void soc_get_gen_io_dec_range(uint32_t gen_io_dec[LPC_NUM_GENERIC_IO_RANGES]) { - const config_t *config = config_of_soc(); + const struct soc_intel_pantherlake_config *config = config_of_soc(); gen_io_dec[0] = config->gen1_dec; gen_io_dec[1] = config->gen2_dec; -- cgit v1.2.3