Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47054 )
Change subject: mb/intel/adlrvp: Replace if-else-if ladder with switch construct ......................................................................
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 --- M src/mainboard/intel/adlrvp/memory.c 1 file changed, 9 insertions(+), 5 deletions(-)
Approvals: build bot (Jenkins): Verified Subrata Banik: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/mainboard/intel/adlrvp/memory.c b/src/mainboard/intel/adlrvp/memory.c index d51caf7..cab4ef9 100644 --- a/src/mainboard/intel/adlrvp/memory.c +++ b/src/mainboard/intel/adlrvp/memory.c @@ -72,12 +72,16 @@ { 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; - - die("unsupported board id : 0x%x\n", board_id); + default: + die("unsupported board id : 0x%x\n", board_id); + } }