From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCS9T-0001mQ-R3 for qemu-devel@nongnu.org; Wed, 30 Jul 2014 07:34:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCS9M-0001CV-OC for qemu-devel@nongnu.org; Wed, 30 Jul 2014 07:34:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCS9M-0001CH-HU for qemu-devel@nongnu.org; Wed, 30 Jul 2014 07:34:28 -0400 Date: Wed, 30 Jul 2014 13:34:42 +0200 From: "Michael S. Tsirkin" Message-ID: <1406720068-16482-3-git-send-email-mst@redhat.com> References: <1406720068-16482-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406720068-16482-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] acpi: cleanups tcpa table generation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , stefanb@linux.vnet.ibm.com Improve readability, no functional changes. Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 66cde2b..6ae3a9e 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1209,17 +1209,13 @@ build_hpet(GArray *table_data, GArray *linker) static void build_tpm_tcpa(GArray *table_data, GArray *linker) { - Acpi20Tcpa *tcpa; - uint32_t log_area_minimum_length = TPM_LOG_AREA_MINIMUM_SIZE; - uint64_t log_area_start_address; - size_t len = log_area_minimum_length + sizeof(*tcpa); + Acpi20Tcpa *tcpa = acpi_data_push(table_data, sizeof *tcpa); + uint64_t log_area_start_address = acpi_data_len(table_data); - log_area_start_address = table_data->len + sizeof(*tcpa); - - tcpa = acpi_data_push(table_data, len); + acpi_data_push(table_data, TPM_LOG_AREA_MINIMUM_SIZE); tcpa->platform_class = cpu_to_le16(TPM_TCPA_ACPI_CLASS_CLIENT); - tcpa->log_area_minimum_length = cpu_to_le32(log_area_minimum_length); + tcpa->log_area_minimum_length = cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE); tcpa->log_area_start_address = cpu_to_le64(log_area_start_address); /* LASA address to be filled by Guest linker */ -- MST