From patchwork Tue Dec 5 04:46:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 81333 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E1D113889830 for ; Tue, 5 Dec 2023 04:48:01 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 3A6C438582B6 for ; Tue, 5 Dec 2023 04:47:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A6C438582B6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3A6C438582B6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701751658; cv=none; b=psWMykMDm8gq0Q1YljiCgWevUmVrboMVjAK4n7LyN2ocbG+YnASCdqdMgwZB2pAU7O+4YBAabgis0pQjA2LmJVQdG7rid+TdTGrH9fR6I7QgMd6SHT0Bjh2zOSRGGlJ6eBhF2nv3IR++8b6Qavb2i47uAhSGlj+8uIzsam7k/GM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701751658; c=relaxed/simple; bh=82FvsvmX6QKkbe61wX9iifXgmcPtSdAP6GWEQiRkT1Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=hDzZMeOxt64Qo9sJE8sKV1ZmBPuMa1oMfQIaatUzcSawKcEQeoMAXzW4M62Iqs7Ho/cW9RCs+e/7KANtLvq/1kqlU9TRXztDj/1nVrdyoAwIqxxQu4Nx+SLMXQhTokWLMgaLYQHB6LYZy9BDrCWyl+lM9ZHDHTu8ZXV3xuOkXyY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 0D206335D7B; Tue, 5 Dec 2023 04:47:27 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 3/3 committed] sim: ppc: fix implicit enum conversion Date: Mon, 4 Dec 2023 23:46:16 -0500 Message-ID: <20231205044616.4000-3-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205044616.4000-1-vapier@gentoo.org> References: <20231205044616.4000-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org 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] --- sim/ppc/hw_phb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sim/ppc/hw_phb.c b/sim/ppc/hw_phb.c index a3c192642351..ec1119ee7d9b 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));