Change in coreboot[master]: mb/intel/adlrvp: Replace if-else-if ladder with switch construct
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); + } } -- To view, visit https://review.coreboot.org/c/coreboot/+/47054 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I268db8bc63aaf64d4a91c9a44ef5282154b20a53 Gerrit-Change-Number: 47054 Gerrit-PatchSet: 7 Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla@intel.com> Gerrit-Reviewer: Aamir Bohra <aamir.bohra@intel.com> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Furquan Shaikh <furquan@google.com> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> Gerrit-Reviewer: Subrata Banik <subrata.banik@intel.com> Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak@chromium.org> Gerrit-Reviewer: V Sowmya <v.sowmya@intel.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-MessageType: merged
participants (1)
-
Patrick Georgi (Code Review)