blob: f2302dbcc3804b85b3a9314f121ba206ace25f0d [file] [log] [blame]
Andrew Geissler32b11992021-03-31 13:37:05 -05001Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
Andrew Geissler82c905d2020-04-13 13:39:40 -05003
Andrew Geissler32b11992021-03-31 13:37:05 -05004From 3a0c1966e4c66f91e6e8551e906b6db38002acb4 Mon Sep 17 00:00:00 2001
5From: Angel Pons <th3fanbus@gmail.com>
6Date: Wed, 27 May 2020 12:15:51 +0200
7Subject: [PATCH] libflashrom.c: Use casts on enum conversions
Andrew Geissler82c905d2020-04-13 13:39:40 -05008
Andrew Geissler32b11992021-03-31 13:37:05 -05009This allows flashrom to build with GCC 10.
Andrew Geissler82c905d2020-04-13 13:39:40 -050010
Andrew Geissler32b11992021-03-31 13:37:05 -050011Change-Id: I2166cdf3681452631ef8e980face2924e9a6c81a
12Signed-off-by: Angel Pons <th3fanbus@gmail.com>
13Reviewed-on: https://review.coreboot.org/c/flashrom/+/41775
14Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
15Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Andrew Geissler82c905d2020-04-13 13:39:40 -050016---
Andrew Geissler32b11992021-03-31 13:37:05 -050017 libflashrom.c | 6 ++++--
18 1 file changed, 4 insertions(+), 2 deletions(-)
Andrew Geissler82c905d2020-04-13 13:39:40 -050019
20diff --git a/libflashrom.c b/libflashrom.c
Andrew Geissler32b11992021-03-31 13:37:05 -050021index ab7e364..c20d9c7 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050022--- a/libflashrom.c
23+++ b/libflashrom.c
Andrew Geissler32b11992021-03-31 13:37:05 -050024@@ -188,7 +188,8 @@ struct flashrom_board_info *flashrom_supported_boards(void)
Andrew Geissler82c905d2020-04-13 13:39:40 -050025 for (; i < boards_known_size; ++i) {
26 supported_boards[i].vendor = binfo[i].vendor;
27 supported_boards[i].name = binfo[i].name;
28- supported_boards[i].working = binfo[i].working;
Andrew Geissler32b11992021-03-31 13:37:05 -050029+ supported_boards[i].working =
30+ (enum flashrom_test_state) binfo[i].working;
Andrew Geissler82c905d2020-04-13 13:39:40 -050031 }
32 } else {
33 msg_gerr("Memory allocation error!\n");
Andrew Geissler32b11992021-03-31 13:37:05 -050034@@ -226,7 +227,8 @@ struct flashrom_chipset_info *flashrom_supported_chipsets(void)
Andrew Geissler82c905d2020-04-13 13:39:40 -050035 supported_chipsets[i].chipset = chipset[i].device_name;
36 supported_chipsets[i].vendor_id = chipset[i].vendor_id;
37 supported_chipsets[i].chipset_id = chipset[i].device_id;
38- supported_chipsets[i].status = chipset[i].status;
Andrew Geissler32b11992021-03-31 13:37:05 -050039+ supported_chipsets[i].status =
40+ (enum flashrom_test_state) chipset[i].status;
Andrew Geissler82c905d2020-04-13 13:39:40 -050041 }
42 } else {
43 msg_gerr("Memory allocation error!\n");
44--
452.25.1