From patchwork Wed Jun 27 20:22:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 167734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A5CC4B6FF4 for ; Thu, 28 Jun 2012 06:22:52 +1000 (EST) Received: from localhost ([::1]:33594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjylF-0003F0-Uh for incoming@patchwork.ozlabs.org; Wed, 27 Jun 2012 16:22:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sjyl2-0003EU-4b for qemu-devel@nongnu.org; Wed, 27 Jun 2012 16:22:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sjykx-0003Ks-Ja for qemu-devel@nongnu.org; Wed, 27 Jun 2012 16:22:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sjykx-0003Im-9A for qemu-devel@nongnu.org; Wed, 27 Jun 2012 16:22:31 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5RKMR0F008600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Jun 2012 16:22:28 -0400 Received: from blackpad.lan.raisama.net (vpn1-4-120.gru2.redhat.com [10.97.4.120]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5RKMPU8032110; Wed, 27 Jun 2012 16:22:25 -0400 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 1E3412020C7; Wed, 27 Jun 2012 17:23:13 -0300 (BRT) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 27 Jun 2012 17:22:59 -0300 Message-Id: <1340828587-15201-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1340828587-15201-1-git-send-email-ehabkost@redhat.com> References: <1340828587-15201-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Isaku Yamahata , Michael Tokarev , Gleb Natapov Subject: [Qemu-devel] [PATCH 03/11] acpi_table_add(): rename 'len' to 'acpi_len' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 'len' is the length of just the ACPI data, not the length of the whole acpi_tables data (that has a QEMU-specific prefix), so rename it to make it more clear. No behavior change, just a variable rename. Signed-off-by: Eduardo Habkost --- hw/acpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/acpi.c b/hw/acpi.c index 6180c7a..abc959e 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -86,7 +86,7 @@ int acpi_table_add(const char *t) { char buf[1024], *p, *f; unsigned long val; - size_t len, start, allen; + size_t acpi_len, start, allen; bool has_header; int changed; int r; @@ -156,9 +156,9 @@ int acpi_table_add(const char *t) memcpy(&hdr, has_header ? f : dfl_hdr, ACPI_TABLE_HDR_SIZE); /* length of the table minus our prefix */ - len = allen - start - ACPI_TABLE_PFX_SIZE; + acpi_len = allen - start - ACPI_TABLE_PFX_SIZE; - hdr._length = cpu_to_le16(len); + hdr._length = cpu_to_le16(acpi_len); if (get_param_value(buf, sizeof(buf), "sig", t)) { strzcpy(hdr.sig, buf, sizeof(hdr.sig)); @@ -169,16 +169,16 @@ int acpi_table_add(const char *t) if (has_header) { /* check if actual length is correct */ val = le32_to_cpu(hdr.length); - if (val != len) { + if (val != acpi_len) { fprintf(stderr, "warning: acpitable has wrong length," " header says %lu, actual size %zu bytes\n", - val, len); + val, acpi_len); ++changed; } } /* we may avoid putting length here if has_header is true */ - hdr.length = cpu_to_le32(len); + hdr.length = cpu_to_le32(acpi_len); if (get_param_value(buf, sizeof(buf), "rev", t)) { val = strtoul(buf, &p, 0); @@ -241,7 +241,7 @@ int acpi_table_add(const char *t) if (changed || !has_header || 1) { ((struct acpi_table_header *)f)->checksum = - acpi_checksum((uint8_t *)f + ACPI_TABLE_PFX_SIZE, len); + acpi_checksum((uint8_t *)f + ACPI_TABLE_PFX_SIZE, acpi_len); } /* increase number of tables */