aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2023-12-04 23:40:05 -0500
committerMike Frysinger <vapier@gentoo.org>2023-12-04 23:41:31 -0500
commit9a9205a0c729f8eb2e9355af5e9ee52d55e967cf (patch)
tree4926c7afad95c2b21fcb9c7c84e079fa61b8ae03 /sim
parentc96b63a2e965dfcbb0f239ebb90ced7725d38f78 (diff)
downloadfsf-binutils-gdb-9a9205a0c729f8eb2e9355af5e9ee52d55e967cf.zip
fsf-binutils-gdb-9a9205a0c729f8eb2e9355af5e9ee52d55e967cf.tar.gz
fsf-binutils-gdb-9a9205a0c729f8eb2e9355af5e9ee52d55e967cf.tar.bz2
sim: ppc: fix implicit enum conversion
This code tries to use attach_type enums as hw_phb_decode, and while they're setup to have compatible values, the compiler doesn't like it when the cast is missing. So cast it explicitly and then use that. sim/ppc/hw_phb.c:322:28: error: implicit conversion from enumeration type 'attach_type' (aka 'enum _attach_type') to different enumeration type 'hw_phb_decode' [-Werror,-Wenum-conversion]
Diffstat (limited to 'sim')
-rw-r--r--sim/ppc/hw_phb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sim/ppc/hw_phb.c b/sim/ppc/hw_phb.c
index a3c1926..ec1119e 100644
--- a/sim/ppc/hw_phb.c
+++ b/sim/ppc/hw_phb.c
@@ -303,6 +303,7 @@ hw_phb_attach_address(device *me,
{
hw_phb_device *phb = device_data(me);
phb_space *pci_space;
+ hw_phb_decode phb_type = (hw_phb_decode)type;
/* sanity checks */
if (space < 0 || space >= nr_hw_phb_spaces)
device_error(me, "attach space (%d) specified by %s invalid",
@@ -312,14 +313,13 @@ hw_phb_attach_address(device *me,
|| addr < pci_space->my_base)
device_error(me, "attach addr (0x%lx) specified by %s outside of bus address range",
(unsigned long)addr, device_path(client));
- if ((hw_phb_decode)type != hw_phb_normal_decode
- && (hw_phb_decode)type != hw_phb_subtractive_decode)
+ if (phb_type != hw_phb_normal_decode && phb_type != hw_phb_subtractive_decode)
device_error(me, "attach type (%d) specified by %s invalid",
type, device_path(client));
/* attach it to the relevent bus */
DTRACE(phb, ("attach %s - %s %s:0x%lx (0x%lx bytes)\n",
device_path(client),
- hw_phb_decode_name(type),
+ hw_phb_decode_name(phb_type),
pci_space->name,
(unsigned long)addr,
(unsigned long)nr_bytes));