From patchwork Mon Feb 9 10:54:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 437917 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BA8D314012F for ; Mon, 9 Feb 2015 22:19:31 +1100 (AEDT) Received: from localhost ([::1]:60278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKmNF-00084l-UI for incoming@patchwork.ozlabs.org; Mon, 09 Feb 2015 06:19:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKm0K-0005NY-D9 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:55:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKm0J-0001Hz-D9 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:55:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKm0I-0001Hc-EV for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:55:46 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t19Atgb8002726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Feb 2015 05:55:42 -0500 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t19AsFNM027675; Mon, 9 Feb 2015 05:55:40 -0500 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 9 Feb 2015 10:54:14 +0000 Message-Id: <1423479254-15342-53-git-send-email-imammedo@redhat.com> In-Reply-To: <1423479254-15342-1-git-send-email-imammedo@redhat.com> References: <1423479254-15342-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH v3 52/52] acpi: make build_*() routines static to aml-build.c 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 build_*() routines were used for composing AML structures manually in acpi-build.c but after conversion to AML API they are not used outside of aml-build.c anymore, so hide them from external users. Signed-off-by: Igor Mammedov --- hw/acpi/aml-build.c | 22 +++++++++++----------- include/hw/acpi/aml-build.h | 17 ----------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 3f87d51..8f06f56 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -28,27 +28,27 @@ #include "qemu/bswap.h" #include "hw/acpi/bios-linker-loader.h" -GArray *build_alloc_array(void) +static GArray *build_alloc_array(void) { return g_array_new(false, true /* clear */, 1); } -void build_free_array(GArray *array) +static void build_free_array(GArray *array) { g_array_free(array, true); } -void build_prepend_byte(GArray *array, uint8_t val) +static void build_prepend_byte(GArray *array, uint8_t val) { g_array_prepend_val(array, val); } -void build_append_byte(GArray *array, uint8_t val) +static void build_append_byte(GArray *array, uint8_t val) { g_array_append_val(array, val); } -void build_append_array(GArray *array, GArray *val) +static void build_append_array(GArray *array, GArray *val) { g_array_append_vals(array, val->data, val->len); } @@ -142,7 +142,7 @@ build_append_namestringv(GArray *array, const char *format, va_list ap) g_strfreev(segs); } -void build_append_namestring(GArray *array, const char *format, ...) +static void build_append_namestring(GArray *array, const char *format, ...) { va_list ap; @@ -159,7 +159,7 @@ enum { PACKAGE_LENGTH_4BYTE_SHIFT = 20, }; -void +static void build_prepend_package_length(GArray *package, unsigned length, bool incl_self) { uint8_t byte; @@ -227,19 +227,19 @@ build_append_pkg_length(GArray *array, unsigned length, bool incl_self) build_free_array(tmp); } -void build_package(GArray *package, uint8_t op) +static void build_package(GArray *package, uint8_t op) { build_prepend_package_length(package, package->len, true); build_prepend_byte(package, op); } -void build_extop_package(GArray *package, uint8_t op) +static void build_extop_package(GArray *package, uint8_t op) { build_package(package, op); build_prepend_byte(package, 0x5B); /* ExtOpPrefix */ } -void build_append_value(GArray *table, uint64_t value, int size) +static void build_append_value(GArray *table, uint64_t value, int size) { int i; @@ -249,7 +249,7 @@ void build_append_value(GArray *table, uint64_t value, int size) } } -void build_append_int(GArray *table, uint64_t value) +static void build_append_int(GArray *table, uint64_t value) { if (value == 0x00) { build_append_byte(table, 0x00); /* ZeroOp */ diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 44cb7ea..7e9ce38 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -202,21 +202,4 @@ Aml *aml_resource_template(void); Aml *aml_field(const char *name, AmlFieldFlags flags); Aml *aml_varpackage(uint32_t num_elements); -/* other helpers */ -GArray *build_alloc_array(void); -void build_free_array(GArray *array); -void build_prepend_byte(GArray *array, uint8_t val); -void build_append_byte(GArray *array, uint8_t val); -void build_append_array(GArray *array, GArray *val); - -void GCC_FMT_ATTR(2, 3) -build_append_namestring(GArray *array, const char *format, ...); - -void -build_prepend_package_length(GArray *package, unsigned length, bool incl_self); -void build_package(GArray *package, uint8_t op); -void build_append_value(GArray *table, uint64_t value, int size); -void build_append_int(GArray *table, uint64_t value); -void build_extop_package(GArray *package, uint8_t op); - #endif