Martin L Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/67274 )
Change subject: mb/prodrive/hermes: Use snake case for identifiers ......................................................................
mb/prodrive/hermes: Use snake case for identifiers
There's no reason to use camel case for EEPROM region names or local variables. Use snake case for consistency with coreboot's code style.
Change-Id: Id1200a0c778095b109d824a1ca4e3e69591e4165 Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/67274 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Lean Sheng Tan sheng.tan@9elements.com Reviewed-by: Christian Walter christian.walter@9elements.com Reviewed-by: Martin L Roth gaumless@gmail.com --- M src/mainboard/prodrive/hermes/eeprom.c M src/mainboard/prodrive/hermes/eeprom.h 2 files changed, 35 insertions(+), 17 deletions(-)
Approvals: build bot (Jenkins): Verified Martin L Roth: Looks good to me, approved Lean Sheng Tan: Looks good to me, approved Christian Walter: Looks good to me, approved
diff --git a/src/mainboard/prodrive/hermes/eeprom.c b/src/mainboard/prodrive/hermes/eeprom.c index 5385a4a..7a92fe3 100644 --- a/src/mainboard/prodrive/hermes/eeprom.c +++ b/src/mainboard/prodrive/hermes/eeprom.c @@ -39,7 +39,7 @@ */ static bool get_board_settings_from_eeprom(struct eeprom_board_settings *board_cfg) { - const size_t board_settings_offset = offsetof(struct eeprom_layout, BoardSettings); + const size_t board_settings_offset = offsetof(struct eeprom_layout, board_settings);
if (eeprom_read_buffer(board_cfg, board_settings_offset, sizeof(*board_cfg))) { printk(BIOS_ERR, "CFG EEPROM: Failed to read board settings\n"); @@ -72,7 +72,7 @@
struct eeprom_bmc_settings *get_bmc_settings(void) { - const size_t bmc_settings_offset = offsetof(struct eeprom_layout, BMCSettings); + const size_t bmc_settings_offset = offsetof(struct eeprom_layout, bmc_settings); static struct eeprom_bmc_settings bmc_cfg = {0};
/* 0: uninitialized, 1: settings are valid */ @@ -120,10 +120,10 @@ break;
/* Write to UPD */ - uint8_t *writePointer = (uint8_t *)blob + i; - writePointer[0] = tmp[0]; + uint8_t *write_ptr = (uint8_t *)blob + i; + write_ptr[0] = tmp[0]; if (size - i > 1) - writePointer[1] = tmp[1]; + write_ptr[1] = tmp[1]; }
/* Restore I2C_EN bit */ @@ -182,7 +182,7 @@ */ bool write_board_settings(const struct eeprom_board_layout *new_layout) { - const size_t off = offsetof(struct eeprom_layout, BoardLayout); + const size_t off = offsetof(struct eeprom_layout, board_layout); struct eeprom_board_layout old_layout = {0}; bool ret = false; bool changed = false; diff --git a/src/mainboard/prodrive/hermes/eeprom.h b/src/mainboard/prodrive/hermes/eeprom.h index ad41d02..2f7eac7 100644 --- a/src/mainboard/prodrive/hermes/eeprom.h +++ b/src/mainboard/prodrive/hermes/eeprom.h @@ -73,27 +73,27 @@ /* The EEPROM on address 0x57 has the following vendor defined layout: */ struct __packed eeprom_layout { union { - uint8_t RawFSPMUPD[0x600]; + uint8_t raw_fspm_upd[0x600]; FSPM_UPD mupd; }; union { - uint8_t RawFSPSUPD[0xc00]; + uint8_t raw_fsps_upd[0xc00]; FSPS_UPD supd; }; union { - uint8_t RawBoardLayout[0x400]; - struct eeprom_board_layout BoardLayout; + uint8_t raw_board_layout[0x400]; + struct eeprom_board_layout board_layout; }; char system_serial_number[HERMES_SERIAL_NUMBER_LENGTH]; char board_serial_number[HERMES_SERIAL_NUMBER_LENGTH]; - uint8_t BootOrder[0x8c0]; + uint8_t boot_order[0x8c0]; union { - uint8_t RawBoardSetting[0xf8]; - struct eeprom_board_settings BoardSettings; + uint8_t raw_board_settings[0xf8]; + struct eeprom_board_settings board_settings; }; union { - uint8_t RawBMCSetting[0x8]; - struct eeprom_bmc_settings BMCSettings; + uint8_t raw_bmc_settings[0x8]; + struct eeprom_bmc_settings bmc_settings; }; };
@@ -123,5 +123,5 @@ } \ } while (0)
-#define READ_EEPROM_FSP_M(dest, opt_name) READ_EEPROM(FSPM_UPD, RawFSPMUPD, dest, opt_name) -#define READ_EEPROM_FSP_S(dest, opt_name) READ_EEPROM(FSPS_UPD, RawFSPSUPD, dest, opt_name) +#define READ_EEPROM_FSP_M(dest, opt_name) READ_EEPROM(FSPM_UPD, raw_fspm_upd, dest, opt_name) +#define READ_EEPROM_FSP_S(dest, opt_name) READ_EEPROM(FSPS_UPD, raw_fsps_upd, dest, opt_name)