mb/intel/adlrvp: Replace if-else-if ladder with switch construct

The patch replaces if-else-if ladder with switch case for readability
purpose.

Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
Change-Id: I268db8bc63aaf64d4a91c9a44ef5282154b20a53
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47054
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Sridhar Siricilla 2020-10-30 11:45:24 +05:30 committed by Patrick Georgi
parent 06bff726d4
commit c046dd0232
1 changed files with 9 additions and 5 deletions

View File

@ -72,12 +72,16 @@ const struct mb_cfg *variant_memory_params(void)
{
int board_id = get_board_id();
if (board_id == ADL_P_LP4_1 || board_id == ADL_P_LP4_2)
switch (board_id) {
case ADL_P_LP4_1:
case ADL_P_LP4_2:
return &lpddr4_mem_config;
else if (board_id == ADL_P_DDR4_1 || board_id == ADL_P_DDR4_2)
case ADL_P_DDR4_1:
case ADL_P_DDR4_2:
return &ddr4_mem_config;
else if (board_id == ADL_P_DDR5)
case ADL_P_DDR5:
return &ddr5_mem_config;
default:
die("unsupported board id : 0x%x\n", board_id);
}
}