From patchwork Mon Oct 10 16:35:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 77447 Delivered-To: patch@linaro.org Received: by 10.140.21.82 with SMTP id 76csp9009qgk; Mon, 10 Oct 2016 09:38:03 -0700 (PDT) X-Received: by 10.200.39.220 with SMTP id x28mr21625653qtx.3.1476117483472; Mon, 10 Oct 2016 09:38:03 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g186si16453032qkc.121.2016.10.10.09.38.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 10 Oct 2016 09:38:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:51411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btdaU-0001sC-Tt for patch@linaro.org; Mon, 10 Oct 2016 12:38:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btdYQ-0000oE-4J for qemu-devel@nongnu.org; Mon, 10 Oct 2016 12:35:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btdYO-000606-4Z for qemu-devel@nongnu.org; Mon, 10 Oct 2016 12:35:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btdYJ-0005yA-4k; Mon, 10 Oct 2016 12:35:47 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9ACF3C04B95B; Mon, 10 Oct 2016 16:35:46 +0000 (UTC) Received: from kamzik.brq.redhat.com ([10.34.1.163]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9AGZhbu016657; Mon, 10 Oct 2016 12:35:45 -0400 From: Andrew Jones To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Mon, 10 Oct 2016 18:35:40 +0200 Message-Id: <1476117341-32690-2-git-send-email-drjones@redhat.com> In-Reply-To: <1476117341-32690-1-git-send-email-drjones@redhat.com> References: <1476117341-32690-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 10 Oct 2016 16:35:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] hw/arm/virt-acpi-build: fix MADT generation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, eric.auger@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We can't return early from build_* functions, as build_header is only called at the end. Signed-off-by: Andrew Jones --- hw/arm/virt-acpi-build.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 7b39b1d2d676..c31349561c95 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -556,15 +556,13 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info) gicr->base_address = cpu_to_le64(memmap[VIRT_GIC_REDIST].base); gicr->range_length = cpu_to_le32(memmap[VIRT_GIC_REDIST].size); - if (!its_class_name()) { - return; + if (its_class_name()) { + gic_its = acpi_data_push(table_data, sizeof *gic_its); + gic_its->type = ACPI_APIC_GENERIC_TRANSLATOR; + gic_its->length = sizeof(*gic_its); + gic_its->translation_id = 0; + gic_its->base_address = cpu_to_le64(memmap[VIRT_GIC_ITS].base); } - - gic_its = acpi_data_push(table_data, sizeof *gic_its); - gic_its->type = ACPI_APIC_GENERIC_TRANSLATOR; - gic_its->length = sizeof(*gic_its); - gic_its->translation_id = 0; - gic_its->base_address = cpu_to_le64(memmap[VIRT_GIC_ITS].base); } else { gic_msi = acpi_data_push(table_data, sizeof *gic_msi); gic_msi->type = ACPI_APIC_GENERIC_MSI_FRAME;