From patchwork Tue Jan 16 06:52:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1886954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TDfpg1TSXz1ydd for ; Tue, 16 Jan 2024 17:52:58 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rPdJZ-0001aF-FR; Tue, 16 Jan 2024 06:52:49 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rPdJS-0001a5-Vm for fwts-devel@lists.ubuntu.com; Tue, 16 Jan 2024 06:52:43 +0000 Received: from canonical.com (unknown [10.101.194.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 2B6233F6E9 for ; Tue, 16 Jan 2024 06:52:40 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: viot: fix build fail on bionic and focal Date: Tue, 16 Jan 2024 14:52:38 +0800 Message-Id: <20240116065238.231596-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" BugLing: https://bugs.launchpad.net/fwts/+bug/2049459 Got build fail below, acpi/viot/viot.c:76:5: error: a label can only be part of a statement and a declaration is not a statement 76 | fwts_acpi_viot_pci_rng_node *pci_rng = (fwts_acpi_viot_pci_rng_node *)(table->data + offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ acpi/viot/viot.c:93:5: error: a label can only be part of a statement and a declaration is not a statement 93 | fwts_acpi_viot_mmio_ep_node *mmio_ep = (fwts_acpi_viot_mmio_ep_node *)(table->data + offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ acpi/viot/viot.c:107:5: error: a label can only be part of a statement and a declaration is not a statement 107 | fwts_acpi_viot_pci_iommu_node *pci_iommu = (fwts_acpi_viot_pci_iommu_node *)(table->data + offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acpi/viot/viot.c:120:5: error: a label can only be part of a statement and a declaration is not a statement 120 | fwts_acpi_viot_mmio_iommu_node *mmio_iommu = (fwts_acpi_viot_mmio_iommu_node *)(table->data + offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ make[4]: *** [Makefile:4244: acpi/viot/fwts-viot.o] Error 1 Signed-off-by: Ivan Hu --- src/acpi/viot/viot.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/acpi/viot/viot.c b/src/acpi/viot/viot.c index 74394fec..b6c3cb50 100644 --- a/src/acpi/viot/viot.c +++ b/src/acpi/viot/viot.c @@ -71,9 +71,14 @@ static int viot_test1(fwts_framework *fw) return FWTS_OK; } + fwts_acpi_viot_pci_rng_node *pci_rng = NULL; + fwts_acpi_viot_mmio_ep_node *mmio_ep = NULL; + fwts_acpi_viot_pci_iommu_node *pci_iommu = NULL; + fwts_acpi_viot_mmio_iommu_node *mmio_iommu = NULL; + switch(node_hdr->type) { case 1: - fwts_acpi_viot_pci_rng_node *pci_rng = (fwts_acpi_viot_pci_rng_node *)(table->data + offset); + pci_rng = (fwts_acpi_viot_pci_rng_node *)(table->data + offset); fwts_log_info_verbatim(fw, " PCI Range Node Structure:"); fwts_log_info_simp_int(fw, " Type: ", pci_rng->hdr.type); fwts_log_info_simp_int(fw, " Reserved: ", pci_rng->hdr.reserved); @@ -90,7 +95,7 @@ static int viot_test1(fwts_framework *fw) offset += sizeof(fwts_acpi_viot_pci_rng_node); break; case 2: - fwts_acpi_viot_mmio_ep_node *mmio_ep = (fwts_acpi_viot_mmio_ep_node *)(table->data + offset); + mmio_ep = (fwts_acpi_viot_mmio_ep_node *)(table->data + offset); fwts_log_info_verbatim(fw, " Single MMIO Endpoint Node Structure:"); fwts_log_info_simp_int(fw, " Type: ", mmio_ep->hdr.type); fwts_log_info_simp_int(fw, " Reserved: ", mmio_ep->hdr.reserved); @@ -104,7 +109,7 @@ static int viot_test1(fwts_framework *fw) offset += sizeof(fwts_acpi_viot_mmio_ep_node); break; case 3: - fwts_acpi_viot_pci_iommu_node *pci_iommu = (fwts_acpi_viot_pci_iommu_node *)(table->data + offset); + pci_iommu = (fwts_acpi_viot_pci_iommu_node *)(table->data + offset); fwts_log_info_verbatim(fw, " Virtio-iommu based on virtio-pci Node Structure:"); fwts_log_info_simp_int(fw, " Type: ", pci_iommu->hdr.type); fwts_log_info_simp_int(fw, " Reserved: ", pci_iommu->hdr.reserved); @@ -117,7 +122,7 @@ static int viot_test1(fwts_framework *fw) offset += sizeof(fwts_acpi_viot_pci_iommu_node); break; case 4: - fwts_acpi_viot_mmio_iommu_node *mmio_iommu = (fwts_acpi_viot_mmio_iommu_node *)(table->data + offset); + mmio_iommu = (fwts_acpi_viot_mmio_iommu_node *)(table->data + offset); fwts_log_info_verbatim(fw, " Virtio-iommu based on virtio-pci Node Structure:"); fwts_log_info_simp_int(fw, " Type: ", mmio_iommu->hdr.type); fwts_log_info_simp_int(fw, " Reserved: ", mmio_iommu->hdr.reserved);