PraveenX Hodagatta Pranesh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30794
Change subject: mb/intel/kblrvp: Fix unsigned val casting of smaller size ......................................................................
mb/intel/kblrvp: Fix unsigned val casting of smaller size
Signed-off-by: Praveen hodagatta pranesh praveenx.hodagatta.pranesh@intel.com Change-Id: I519ed4b5b403622d6bb01ad0bdd04e01dedff7d8 --- M src/mainboard/intel/kblrvp/romstage.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/30794/1
diff --git a/src/mainboard/intel/kblrvp/romstage.c b/src/mainboard/intel/kblrvp/romstage.c index 47f8249..d0d5272 100644 --- a/src/mainboard/intel/kblrvp/romstage.c +++ b/src/mainboard/intel/kblrvp/romstage.c @@ -32,7 +32,7 @@ FSP_M_CONFIG *mem_cfg; mem_cfg = &mupd->FspmConfig; u8 spd_index = get_spd_index(); - if ((int)spd_index < 0) + if ((s8)spd_index < 0) return;
printk(BIOS_INFO, "SPD index %d\n", spd_index);
Hello Arthur Heymans, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30794
to look at the new patch set (#2).
Change subject: mb/intel/kblrvp: Fix unsigned val casting of smaller size ......................................................................
mb/intel/kblrvp: Fix unsigned val casting of smaller size
Signed-off-by: Praveen hodagatta pranesh praveenx.hodagatta.pranesh@intel.com Change-Id: I519ed4b5b403622d6bb01ad0bdd04e01dedff7d8 --- M src/mainboard/intel/kblrvp/board_id.c M src/mainboard/intel/kblrvp/board_id.h M src/mainboard/intel/kblrvp/romstage.c 3 files changed, 10 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/30794/2
PraveenX Hodagatta Pranesh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30794 )
Change subject: mb/intel/kblrvp: Fix unsigned val casting of smaller size ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/30794/1/src/mainboard/intel/kblrvp/romstage.... File src/mainboard/intel/kblrvp/romstage.c:
https://review.coreboot.org/#/c/30794/1/src/mainboard/intel/kblrvp/romstage.... PS1, Line 35: if ((s
While this works instead of juggling around types, it seems better to have get_spd_index return succ […]
Done
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30794 )
Change subject: mb/intel/kblrvp: Fix unsigned val casting of smaller size ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/30794 )
Change subject: mb/intel/kblrvp: Fix unsigned val casting of smaller size ......................................................................
mb/intel/kblrvp: Fix unsigned val casting of smaller size
Signed-off-by: Praveen hodagatta pranesh praveenx.hodagatta.pranesh@intel.com Change-Id: I519ed4b5b403622d6bb01ad0bdd04e01dedff7d8 Reviewed-on: https://review.coreboot.org/c/30794 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Arthur Heymans arthur@aheymans.xyz --- M src/mainboard/intel/kblrvp/board_id.c M src/mainboard/intel/kblrvp/board_id.h M src/mainboard/intel/kblrvp/romstage.c 3 files changed, 10 insertions(+), 7 deletions(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved
diff --git a/src/mainboard/intel/kblrvp/board_id.c b/src/mainboard/intel/kblrvp/board_id.c index d4c4f53..a978e0f 100644 --- a/src/mainboard/intel/kblrvp/board_id.c +++ b/src/mainboard/intel/kblrvp/board_id.c @@ -36,12 +36,13 @@ }
/* Get spd index */ -int get_spd_index(void) +int get_spd_index(u8 *spd_index) { int ec_info = get_ec_boardinfo(); - if (ec_info >= 0) - return ((uint16_t)ec_info >> 5) & 0x7; - + if (ec_info >= 0) { + *spd_index = ((uint16_t)ec_info >> 5) & 0x7; + return 0; + } return -1; }
diff --git a/src/mainboard/intel/kblrvp/board_id.h b/src/mainboard/intel/kblrvp/board_id.h index 239b76b..16eab69 100644 --- a/src/mainboard/intel/kblrvp/board_id.h +++ b/src/mainboard/intel/kblrvp/board_id.h @@ -16,6 +16,8 @@ #ifndef _MAINBOARD_BOARD_ID_H_ #define _MAINBOARD_BOARD_ID_H_
+#include <stdint.h> + /* Mobile Board Id 0x00 - 0xFF */ #define BOARD_ID_SKL_A0_RVP3 0x04 #define BOARD_ID_SKL_RVP7 0x0B @@ -36,7 +38,7 @@ int get_ec_boardinfo(void);
/* Return spd index */ -int get_spd_index(void); +int get_spd_index(u8 *spd_index);
/* Board id[15:8] */ int get_board_id(void); diff --git a/src/mainboard/intel/kblrvp/romstage.c b/src/mainboard/intel/kblrvp/romstage.c index 69c10bb..8e5ffcf 100644 --- a/src/mainboard/intel/kblrvp/romstage.c +++ b/src/mainboard/intel/kblrvp/romstage.c @@ -31,8 +31,8 @@ { FSP_M_CONFIG *mem_cfg; mem_cfg = &mupd->FspmConfig; - u8 spd_index = get_spd_index(); - if ((int)spd_index < 0) + u8 spd_index; + if (get_spd_index(&spd_index) < 0) return;
printk(BIOS_INFO, "SPD index %d\n", spd_index);