All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] ACPICA 20121114 Release
@ 2012-11-21 10:06 Lv Zheng
  2012-11-21 10:06 ` [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences Lv Zheng
                   ` (16 more replies)
  0 siblings, 17 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:06 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

The 20121114 ACPICA linuxized patches are based on the pm/linux-next branch.
Please review though the patches have passed the basic build & boot tests.

Bob Moore (6):
  ACPICA: Performance: Remove function tracing from critical allocation
    functions.
  ACPICA: Debugger: Major update for the Disassemble<method> command.
  ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags.
  ACPICA: Add macros to extract flag bits from resource descriptors.
  ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure.
  ACPICA: Update version to 20121114.

Chao Guan (1):
  ACPICA: Performance enhancement for ACPI package objects.

Jesper Juhl (1):
  ACPICA: Fix possible memory leak.

Lv Zheng (7):
  ACPICA: Fixes unmerged (dis)assember divergences.
  ACPICA: Fixes comments caused divergences.
  ACPICA: Fixes indent caused divergences.
  ACPICA: Fixes code maintenance divergences.
  ACPICA: Fixes call depth check caused divergences.
  ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros.
  ACPICA: Resource Manager: update template walking with
    ACPI_NEXT_RESOURCE.

 drivers/acpi/acpica/accommon.h  |    1 +
 drivers/acpi/acpica/acdisasm.h  |  647 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/acglobal.h  |   35 ++-
 drivers/acpi/acpica/aclocal.h   |   38 ++-
 drivers/acpi/acpica/acmacros.h  |   34 +-
 drivers/acpi/acpica/acobject.h  |    2 +-
 drivers/acpi/acpica/acpredef.h  |   14 +-
 drivers/acpi/acpica/acutils.h   |    7 +-
 drivers/acpi/acpica/amlresrc.h  |    6 +
 drivers/acpi/acpica/dsmethod.c  |    7 +-
 drivers/acpi/acpica/dsobject.c  |    2 +-
 drivers/acpi/acpica/dsopcode.c  |   14 +-
 drivers/acpi/acpica/dswload.c   |    5 +-
 drivers/acpi/acpica/evgpe.c     |    6 +-
 drivers/acpi/acpica/evxface.c   |   34 +-
 drivers/acpi/acpica/evxfevnt.c  |    4 +-
 drivers/acpi/acpica/evxfgpe.c   |    9 +-
 drivers/acpi/acpica/exconfig.c  |   13 +-
 drivers/acpi/acpica/exfldio.c   |    1 -
 drivers/acpi/acpica/exmutex.c   |    3 +-
 drivers/acpi/acpica/exoparg1.c  |    8 +-
 drivers/acpi/acpica/exregion.c  |   23 +-
 drivers/acpi/acpica/hwacpi.c    |    3 +-
 drivers/acpi/acpica/hwesleep.c  |    1 -
 drivers/acpi/acpica/hwgpe.c     |    6 +-
 drivers/acpi/acpica/hwregs.c    |    6 +-
 drivers/acpi/acpica/hwsleep.c   |    3 +-
 drivers/acpi/acpica/hwvalid.c   |   18 +-
 drivers/acpi/acpica/hwxface.c   |    2 +-
 drivers/acpi/acpica/hwxfsleep.c |    7 +-
 drivers/acpi/acpica/nsdump.c    |    4 +-
 drivers/acpi/acpica/nsdumpdv.c  |    1 -
 drivers/acpi/acpica/nsnames.c   |    3 +-
 drivers/acpi/acpica/nspredef.c  |    3 +-
 drivers/acpi/acpica/nsrepair2.c |    3 +-
 drivers/acpi/acpica/nssearch.c  |    5 +
 drivers/acpi/acpica/nsutils.c   |   13 +-
 drivers/acpi/acpica/nswalk.c    |    4 +-
 drivers/acpi/acpica/nsxfeval.c  |    4 +-
 drivers/acpi/acpica/nsxfname.c  |   16 +-
 drivers/acpi/acpica/psutils.c   |    2 +-
 drivers/acpi/acpica/rscalc.c    |    6 +-
 drivers/acpi/acpica/rscreate.c  |    7 +-
 drivers/acpi/acpica/rsdump.c    |    9 +-
 drivers/acpi/acpica/rsirq.c     |    6 +-
 drivers/acpi/acpica/rslist.c    |    7 +-
 drivers/acpi/acpica/rsmemory.c  |    6 +-
 drivers/acpi/acpica/rsmisc.c    |   74 +++--
 drivers/acpi/acpica/rsutils.c   |    8 +-
 drivers/acpi/acpica/rsxface.c   |    4 +-
 drivers/acpi/acpica/tbfadt.c    |    5 +-
 drivers/acpi/acpica/tbutils.c   |    6 +-
 drivers/acpi/acpica/utcopy.c    |    4 +-
 drivers/acpi/acpica/utdelete.c  |   68 ++--
 drivers/acpi/acpica/uteval.c    |    2 +-
 drivers/acpi/acpica/utglobal.c  |    9 +-
 drivers/acpi/acpica/utlock.c    |   14 +-
 drivers/acpi/acpica/utmisc.c    |    8 +-
 drivers/acpi/acpica/utobject.c  |    2 +-
 drivers/acpi/acpica/utresrc.c   |   81 ++---
 drivers/acpi/acpica/utstate.c   |   40 ++-
 drivers/acpi/acpica/uttrack.c   |   16 +-
 drivers/acpi/acpica/utxface.c   |    4 -
 drivers/acpi/acpica/utxferror.c |    4 +-
 include/acpi/acconfig.h         |    2 +-
 include/acpi/acpiosxf.h         |    9 +-
 include/acpi/acpixf.h           |   57 ++--
 include/acpi/acrestyp.h         |    5 +-
 include/acpi/actbl1.h           |    6 +-
 include/acpi/actypes.h          |    4 +-
 include/acpi/platform/acenv.h   |   97 ++++--
 71 files changed, 1184 insertions(+), 403 deletions(-)
 create mode 100644 drivers/acpi/acpica/acdisasm.h

-- 
1.7.10


^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
@ 2012-11-21 10:06 ` Lv Zheng
  2012-11-27  2:58   ` Brown, Len
  2012-11-21 10:07 ` [PATCH 02/15] ACPICA: Fixes comments caused divergences Lv Zheng
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:06 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

Assembler and Disassembler updates in the ACPICA were ignored in the past by
the ACPICA Linux release. This will introduce divergences between the Linux
and the ACPICA.
This patch ports the required updates of such utilities to Linux to reduce
the divergences.

This patch will not affect the generated vmlinux binary.
This will decrease 82 lines of 20121018 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acdisasm.h |  641 ++++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/acglobal.h |    2 +
 drivers/acpi/acpica/aclocal.h  |   25 ++
 drivers/acpi/acpica/dsmethod.c |    4 +-
 drivers/acpi/acpica/dswload.c  |    5 +-
 drivers/acpi/acpica/nssearch.c |    5 +
 drivers/acpi/acpica/utglobal.c |    4 +
 include/acpi/platform/acenv.h  |    3 +-
 8 files changed, 683 insertions(+), 6 deletions(-)
 create mode 100644 drivers/acpi/acpica/acdisasm.h

diff --git a/drivers/acpi/acpica/acdisasm.h b/drivers/acpi/acpica/acdisasm.h
new file mode 100644
index 0000000..4294f58
--- /dev/null
+++ b/drivers/acpi/acpica/acdisasm.h
@@ -0,0 +1,641 @@
+/******************************************************************************
+ *
+ * Name: acdisasm.h - AML disassembler
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACDISASM_H__
+#define __ACDISASM_H__
+
+#ifdef ACPI_DISASSEMBLER
+
+#include "amlresrc.h"
+
+#define BLOCK_NONE              0
+#define BLOCK_PAREN             1
+#define BLOCK_BRACE             2
+#define BLOCK_COMMA_LIST        4
+#define ACPI_DEFAULT_RESNAME    *(u32 *) "__RD"
+
+/*
+ * Raw table data header. Used by disassembler and data table compiler.
+ * Do not change.
+ */
+#define ACPI_RAW_TABLE_DATA_HEADER      "Raw Table Data"
+
+typedef const struct acpi_dmtable_info {
+	u8 opcode;
+	u16 offset;
+	char *name;
+	u8 flags;
+
+} acpi_dmtable_info;
+
+#define DT_LENGTH                       0x01	/* Field is a subtable length */
+#define DT_FLAG                         0x02	/* Field is a flag value */
+#define DT_NON_ZERO                     0x04	/* Field must be non-zero */
+
+/* TBD: Not used at this time */
+
+#define DT_OPTIONAL                     0x08
+#define DT_COUNT                        0x10
+
+/*
+ * Values for Opcode above.
+ * Note: 0-7 must not change, they are used as a flag shift value. Other
+ * than those, new values can be added wherever appropriate.
+ */
+typedef enum {
+	/* Simple Data Types */
+
+	ACPI_DMT_FLAG0 = 0,
+	ACPI_DMT_FLAG1 = 1,
+	ACPI_DMT_FLAG2 = 2,
+	ACPI_DMT_FLAG3 = 3,
+	ACPI_DMT_FLAG4 = 4,
+	ACPI_DMT_FLAG5 = 5,
+	ACPI_DMT_FLAG6 = 6,
+	ACPI_DMT_FLAG7 = 7,
+	ACPI_DMT_FLAGS0,
+	ACPI_DMT_FLAGS1,
+	ACPI_DMT_FLAGS2,
+	ACPI_DMT_FLAGS4,
+	ACPI_DMT_UINT8,
+	ACPI_DMT_UINT16,
+	ACPI_DMT_UINT24,
+	ACPI_DMT_UINT32,
+	ACPI_DMT_UINT40,
+	ACPI_DMT_UINT48,
+	ACPI_DMT_UINT56,
+	ACPI_DMT_UINT64,
+	ACPI_DMT_BUF7,
+	ACPI_DMT_BUF16,
+	ACPI_DMT_BUF128,
+	ACPI_DMT_SIG,
+	ACPI_DMT_STRING,
+	ACPI_DMT_NAME4,
+	ACPI_DMT_NAME6,
+	ACPI_DMT_NAME8,
+
+	/* Types that are decoded to strings and miscellaneous */
+
+	ACPI_DMT_ACCWIDTH,
+	ACPI_DMT_CHKSUM,
+	ACPI_DMT_GAS,
+	ACPI_DMT_SPACEID,
+	ACPI_DMT_UNICODE,
+	ACPI_DMT_UUID,
+
+	/* Types used only for the Data Table Compiler */
+
+	ACPI_DMT_BUFFER,
+	ACPI_DMT_DEVICE_PATH,
+	ACPI_DMT_LABEL,
+	ACPI_DMT_PCI_PATH,
+
+	/* Types that are specific to particular ACPI tables */
+
+	ACPI_DMT_ASF,
+	ACPI_DMT_DMAR,
+	ACPI_DMT_EINJACT,
+	ACPI_DMT_EINJINST,
+	ACPI_DMT_ERSTACT,
+	ACPI_DMT_ERSTINST,
+	ACPI_DMT_FADTPM,
+	ACPI_DMT_HEST,
+	ACPI_DMT_HESTNTFY,
+	ACPI_DMT_HESTNTYP,
+	ACPI_DMT_IVRS,
+	ACPI_DMT_MADT,
+	ACPI_DMT_PMTT,
+	ACPI_DMT_SLIC,
+	ACPI_DMT_SRAT,
+
+	/* Special opcodes */
+
+	ACPI_DMT_EXTRA_TEXT,
+	ACPI_DMT_EXIT
+} ACPI_ENTRY_TYPES;
+
+typedef
+void (*acpi_dmtable_handler) (struct acpi_table_header * table);
+
+typedef acpi_status(*acpi_cmtable_handler) (void **pfield_list);
+
+struct acpi_dmtable_data {
+	char *signature;
+	struct acpi_dmtable_info *table_info;
+	acpi_dmtable_handler table_handler;
+	acpi_cmtable_handler cm_table_handler;
+	const unsigned char *template;
+	char *name;
+};
+
+struct acpi_op_walk_info {
+	u32 level;
+	u32 last_level;
+	u32 count;
+	u32 bit_offset;
+	u32 flags;
+	struct acpi_walk_state *walk_state;
+};
+
+/*
+ * TBD - another copy of this is in asltypes.h, fix
+ */
+#ifndef ASL_WALK_CALLBACK_DEFINED
+typedef
+acpi_status(*asl_walk_callback) (union acpi_parse_object * op,
+				 u32 level, void *context);
+#define ASL_WALK_CALLBACK_DEFINED
+#endif
+
+typedef
+void (*acpi_resource_handler) (union aml_resource * resource,
+			       u32 length, u32 level);
+
+struct acpi_resource_tag {
+	u32 bit_index;
+	char *tag;
+};
+
+/* Strings used for decoding flags to ASL keywords */
+
+extern const char *acpi_gbl_word_decode[];
+extern const char *acpi_gbl_irq_decode[];
+extern const char *acpi_gbl_lock_rule[];
+extern const char *acpi_gbl_access_types[];
+extern const char *acpi_gbl_update_rules[];
+extern const char *acpi_gbl_match_ops[];
+
+extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf1a[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf2a[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
+extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
+extern struct acpi_dmtable_info acpi_dm_table_info_bert[];
+extern struct acpi_dmtable_info acpi_dm_table_info_bgrt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
+extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_csrt0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_csrt1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dbg2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dbg2_device[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dbg2_addr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dbg2_size[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dbg2_name[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_dmar3[];
+extern struct acpi_dmtable_info acpi_dm_table_info_drtm[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_einj[];
+extern struct acpi_dmtable_info acpi_dm_table_info_einj0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_erst[];
+extern struct acpi_dmtable_info acpi_dm_table_info_erst0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
+extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_fadt3[];
+extern struct acpi_dmtable_info acpi_dm_table_info_fadt5[];
+extern struct acpi_dmtable_info acpi_dm_table_info_fpdt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_fpdt_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_fpdt0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_fpdt1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_gas[];
+extern struct acpi_dmtable_info acpi_dm_table_info_gtdt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_header[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest6[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest7[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest8[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest9[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest_notify[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest_bank[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hpet[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ivrs[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ivrs0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ivrs1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ivrs4[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ivrs8a[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ivrs8b[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ivrs8c[];
+extern struct acpi_dmtable_info acpi_dm_table_info_ivrs_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt3[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt4[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt5[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt6[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt7[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt8[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt9[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt10[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt11[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt12[];
+extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mchi[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mpst[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mpst0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mpst0_a[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mpst0_b[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mpst1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_mpst2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_msct[];
+extern struct acpi_dmtable_info acpi_dm_table_info_msct0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_pmtt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_pmtt0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_pmtt1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_pmtt1a[];
+extern struct acpi_dmtable_info acpi_dm_table_info_pmtt2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_pmtt_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_pcct[];
+extern struct acpi_dmtable_info acpi_dm_table_info_pcct0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_s3pt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_s3pt_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_s3pt0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_s3pt1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_sbst[];
+extern struct acpi_dmtable_info acpi_dm_table_info_slic_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_slic0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_slic1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_slit[];
+extern struct acpi_dmtable_info acpi_dm_table_info_spcr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_spmi[];
+extern struct acpi_dmtable_info acpi_dm_table_info_srat[];
+extern struct acpi_dmtable_info acpi_dm_table_info_srat_hdr[];
+extern struct acpi_dmtable_info acpi_dm_table_info_srat0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_srat1[];
+extern struct acpi_dmtable_info acpi_dm_table_info_srat2[];
+extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[];
+extern struct acpi_dmtable_info acpi_dm_table_info_uefi[];
+extern struct acpi_dmtable_info acpi_dm_table_info_waet[];
+extern struct acpi_dmtable_info acpi_dm_table_info_wdat[];
+extern struct acpi_dmtable_info acpi_dm_table_info_wdat0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_wddt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[];
+
+extern struct acpi_dmtable_info acpi_dm_table_info_generic[][2];
+
+/*
+ * dmtable
+ */
+extern struct acpi_dmtable_data acpi_dm_table_data[];
+
+u8 acpi_dm_generate_checksum(void *table, u32 length, u8 original_checksum);
+
+struct acpi_dmtable_data *acpi_dm_get_table_data(char *signature);
+
+void acpi_dm_dump_data_table(struct acpi_table_header *table);
+
+acpi_status
+acpi_dm_dump_table(u32 table_length,
+		   u32 table_offset,
+		   void *table,
+		   u32 sub_table_length, struct acpi_dmtable_info *info);
+
+void acpi_dm_line_header(u32 offset, u32 byte_length, char *name);
+
+void acpi_dm_line_header2(u32 offset, u32 byte_length, char *name, u32 value);
+
+/*
+ * dmtbdump
+ */
+void acpi_dm_dump_asf(struct acpi_table_header *table);
+
+void acpi_dm_dump_cpep(struct acpi_table_header *table);
+
+void acpi_dm_dump_csrt(struct acpi_table_header *table);
+
+void acpi_dm_dump_dbg2(struct acpi_table_header *table);
+
+void acpi_dm_dump_dmar(struct acpi_table_header *table);
+
+void acpi_dm_dump_einj(struct acpi_table_header *table);
+
+void acpi_dm_dump_erst(struct acpi_table_header *table);
+
+void acpi_dm_dump_fadt(struct acpi_table_header *table);
+
+void acpi_dm_dump_fpdt(struct acpi_table_header *table);
+
+void acpi_dm_dump_hest(struct acpi_table_header *table);
+
+void acpi_dm_dump_ivrs(struct acpi_table_header *table);
+
+void acpi_dm_dump_madt(struct acpi_table_header *table);
+
+void acpi_dm_dump_mcfg(struct acpi_table_header *table);
+
+void acpi_dm_dump_mpst(struct acpi_table_header *table);
+
+void acpi_dm_dump_msct(struct acpi_table_header *table);
+
+void acpi_dm_dump_pcct(struct acpi_table_header *table);
+
+void acpi_dm_dump_pmtt(struct acpi_table_header *table);
+
+u32 acpi_dm_dump_rsdp(struct acpi_table_header *table);
+
+void acpi_dm_dump_rsdt(struct acpi_table_header *table);
+
+u32 acpi_dm_dump_s3pt(struct acpi_table_header *table);
+
+void acpi_dm_dump_slic(struct acpi_table_header *table);
+
+void acpi_dm_dump_slit(struct acpi_table_header *table);
+
+void acpi_dm_dump_srat(struct acpi_table_header *table);
+
+void acpi_dm_dump_wdat(struct acpi_table_header *table);
+
+void acpi_dm_dump_xsdt(struct acpi_table_header *table);
+
+/*
+ * dmwalk
+ */
+void
+acpi_dm_disassemble(struct acpi_walk_state *walk_state,
+		    union acpi_parse_object *origin, u32 num_opcodes);
+
+void
+acpi_dm_walk_parse_tree(union acpi_parse_object *op,
+			asl_walk_callback descending_callback,
+			asl_walk_callback ascending_callback, void *context);
+
+/*
+ * dmopcode
+ */
+void
+acpi_dm_disassemble_one_op(struct acpi_walk_state *walk_state,
+			   struct acpi_op_walk_info *info,
+			   union acpi_parse_object *op);
+
+void acpi_dm_decode_internal_object(union acpi_operand_object *obj_desc);
+
+u32 acpi_dm_list_type(union acpi_parse_object *op);
+
+void acpi_dm_method_flags(union acpi_parse_object *op);
+
+void acpi_dm_predefined_description(union acpi_parse_object *op);
+
+void acpi_dm_field_predefined_description(union acpi_parse_object *op);
+
+void acpi_dm_field_flags(union acpi_parse_object *op);
+
+void acpi_dm_address_space(u8 space_id);
+
+void acpi_dm_region_flags(union acpi_parse_object *op);
+
+void acpi_dm_match_op(union acpi_parse_object *op);
+
+/*
+ * dmnames
+ */
+u32 acpi_dm_dump_name(u32 name);
+
+acpi_status
+acpi_ps_display_object_pathname(struct acpi_walk_state *walk_state,
+				union acpi_parse_object *op);
+
+void acpi_dm_namestring(char *name);
+
+/*
+ * dmobject
+ */
+void
+acpi_dm_display_internal_object(union acpi_operand_object *obj_desc,
+				struct acpi_walk_state *walk_state);
+
+void acpi_dm_display_arguments(struct acpi_walk_state *walk_state);
+
+void acpi_dm_display_locals(struct acpi_walk_state *walk_state);
+
+void
+acpi_dm_dump_method_info(acpi_status status,
+			 struct acpi_walk_state *walk_state,
+			 union acpi_parse_object *op);
+
+/*
+ * dmbuffer
+ */
+void acpi_dm_disasm_byte_list(u32 level, u8 *byte_data, u32 byte_count);
+
+void
+acpi_dm_byte_list(struct acpi_op_walk_info *info, union acpi_parse_object *op);
+
+void acpi_dm_is_eisa_id(union acpi_parse_object *op);
+
+void acpi_dm_eisa_id(u32 encoded_id);
+
+u8 acpi_dm_is_unicode_buffer(union acpi_parse_object *op);
+
+u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
+
+u8 acpi_dm_is_pld_buffer(union acpi_parse_object *op);
+
+/*
+ * dmextern
+ */
+
+acpi_status acpi_dm_add_to_external_file_list(char *path_list);
+
+void acpi_dm_clear_external_file_list(void);
+
+void
+acpi_dm_add_to_external_list(union acpi_parse_object *op,
+			     char *path, u8 type, u32 value);
+
+void acpi_dm_add_externals_to_namespace(void);
+
+u32 acpi_dm_get_external_method_count(void);
+
+void acpi_dm_clear_external_list(void);
+
+void acpi_dm_emit_externals(void);
+
+/*
+ * dmresrc
+ */
+void acpi_dm_dump_integer8(u8 value, char *name);
+
+void acpi_dm_dump_integer16(u16 value, char *name);
+
+void acpi_dm_dump_integer32(u32 value, char *name);
+
+void acpi_dm_dump_integer64(u64 value, char *name);
+
+void
+acpi_dm_resource_template(struct acpi_op_walk_info *info,
+			  union acpi_parse_object *op,
+			  u8 *byte_data, u32 byte_count);
+
+acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
+
+void acpi_dm_bit_list(u16 mask);
+
+void acpi_dm_descriptor_name(void);
+
+/*
+ * dmresrcl
+ */
+void
+acpi_dm_word_descriptor(union aml_resource *resource, u32 length, u32 level);
+
+void
+acpi_dm_dword_descriptor(union aml_resource *resource, u32 length, u32 level);
+
+void
+acpi_dm_extended_descriptor(union aml_resource *resource,
+			    u32 length, u32 level);
+
+void
+acpi_dm_qword_descriptor(union aml_resource *resource, u32 length, u32 level);
+
+void
+acpi_dm_memory24_descriptor(union aml_resource *resource,
+			    u32 length, u32 level);
+
+void
+acpi_dm_memory32_descriptor(union aml_resource *resource,
+			    u32 length, u32 level);
+
+void
+acpi_dm_fixed_memory32_descriptor(union aml_resource *resource,
+				  u32 length, u32 level);
+
+void
+acpi_dm_generic_register_descriptor(union aml_resource *resource,
+				    u32 length, u32 level);
+
+void
+acpi_dm_interrupt_descriptor(union aml_resource *resource,
+			     u32 length, u32 level);
+
+void
+acpi_dm_vendor_large_descriptor(union aml_resource *resource,
+				u32 length, u32 level);
+
+void
+acpi_dm_gpio_descriptor(union aml_resource *resource, u32 length, u32 level);
+
+void
+acpi_dm_serial_bus_descriptor(union aml_resource *resource,
+			      u32 length, u32 level);
+
+void acpi_dm_vendor_common(char *name, u8 *byte_data, u32 length, u32 level);
+
+/*
+ * dmresrcs
+ */
+void
+acpi_dm_irq_descriptor(union aml_resource *resource, u32 length, u32 level);
+
+void
+acpi_dm_dma_descriptor(union aml_resource *resource, u32 length, u32 level);
+
+void
+acpi_dm_fixed_dma_descriptor(union aml_resource *resource,
+			     u32 length, u32 level);
+
+void acpi_dm_io_descriptor(union aml_resource *resource, u32 length, u32 level);
+
+void
+acpi_dm_fixed_io_descriptor(union aml_resource *resource,
+			    u32 length, u32 level);
+
+void
+acpi_dm_start_dependent_descriptor(union aml_resource *resource,
+				   u32 length, u32 level);
+
+void
+acpi_dm_end_dependent_descriptor(union aml_resource *resource,
+				 u32 length, u32 level);
+
+void
+acpi_dm_vendor_small_descriptor(union aml_resource *resource,
+				u32 length, u32 level);
+
+/*
+ * dmutils
+ */
+void acpi_dm_decode_attribute(u8 attribute);
+
+void acpi_dm_indent(u32 level);
+
+u8 acpi_dm_comma_if_list_member(union acpi_parse_object *op);
+
+void acpi_dm_comma_if_field_member(union acpi_parse_object *op);
+
+/*
+ * dmrestag
+ */
+void acpi_dm_find_resources(union acpi_parse_object *root);
+
+void
+acpi_dm_check_resource_reference(union acpi_parse_object *op,
+				 struct acpi_walk_state *walk_state);
+
+/*
+ * acdisasm
+ */
+void ad_disassembler_header(char *filename);
+
+#endif
+
+#endif				/* __ACDISASM_H__ */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 64472e4..1ef7ca4 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -415,6 +415,8 @@ ACPI_EXTERN u8 acpi_gbl_db_output_flags;
 
 ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
 ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
+ACPI_EXTERN struct acpi_external_list *acpi_gbl_external_list;
+ACPI_EXTERN struct acpi_external_file *acpi_gbl_external_file_list;
 #endif
 
 #ifdef ACPI_DEBUGGER
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index ff8bd00..b1988bb 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -1025,6 +1025,31 @@ struct acpi_port_info {
 
 /*****************************************************************************
  *
+ * Disassembler
+ *
+ ****************************************************************************/
+
+struct acpi_external_list {
+	char *path;
+	char *internal_path;
+	struct acpi_external_list *next;
+	u32 value;
+	u16 length;
+	u8 type;
+	u8 flags;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_IPATH_ALLOCATED    0x01
+
+struct acpi_external_file {
+	char *path;
+	struct acpi_external_file *next;
+};
+
+/*****************************************************************************
+ *
  * Debugger
  *
  ****************************************************************************/
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 52eb4e0..f7a7cf3 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -46,9 +46,7 @@
 #include "acdispat.h"
 #include "acinterp.h"
 #include "acnamesp.h"
-#ifdef	ACPI_DISASSEMBLER
-#include <acpi/acdisasm.h>
-#endif
+#include "acdisasm.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsmethod")
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 5575100..d290740 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -50,7 +50,7 @@
 #include "acnamesp.h"
 
 #ifdef ACPI_ASL_COMPILER
-#include <acpi/acdisasm.h>
+#include "acdisasm.h"
 #endif
 
 #define _COMPONENT          ACPI_DISPATCHER
@@ -178,7 +178,8 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
 			 * Target of Scope() not found. Generate an External for it, and
 			 * insert the name into the namespace.
 			 */
-			acpi_dm_add_to_external_list(path, ACPI_TYPE_DEVICE, 0);
+			acpi_dm_add_to_external_list(op, path, ACPI_TYPE_DEVICE,
+						     0);
 			status =
 			    acpi_ns_lookup(walk_state->scope_info, path,
 					   object_type, ACPI_IMODE_LOAD_PASS1,
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c
index 1d2d8ff..b7f4264 100644
--- a/drivers/acpi/acpica/nssearch.c
+++ b/drivers/acpi/acpica/nssearch.c
@@ -328,6 +328,11 @@ acpi_ns_search_and_enter(u32 target_name,
 		if ((status == AE_OK) && (flags & ACPI_NS_ERROR_IF_FOUND)) {
 			status = AE_ALREADY_EXISTS;
 		}
+#ifdef ACPI_ASL_COMPILER
+		if (*return_node && (*return_node)->type == ACPI_TYPE_ANY) {
+			(*return_node)->flags |= ANOBJ_IS_EXTERNAL;
+		}
+#endif
 
 		/* Either found it or there was an error: finished either way */
 
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index ed18931..711fd22 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -357,6 +357,10 @@ acpi_status acpi_ut_init_globals(void)
 	acpi_gbl_root_node_struct.peer = NULL;
 	acpi_gbl_root_node_struct.object = NULL;
 
+#ifdef ACPI_DISASSEMBLER
+	acpi_gbl_external_list = NULL;
+#endif
+
 #ifdef ACPI_DEBUG_OUTPUT
 	acpi_gbl_lowest_stack_pointer = ACPI_CAST_PTR(acpi_size, ACPI_SIZE_MAX);
 #endif
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 89cee88..c743ca4 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -69,12 +69,13 @@
 #endif
 
 #ifdef ACPI_ASL_COMPILER
-#define ACPI_DEBUG_OUTPUT
 #define ACPI_APPLICATION
 #define ACPI_DISASSEMBLER
+#define ACPI_DEBUG_OUTPUT
 #define ACPI_CONSTANT_EVAL_ONLY
 #define ACPI_LARGE_NAMESPACE_NODE
 #define ACPI_DATA_TABLE_DISASSEMBLY
+#define ACPI_SINGLE_THREADED
 #endif
 
 #ifdef ACPI_EXEC_APP
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 02/15] ACPICA: Fixes comments caused divergences.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
  2012-11-21 10:06 ` [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences Lv Zheng
@ 2012-11-21 10:07 ` Lv Zheng
  2012-11-27  3:32   ` Brown, Len
  2012-11-21 10:07 ` [PATCH 03/15] ACPICA: Fixes indent " Lv Zheng
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This patch fixes divergences caused by the differences in the comments.
Some ACPICA utilities' feature definitions are also fixed in this patch.

This patch will not affect the generated vmlinux binary.
This will decrease 663 lines of 20121018 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/aclocal.h   |   13 +++---
 drivers/acpi/acpica/acobject.h  |    2 +-
 drivers/acpi/acpica/acpredef.h  |   14 +++---
 drivers/acpi/acpica/dsopcode.c  |   14 +++---
 drivers/acpi/acpica/evgpe.c     |    4 +-
 drivers/acpi/acpica/evxface.c   |   23 +++++-----
 drivers/acpi/acpica/evxfevnt.c  |    4 +-
 drivers/acpi/acpica/evxfgpe.c   |    9 ++--
 drivers/acpi/acpica/exconfig.c  |    9 ++--
 drivers/acpi/acpica/exmutex.c   |    3 +-
 drivers/acpi/acpica/exregion.c  |   15 ++++---
 drivers/acpi/acpica/hwesleep.c  |    1 -
 drivers/acpi/acpica/hwregs.c    |    2 +-
 drivers/acpi/acpica/hwxface.c   |    2 +-
 drivers/acpi/acpica/hwxfsleep.c |    7 +--
 drivers/acpi/acpica/nsdump.c    |    4 +-
 drivers/acpi/acpica/nsnames.c   |    3 +-
 drivers/acpi/acpica/nspredef.c  |    1 -
 drivers/acpi/acpica/tbfadt.c    |    5 ++-
 drivers/acpi/acpica/utglobal.c  |    2 +
 drivers/acpi/acpica/utobject.c  |    2 +-
 drivers/acpi/acpica/utxferror.c |    4 +-
 include/acpi/acconfig.h         |    2 +-
 include/acpi/acpixf.h           |   19 +++++---
 include/acpi/actbl1.h           |    6 +--
 include/acpi/actypes.h          |    4 +-
 include/acpi/platform/acenv.h   |   94 ++++++++++++++++++++++++++-------------
 27 files changed, 161 insertions(+), 107 deletions(-)

diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index b1988bb..99d6b9b 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -189,11 +189,10 @@ struct acpi_namespace_node {
 #define ANOBJ_EVALUATED                 0x20	/* Set on first evaluation of node */
 #define ANOBJ_ALLOCATED_BUFFER          0x40	/* Method AML buffer is dynamic (install_method) */
 
-#define ANOBJ_IS_EXTERNAL               0x08	/* i_aSL only: This object created via External() */
-#define ANOBJ_METHOD_NO_RETVAL          0x10	/* i_aSL only: Method has no return value */
-#define ANOBJ_METHOD_SOME_NO_RETVAL     0x20	/* i_aSL only: Method has at least one return value */
-#define ANOBJ_IS_BIT_OFFSET             0x40	/* i_aSL only: Reference is a bit offset */
-#define ANOBJ_IS_REFERENCED             0x80	/* i_aSL only: Object was referenced */
+#define ANOBJ_IS_EXTERNAL               0x08	/* iASL only: This object created via External() */
+#define ANOBJ_METHOD_NO_RETVAL          0x10	/* iASL only: Method has no return value */
+#define ANOBJ_METHOD_SOME_NO_RETVAL     0x20	/* iASL only: Method has at least one return value */
+#define ANOBJ_IS_REFERENCED             0x80	/* iASL only: Object was referenced */
 
 /* Internal ACPI table management - master table list */
 
@@ -416,6 +415,10 @@ struct acpi_gpe_notify_object {
 	struct acpi_gpe_notify_object *next;
 };
 
+/*
+ * GPE dispatch info. At any time, the GPE can have at most one type
+ * of dispatch - Method, Handler, or Implicit Notify.
+ */
 union acpi_gpe_dispatch_info {
 	struct acpi_namespace_node *method_node;	/* Method node for this GPE level */
 	struct acpi_gpe_handler_info *handler;  /* Installed GPE handler */
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
index 24eb9ea..921262e 100644
--- a/drivers/acpi/acpica/acobject.h
+++ b/drivers/acpi/acpica/acobject.h
@@ -307,7 +307,7 @@ struct acpi_object_addr_handler {
 	struct acpi_namespace_node *node;	/* Parent device */
 	void *context;
 	acpi_adr_space_setup setup;
-	union acpi_operand_object *region_list;	/* regions using this handler */
+	union acpi_operand_object *region_list;	/* Regions using this handler */
 	union acpi_operand_object *next;
 };
 
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index 9dfa1c8..55fff56 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -1,7 +1,6 @@
 /******************************************************************************
  *
  * Name: acpredef - Information table for ACPI predefined methods and objects
- *              $Revision: 1.1 $
  *
  *****************************************************************************/
 
@@ -51,13 +50,13 @@
  *
  * 1) PTYPE1 packages do not contain sub-packages.
  *
- * ACPI_PTYPE1_FIXED: Fixed length, 1 or 2 object types:
+ * ACPI_PTYPE1_FIXED: Fixed-length length, 1 or 2 object types:
  *      object type
  *      count
  *      object type
  *      count
  *
- * ACPI_PTYPE1_VAR: Variable length:
+ * ACPI_PTYPE1_VAR: Variable-length length:
  *      object type (Int/Buf/Ref)
  *
  * ACPI_PTYPE1_OPTION: Package has some required and some optional elements
@@ -85,10 +84,10 @@
  *      count
  *      (Used for _CST)
  *
- * ACPI_PTYPE2_FIXED: Each subpackage is of fixed length
+ * ACPI_PTYPE2_FIXED: Each subpackage is of Fixed-length
  *      (Used for _PRT)
  *
- * ACPI_PTYPE2_MIN: Each subpackage has a variable but minimum length
+ * ACPI_PTYPE2_MIN: Each subpackage has a Variable-length but minimum length
  *      (Used for _HPX)
  *
  * ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length
@@ -124,7 +123,8 @@ enum acpi_return_package_types {
  * These are the names that can actually be evaluated via acpi_evaluate_object.
  * Not present in this table are the following:
  *
- *      1) Predefined/Reserved names that are never evaluated via acpi_evaluate_object:
+ *      1) Predefined/Reserved names that are never evaluated via
+ *         acpi_evaluate_object:
  *          _Lxx and _Exx GPE methods
  *          _Qxx EC methods
  *          _T_x compiler temporary variables
@@ -149,6 +149,8 @@ enum acpi_return_package_types {
  * information about the expected structure of the package. This information
  * is saved here (rather than in a separate table) in order to minimize the
  * overall size of the stored data.
+ *
+ * Note: The additional braces are intended to promote portability.
  */
 static const union acpi_predefined_info predefined_names[] = {
 	{{"_AC0", 0, ACPI_RTYPE_INTEGER}},
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 0df024e..8e9bdce 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -486,18 +486,18 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
 	ACPI_FUNCTION_TRACE_PTR(ds_eval_table_region_operands, op);
 
 	/*
-	 * This is where we evaluate the signature_string and oem_iDString
-	 * and oem_table_iDString of the data_table_region declaration
+	 * This is where we evaluate the Signature string, oem_id string,
+	 * and oem_table_id string of the Data Table Region declaration
 	 */
 	node = op->common.node;
 
-	/* next_op points to signature_string op */
+	/* next_op points to Signature string op */
 
 	next_op = op->common.value.arg;
 
 	/*
-	 * Evaluate/create the signature_string and oem_iDString
-	 * and oem_table_iDString operands
+	 * Evaluate/create the Signature string, oem_id string,
+	 * and oem_table_id string operands
 	 */
 	status = acpi_ds_create_operands(walk_state, next_op);
 	if (ACPI_FAILURE(status)) {
@@ -505,8 +505,8 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
 	}
 
 	/*
-	 * Resolve the signature_string and oem_iDString
-	 * and oem_table_iDString operands
+	 * Resolve the Signature string, oem_id string,
+	 * and oem_table_id string operands
 	 */
 	status = acpi_ex_resolve_operands(op->common.aml_opcode,
 					  ACPI_WALK_OPERANDS, walk_state);
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index 36d1205..a137ce81 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -561,8 +561,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 			status = AE_NO_MEMORY;
 		} else {
 			/*
-			 * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
-			 * control method that corresponds to this GPE
+			 * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the
+			 * _Lxx/_Exx control method that corresponds to this GPE
 			 */
 			info->prefix_node =
 			    local_gpe_event_info->dispatch.method_node;
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index ae668f3..74fe0f1 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -56,13 +56,13 @@ ACPI_MODULE_NAME("evxface")
  *
  * FUNCTION:    acpi_install_notify_handler
  *
- * PARAMETERS:  Device          - The device for which notifies will be handled
+ * PARAMETERS:  device          - The device for which notifies will be handled
  *              handler_type    - The type of handler:
  *                                  ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
  *                                  ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
  *                                  ACPI_ALL_NOTIFY:    Both System and Device
- *              Handler         - Address of the handler
- *              Context         - Value passed to the handler on each GPE
+ *              handler         - Address of the handler
+ *              context         - Value passed to the handler on each GPE
  *
  * RETURN:      Status
  *
@@ -217,12 +217,12 @@ ACPI_EXPORT_SYMBOL(acpi_install_notify_handler)
  *
  * FUNCTION:    acpi_remove_notify_handler
  *
- * PARAMETERS:  Device          - The device for which the handler is installed
+ * PARAMETERS:  device          - The device for which the handler is installed
  *              handler_type    - The type of handler:
  *                                  ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
  *                                  ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
  *                                  ACPI_ALL_NOTIFY:    Both System and Device
- *              Handler         - Address of the handler
+ *              handler         - Address of the handler
  *
  * RETURN:      Status
  *
@@ -249,7 +249,8 @@ acpi_remove_notify_handler(acpi_handle device,
 	    (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) {
 		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
-	/* Make sure all deferred tasks are completed */
+
+	/* Make sure all deferred notify tasks are completed */
 
 	acpi_os_wait_events_complete();
 
@@ -596,7 +597,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 		return_ACPI_STATUS(status);
 	}
 
-	/* Allocate memory for the handler object */
+	/* Allocate and init handler object (before lock) */
 
 	handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_handler_info));
 	if (!handler) {
@@ -622,8 +623,6 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 		goto free_and_exit;
 	}
 
-	/* Allocate and init handler object */
-
 	handler->address = address;
 	handler->context = context;
 	handler->method_node = gpe_event_info->dispatch.method_node;
@@ -631,7 +630,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 			(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
 
 	/*
-	 * If the GPE is associated with a method, it might have been enabled
+	 * If the GPE is associated with a method, it may have been enabled
 	 * automatically during initialization, in which case it has to be
 	 * disabled now to avoid spurious execution of the handler.
 	 */
@@ -646,7 +645,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
 	gpe_event_info->dispatch.handler = handler;
 
-	/* Setup up dispatch flags to indicate handler (vs. method) */
+	/* Setup up dispatch flags to indicate handler (vs. method/notify) */
 
 	gpe_event_info->flags &=
 	    ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
@@ -697,7 +696,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
 		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
-	/* Make sure all deferred tasks are completed */
+	/* Make sure all deferred GPE tasks are completed */
 
 	acpi_os_wait_events_complete();
 
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index 35520c6..ee6e96c 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -210,8 +210,8 @@ ACPI_EXPORT_SYMBOL(acpi_enable_event)
  *
  * FUNCTION:    acpi_disable_event
  *
- * PARAMETERS:  Event           - The fixed eventto be enabled
- *              Flags           - Reserved
+ * PARAMETERS:  event           - The fixed event to be disabled
+ *              flags           - Reserved
  *
  * RETURN:      Status
  *
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index 3f30e75..36f8ad8 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -51,7 +51,7 @@
 ACPI_MODULE_NAME("evxfgpe")
 
 #if (!ACPI_REDUCED_HARDWARE)	/* Entire module */
-/******************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    acpi_update_all_gpes
  *
@@ -172,6 +172,7 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number)
 	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 	return_ACPI_STATUS(status);
 }
+
 ACPI_EXPORT_SYMBOL(acpi_disable_gpe)
 
 
@@ -225,7 +226,7 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device,
 		    ACPI_CAST_PTR(struct acpi_namespace_node, wake_device);
 	}
 
-	/* Validate WakeDevice is of type Device */
+	/* Validate wake_device is of type Device */
 
 	if (device_node->type != ACPI_TYPE_DEVICE) {
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
@@ -432,8 +433,8 @@ ACPI_EXPORT_SYMBOL(acpi_clear_gpe)
  *
  * PARAMETERS:  gpe_device      - Parent GPE Device. NULL for GPE0/GPE1
  *              gpe_number      - GPE level within the GPE block
- *              event_status    - Where the current status of the event will
- *                                be returned
+ *              event_status        - Where the current status of the event
+ *                                    will be returned
  *
  * RETURN:      Status
  *
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 16219bd..b4f42f5 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -120,8 +120,11 @@ acpi_ex_add_table(u32 table_index,
 	acpi_ns_exec_module_code_list();
 	acpi_ex_enter_interpreter();
 
-	/* Update GPEs for any new _Lxx/_Exx methods. Ignore errors */
-
+	/*
+	 * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
+	 * responsible for discovering any new wake GPEs by running _PRW methods
+	 * that may have been loaded by this table.
+	 */
 	status = acpi_tb_get_owner_id(table_index, &owner_id);
 	if (ACPI_SUCCESS(status)) {
 		acpi_ev_update_gpes(owner_id);
@@ -158,7 +161,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
 
 	ACPI_FUNCTION_TRACE(ex_load_table_op);
 
-	/* Validate lengths for the signature_string, OEMIDString, OEMtable_iD */
+	/* Validate lengths for the Signature, oem_id, and oem_table_id strings */
 
 	if ((operand[0]->string.length > ACPI_NAME_SIZE) ||
 	    (operand[1]->string.length > ACPI_OEM_ID_SIZE) ||
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c
index d1f449d..02157ef 100644
--- a/drivers/acpi/acpica/exmutex.c
+++ b/drivers/acpi/acpica/exmutex.c
@@ -377,7 +377,8 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		return_ACPI_STATUS(AE_AML_MUTEX_NOT_ACQUIRED);
 	}
 
-	/* Must have a valid thread. */
+	/* Must have a valid thread ID */
+
 	if (!walk_state->thread) {
 		ACPI_ERROR((AE_INFO,
 			    "Cannot release Mutex [%4.4s], null thread info",
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 1db2c0b..48c660a 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -142,9 +142,9 @@ acpi_ex_system_memory_space_handler(u32 function,
 		}
 
 		/*
-		 * Attempt to map from the requested address to the end of the region.
-		 * However, we will never map more than one page, nor will we cross
-		 * a page boundary.
+		 * October 2009: Attempt to map from the requested address to the
+		 * end of the region. However, we will never map more than one
+		 * page, nor will we cross a page boundary.
 		 */
 		map_length = (acpi_size)
 		    ((mem_info->address + mem_info->length) - address);
@@ -154,12 +154,15 @@ acpi_ex_system_memory_space_handler(u32 function,
 		 * a page boundary, just map up to the page boundary, do not cross.
 		 * On some systems, crossing a page boundary while mapping regions
 		 * can cause warnings if the pages have different attributes
-		 * due to resource management
+		 * due to resource management.
+		 *
+		 * This has the added benefit of constraining a single mapping to
+		 * one page, which is similar to the original code that used a 4k
+		 * maximum window.
 		 */
 		page_boundary_map_length =
 		    ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;
-
-		if (!page_boundary_map_length) {
+		if (page_boundary_map_length == 0) {
 			page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
 		}
 
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c
index 94996f9..6c0b1a9 100644
--- a/drivers/acpi/acpica/hwesleep.c
+++ b/drivers/acpi/acpica/hwesleep.c
@@ -200,7 +200,6 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state)
  * FUNCTION:    acpi_hw_extended_wake
  *
  * PARAMETERS:  sleep_state         - Which sleep state we just exited
- *              flags               - Reserved, set to zero
  *
  * RETURN:      Status
  *
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index f4e5750..165395f 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -485,7 +485,7 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
 						&acpi_gbl_xpm1b_status);
 		break;
 
-	case ACPI_REGISTER_PM1_ENABLE:	/* PM1 A/B: 16-bit access */
+	case ACPI_REGISTER_PM1_ENABLE:	/* PM1 A/B: 16-bit access each */
 
 		status = acpi_hw_write_multiple(value,
 						&acpi_gbl_xpm1a_enable,
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 05a154c..cac44b9 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -333,7 +333,7 @@ ACPI_EXPORT_SYMBOL(acpi_read_bit_register)
  * FUNCTION:    acpi_write_bit_register
  *
  * PARAMETERS:  register_id     - ID of ACPI Bit Register to access
- *              Value           - Value to write to the register, in bit
+ *              value           - Value to write to the register, in bit
  *                                position zero. The bit is automatically
  *                                shifted to the correct position.
  *
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index ae443fe2..2898011 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -350,7 +350,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231)
+ * DESCRIPTION: Enter a system sleep state
  *              THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
  *
  ******************************************************************************/
@@ -382,8 +382,9 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
  * RETURN:      Status
  *
  * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
- *              sleep.
- *              Called with interrupts DISABLED.
+ *              sleep. Called with interrupts DISABLED.
+ *              We break wake/resume into 2 stages so that OSPM can handle
+ *              various OS-specific tasks between the two steps.
  *
  ******************************************************************************/
 acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 924b3c7..8e6f0037 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -729,5 +729,5 @@ void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth)
 			     ACPI_OWNER_ID_MAX, search_handle);
 	return_VOID;
 }
-#endif				/* _ACPI_ASL_COMPILER */
-#endif				/* defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) */
+#endif
+#endif
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c
index 55a175e..7d34641 100644
--- a/drivers/acpi/acpica/nsnames.c
+++ b/drivers/acpi/acpica/nsnames.c
@@ -126,7 +126,8 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,
  *              the node, In external format (name segments separated by path
  *              separators.)
  *
- * DESCRIPTION: Used for debug printing in acpi_ns_search_table().
+ * DESCRIPTION: Used to obtain the full pathname to a namespace node, usually
+ *              for error and debug statements.
  *
  ******************************************************************************/
 
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 2419f41..352be3b 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -1,7 +1,6 @@
 /******************************************************************************
  *
  * Module Name: nspredef - Validation of ACPI predefined methods and objects
- *              $Revision: 1.1 $
  *
  *****************************************************************************/
 
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 3906518..882285b 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -172,6 +172,7 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = {
  * FUNCTION:    acpi_tb_init_generic_address
  *
  * PARAMETERS:  generic_address     - GAS struct to be initialized
+ *              space_id            - ACPI Space ID for this register
  *              byte_width          - Width of this register
  *              address             - Address of the register
  *
@@ -407,8 +408,8 @@ static void acpi_tb_convert_fadt(void)
 	 * should be zero are indeed zero. This will workaround BIOSs that
 	 * inadvertently place values in these fields.
 	 *
-	 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at
-	 * offset 45, 55, 95, and the word located at offset 109, 110.
+	 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located
+	 * at offset 45, 55, 95, and the word located at offset 109, 110.
 	 *
 	 * Note: The FADT revision value is unreliable. Only the length can be
 	 * trusted.
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 711fd22..c083611 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -372,6 +372,8 @@ acpi_status acpi_ut_init_globals(void)
 	return_ACPI_STATUS(AE_OK);
 }
 
+/* Public globals */
+
 ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
 ACPI_EXPORT_SYMBOL(acpi_dbg_level)
 ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c
index 5c52ca7..822600b 100644
--- a/drivers/acpi/acpica/utobject.c
+++ b/drivers/acpi/acpica/utobject.c
@@ -419,7 +419,7 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object)
 {
 	ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object);
 
-	/* Object must be a union acpi_operand_object */
+	/* Object must be of type union acpi_operand_object */
 
 	if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) {
 		ACPI_ERROR((AE_INFO,
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index d4d3826..a247a22 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -297,9 +297,9 @@ ACPI_EXPORT_SYMBOL(acpi_bios_warning)
  *
  * PARAMETERS:  module_name     - Caller's module name (for error output)
  *              line_number     - Caller's line number (for error output)
- *              Pathname        - Full pathname to the node
+ *              pathname        - Full pathname to the node
  *              node_flags      - From Namespace node for the method/object
- *              Format          - Printf format string + additional args
+ *              format          - Printf format string + additional args
  *
  * RETURN:      None
  *
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 0943457..358258a 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -138,7 +138,7 @@
 
 /* Maximum sleep allowed via Sleep() operator */
 
-#define ACPI_MAX_SLEEP                  2000	/* Two seconds */
+#define ACPI_MAX_SLEEP                  2000	/* 2000 millisec == two seconds */
 
 /* Address Range lists are per-space_id (Memory and I/O only) */
 
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 3d88395..d8ec35b 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -56,11 +56,16 @@
 extern u8 acpi_gbl_permanent_mmap;
 
 /*
- * Globals that are publicly available, allowing for
- * run time configuration
+ * Globals that are publically available
  */
+
+/* Runtime configuration of debug print levels */
+
 extern u32 acpi_dbg_level;
 extern u32 acpi_dbg_layer;
+
+/* ACPICA runtime options */
+
 extern u8 acpi_gbl_enable_interpreter_slack;
 extern u8 acpi_gbl_all_methods_serialized;
 extern u8 acpi_gbl_create_osi_method;
@@ -106,7 +111,7 @@ extern u8 acpi_gbl_reduced_hardware;	/* ACPI 5.0 */
 
 extern u32 acpi_rsdt_forced;
 /*
- * Global interfaces
+ * Initialization
  */
 acpi_status
 acpi_initialize_tables(struct acpi_table_desc *initial_storage,
@@ -120,13 +125,15 @@ acpi_status acpi_initialize_objects(u32 flags);
 
 acpi_status acpi_terminate(void);
 
+/*
+ * Miscellaneous global interfaces
+ */
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
+ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
 #ifdef ACPI_FUTURE_USAGE
 acpi_status acpi_subsystem_status(void);
 #endif
 
-ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
-ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
-
 #ifdef ACPI_FUTURE_USAGE
 acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
 #endif
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 280fc45..61f04c0 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -768,7 +768,7 @@ struct acpi_madt_interrupt_source {
 
 struct acpi_madt_local_x2apic {
 	struct acpi_subtable_header header;
-	u16 reserved;		/* Reserved - must be zero */
+	u16 reserved;		/* reserved - must be zero */
 	u32 local_apic_id;	/* Processor x2APIC ID  */
 	u32 lapic_flags;
 	u32 uid;		/* ACPI processor UID */
@@ -781,14 +781,14 @@ struct acpi_madt_local_x2apic_nmi {
 	u16 inti_flags;
 	u32 uid;		/* ACPI processor UID */
 	u8 lint;		/* LINTn to which NMI is connected */
-	u8 reserved[3];
+	u8 reserved[3];		/* reserved - must be zero */
 };
 
 /* 11: Generic Interrupt (ACPI 5.0) */
 
 struct acpi_madt_generic_interrupt {
 	struct acpi_subtable_header header;
-	u16 reserved;		/* Reserved - must be zero */
+	u16 reserved;		/* reserved - must be zero */
 	u32 gic_id;
 	u32 uid;
 	u32 flags;
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 4f43f1f..35d4dea0 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -595,7 +595,7 @@ typedef u32 acpi_object_type;
 
 /*
  * These are special object types that never appear in
- * a Namespace node, only in a union acpi_operand_object
+ * a Namespace node, only in an object of union acpi_operand_object
  */
 #define ACPI_TYPE_LOCAL_EXTRA           0x1C
 #define ACPI_TYPE_LOCAL_DATA            0x1D
@@ -662,7 +662,7 @@ typedef u32 acpi_event_status;
 #define ACPI_GPE_MAX                    0xFF
 #define ACPI_NUM_GPE                    256
 
-/* Actions for acpi_set_gpe_wake_mask, acpi_hw_low_set_gpe */
+/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */
 
 #define ACPI_GPE_ENABLE                 0
 #define ACPI_GPE_DISABLE                1
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index c743ca4..89fcc3e 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: acenv.h - Generation environment specific items
+ * Name: acenv.h - Host and compiler configuration
  *
  *****************************************************************************/
 
@@ -44,6 +44,12 @@
 #ifndef __ACENV_H__
 #define __ACENV_H__
 
+/*
+ * Environment configuration. The purpose of this file is to interface ACPICA
+ * to the local environment. This includes compiler-specific, OS-specific,
+ * and machine-specific configuration.
+ */
+
 /* Types for ACPI_MUTEX_TYPE */
 
 #define ACPI_BINARY_SEMAPHORE       0
@@ -60,13 +66,7 @@
  *
  *****************************************************************************/
 
-#ifdef ACPI_LIBRARY
-/*
- * Note: The non-debug version of the acpi_library does not contain any
- * debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG
- */
-#define ACPI_USE_LOCAL_CACHE
-#endif
+/* iASL configuration */
 
 #ifdef ACPI_ASL_COMPILER
 #define ACPI_APPLICATION
@@ -78,21 +78,55 @@
 #define ACPI_SINGLE_THREADED
 #endif
 
+/* acpi_exec configuration. Multithreaded with full AML debugger */
+
 #ifdef ACPI_EXEC_APP
-#undef DEBUGGER_THREADING
-#define DEBUGGER_THREADING      DEBUGGER_SINGLE_THREADED
-#define ACPI_FULL_DEBUG
 #define ACPI_APPLICATION
-#define ACPI_DEBUGGER
+#define ACPI_FULL_DEBUG
 #define ACPI_MUTEX_DEBUG
 #define ACPI_DBG_TRACK_ALLOCATIONS
 #endif
 
+/* acpi_names configuration. Single threaded with debugger output enabled. */
+
+#ifdef ACPI_NAMES_APP
+#define ACPI_DEBUGGER
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#endif
+
+/*
+ * acpi_bin/acpi_help/acpi_src configuration. All single threaded, with
+ * no debug output.
+ */
+#if (defined ACPI_BIN_APP)   || \
+	(defined ACPI_SRC_APP)   || \
+	(defined ACPI_XTRACT_APP)
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#endif
+
+#ifdef ACPI_HELP_APP
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#define ACPI_NO_ERROR_MESSAGES
+#endif
+
+/* Linkable ACPICA library */
+
+#ifdef ACPI_LIBRARY
+#define ACPI_USE_LOCAL_CACHE
+#endif
+
+/* Common for all ACPICA applications */
+
 #ifdef ACPI_APPLICATION
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_LOCAL_CACHE
 #endif
 
+/* Common debug support */
+
 #ifdef ACPI_FULL_DEBUG
 #define ACPI_DEBUGGER
 #define ACPI_DEBUG_OUTPUT
@@ -231,9 +265,9 @@
  * We want to keep these to a minimum.
  */
 #ifdef ACPI_USE_STANDARD_HEADERS
-/*
- * Use the standard headers from the standard locations
- */
+
+/* Use the standard headers from the standard locations */
+
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
@@ -241,9 +275,8 @@
 
 #endif				/* ACPI_USE_STANDARD_HEADERS */
 
-/*
- * We will be linking to the standard Clib functions
- */
+/* We will be linking to the standard Clib functions */
+
 #define ACPI_STRSTR(s1,s2)      strstr((s1), (s2))
 #define ACPI_STRCHR(s1,c)       strchr((s1), (c))
 #define ACPI_STRLEN(s)          (acpi_size) strlen((s))
@@ -275,13 +308,12 @@
  *
  *****************************************************************************/
 
- /*
-  * Use local definitions of C library macros and functions
-  * NOTE: The function implementations may not be as efficient
-  * as an inline or assembly code implementation provided by a
-  * native C library.
-  */
-
+/*
+ * Use local definitions of C library macros and functions. These function
+ * implementations may not be as efficient as an inline or assembly code
+ * implementation provided by a native C library, but they are functionally
+ * equivalent.
+ */
 #ifndef va_arg
 
 #ifndef _VALIST
@@ -289,15 +321,13 @@
 typedef char *va_list;
 #endif				/* _VALIST */
 
-/*
- * Storage alignment properties
- */
+/* Storage alignment properties */
+
 #define  _AUPBND                (sizeof (acpi_native_int) - 1)
 #define  _ADNBND                (sizeof (acpi_native_int) - 1)
 
-/*
- * Variable argument list macro definitions
- */
+/* Variable argument list macro definitions */
+
 #define _bnd(X, bnd)            (((sizeof (X)) + (bnd)) & (~(bnd)))
 #define va_arg(ap, T)           (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
 #define va_end(ap)              (void) 0
@@ -305,6 +335,8 @@ typedef char *va_list;
 
 #endif				/* va_arg */
 
+/* Use the local (ACPICA) definitions of the clib functions */
+
 #define ACPI_STRSTR(s1,s2)      acpi_ut_strstr ((s1), (s2))
 #define ACPI_STRCHR(s1,c)       acpi_ut_strchr ((s1), (c))
 #define ACPI_STRLEN(s)          (acpi_size) acpi_ut_strlen ((s))
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 03/15] ACPICA: Fixes indent caused divergences.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
  2012-11-21 10:06 ` [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences Lv Zheng
  2012-11-21 10:07 ` [PATCH 02/15] ACPICA: Fixes comments caused divergences Lv Zheng
@ 2012-11-21 10:07 ` Lv Zheng
  2012-11-21 10:07 ` [PATCH 04/15] ACPICA: Fixes code maintenance divergences Lv Zheng
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This patch fixes divergences caused by "indent" program.
The version of "indent" used for this patch is "GNU indent 2.2.11".

This patch will not affect the generated vmlinux binary.
This will decrease 198 lines of 20121018 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/evxface.c   |   11 ++++++-----
 drivers/acpi/acpica/exoparg1.c  |    8 +-------
 drivers/acpi/acpica/exregion.c  |    8 ++++----
 drivers/acpi/acpica/hwacpi.c    |    3 +--
 drivers/acpi/acpica/hwregs.c    |    3 +--
 drivers/acpi/acpica/nsrepair2.c |    3 ++-
 drivers/acpi/acpica/nsutils.c   |    6 +++---
 drivers/acpi/acpica/psutils.c   |    2 +-
 drivers/acpi/acpica/rscreate.c  |    3 +--
 drivers/acpi/acpica/rsdump.c    |    3 ++-
 drivers/acpi/acpica/rsirq.c     |    6 ++----
 drivers/acpi/acpica/rsmemory.c  |    6 ++----
 drivers/acpi/acpica/rsmisc.c    |   11 ++++++-----
 drivers/acpi/acpica/rsutils.c   |    6 ++++--
 drivers/acpi/acpica/utresrc.c   |    7 +++----
 include/acpi/acpiosxf.h         |    4 +---
 16 files changed, 40 insertions(+), 50 deletions(-)

diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 74fe0f1..db82060 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -626,8 +626,9 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 	handler->address = address;
 	handler->context = context;
 	handler->method_node = gpe_event_info->dispatch.method_node;
-	handler->original_flags = gpe_event_info->flags &
-			(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
+	handler->original_flags = (u8)(gpe_event_info->flags &
+				       (ACPI_GPE_XRUPT_TYPE_MASK |
+				        ACPI_GPE_DISPATCH_MASK));
 
 	/*
 	 * If the GPE is associated with a method, it may have been enabled
@@ -746,10 +747,10 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
 	 * enabled, it should be enabled at this point to restore the
 	 * post-initialization configuration.
 	 */
-
-	if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD)
-	    && handler->originally_enabled)
+	if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) &&
+	    handler->originally_enabled) {
 		(void)acpi_ev_add_gpe_reference(gpe_event_info);
+	}
 
 	/* Now we can free the handler object */
 
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index bbf01e9..cf50c6c 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -948,13 +948,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 					 */
 					return_desc =
 					    acpi_ut_create_integer_object((u64)
-									  temp_desc->
-									  buffer.
-									  pointer
-									  [operand
-									   [0]->
-									   reference.
-									   value]);
+									  temp_desc->buffer.pointer[operand[0]->reference.value]);
 					if (!return_desc) {
 						status = AE_NO_MEMORY;
 						goto cleanup;
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 48c660a..06a4924 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -239,19 +239,19 @@ acpi_ex_system_memory_space_handler(u32 function,
 
 		switch (bit_width) {
 		case 8:
-			ACPI_SET8(logical_addr_ptr) = (u8) * value;
+			ACPI_SET8(logical_addr_ptr) = (u8)*value;
 			break;
 
 		case 16:
-			ACPI_SET16(logical_addr_ptr) = (u16) * value;
+			ACPI_SET16(logical_addr_ptr) = (u16)*value;
 			break;
 
 		case 32:
-			ACPI_SET32(logical_addr_ptr) = (u32) * value;
+			ACPI_SET32(logical_addr_ptr) = (u32)*value;
 			break;
 
 		case 64:
-			ACPI_SET64(logical_addr_ptr) = (u64) * value;
+			ACPI_SET64(logical_addr_ptr) = (u64)*value;
 			break;
 
 		default:
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c
index 90a9aea..effa2b0 100644
--- a/drivers/acpi/acpica/hwacpi.c
+++ b/drivers/acpi/acpica/hwacpi.c
@@ -108,8 +108,7 @@ acpi_status acpi_hw_set_mode(u32 mode)
 		 * enable bits to default
 		 */
 		status = acpi_hw_write_port(acpi_gbl_FADT.smi_command,
-					    (u32) acpi_gbl_FADT.acpi_disable,
-					    8);
+					    (u32)acpi_gbl_FADT.acpi_disable, 8);
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 				  "Attempting to enable Legacy (non-ACPI) mode\n"));
 		break;
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 165395f..83f73cf 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -364,8 +364,7 @@ acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control)
  * DESCRIPTION: Read from the specified ACPI register
  *
  ******************************************************************************/
-acpi_status
-acpi_hw_register_read(u32 register_id, u32 * return_value)
+acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value)
 {
 	u32 value = 0;
 	acpi_status status;
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 9018925..fdb818d 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -55,7 +55,8 @@ ACPI_MODULE_NAME("nsrepair2")
  */
 typedef
 acpi_status(*acpi_repair_function) (struct acpi_predefined_data *data,
-				    union acpi_operand_object **return_object_ptr);
+				    union acpi_operand_object
+				    **return_object_ptr);
 
 typedef struct acpi_repair_info {
 	char name[ACPI_NAME_SIZE];
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index b5b4cb7..7bfaa6f 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -112,7 +112,7 @@ acpi_ns_print_node_pathname(struct acpi_namespace_node *node,
 u8 acpi_ns_valid_root_prefix(char prefix)
 {
 
-	return ((u8) (prefix == '\\'));
+	return ((u8)(prefix == '\\'));
 }
 
 /*******************************************************************************
@@ -130,7 +130,7 @@ u8 acpi_ns_valid_root_prefix(char prefix)
 static u8 acpi_ns_valid_path_separator(char sep)
 {
 
-	return ((u8) (sep == '.'));
+	return ((u8)(sep == '.'));
 }
 
 /*******************************************************************************
@@ -674,7 +674,7 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
 		return_UINT32(ACPI_NS_NORMAL);
 	}
 
-	return_UINT32(((u32) acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
+	return_UINT32(((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index 4137dcb..afefb3a1 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -206,7 +206,7 @@ u8 acpi_ps_is_leading_char(u32 c)
  */
 u8 acpi_ps_is_prefix_char(u32 c)
 {
-	return ((u8) (c == '\\' || c == '^'));
+	return ((u8)(c == '\\' || c == '^'));
 }
 
 /*
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index 311cbc4..8133326 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -480,8 +480,7 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
 	status = acpi_rs_get_aml_length(linked_list_buffer, &aml_size_needed);
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
-			  (u32) aml_size_needed,
-			  acpi_format_exception(status)));
+			  (u32)aml_size_needed, acpi_format_exception(status)));
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index 4d11b072..276e52f 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -654,7 +654,8 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
 			/*
 			 * Optional resource_source for Address resources
 			 */
-			acpi_rs_dump_resource_source(ACPI_CAST_PTR(struct
+			acpi_rs_dump_resource_source(ACPI_CAST_PTR
+						     (struct
 								   acpi_resource_source,
 								   target));
 			break;
diff --git a/drivers/acpi/acpica/rsirq.c b/drivers/acpi/acpica/rsirq.c
index e23a9ec..a718eca 100644
--- a/drivers/acpi/acpica/rsirq.c
+++ b/drivers/acpi/acpica/rsirq.c
@@ -212,15 +212,13 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
 
 	{ACPI_RSC_COUNT, ACPI_RS_OFFSET(data.extended_irq.interrupt_count),
 	 AML_OFFSET(extended_irq.interrupt_count),
-	 sizeof(u32)}
-	,
+	 sizeof(u32)},
 
 	/* Copy every IRQ in the table, each is 32 bits */
 
 	{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.extended_irq.interrupts[0]),
 	 AML_OFFSET(extended_irq.interrupts[0]),
-	 0}
-	,
+	 0},
 
 	/* Optional resource_source (Index and String) */
 
diff --git a/drivers/acpi/acpica/rsmemory.c b/drivers/acpi/acpica/rsmemory.c
index 4fd611a..d446103 100644
--- a/drivers/acpi/acpica/rsmemory.c
+++ b/drivers/acpi/acpica/rsmemory.c
@@ -156,8 +156,7 @@ struct acpi_rsconvert_info acpi_rs_get_vendor_small[3] = {
 
 	{ACPI_RSC_COUNT16, ACPI_RS_OFFSET(data.vendor.byte_length),
 	 0,
-	 sizeof(u8)}
-	,
+	 sizeof(u8)},
 
 	/* Vendor data */
 
@@ -181,8 +180,7 @@ struct acpi_rsconvert_info acpi_rs_get_vendor_large[3] = {
 
 	{ACPI_RSC_COUNT16, ACPI_RS_OFFSET(data.vendor.byte_length),
 	 0,
-	 sizeof(u8)}
-	,
+	 sizeof(u8)},
 
 	/* Vendor data */
 
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index c6f291c..3d0e15c 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -159,7 +159,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8) item_count;
+			ACPI_SET8(destination) = (u8)item_count;
 
 			resource->length = resource->length +
 			    (info->value * (item_count - 1));
@@ -385,7 +385,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			target = ACPI_ADD_PTR(char, resource, info->value);
-			ACPI_SET8(target) = (u8) item_count;
+			ACPI_SET8(target) = (u8)item_count;
 			break;
 
 		case ACPI_RSC_BITMASK16:
@@ -401,7 +401,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			target = ACPI_ADD_PTR(char, resource, info->value);
-			ACPI_SET8(target) = (u8) item_count;
+			ACPI_SET8(target) = (u8)item_count;
 			break;
 
 		case ACPI_RSC_EXIT_NE:
@@ -544,7 +544,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8) item_count;
+			ACPI_SET8(destination) = (u8)item_count;
 
 			aml_length =
 			    (u16) (aml_length +
@@ -686,7 +686,8 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			 * Optional resource_source (Index and String)
 			 */
 			aml_length =
-			    acpi_rs_set_resource_source(aml, (acpi_rs_length)
+			    acpi_rs_set_resource_source(aml,
+							(acpi_rs_length)
 							aml_length, source);
 			acpi_rs_set_resource_length(aml_length, aml);
 			break;
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 37d5241..441447f 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -358,8 +358,10 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length,
 		 *
 		 * Zero the entire area of the buffer.
 		 */
-		total_length = (u32)
-		ACPI_STRLEN(ACPI_CAST_PTR(char, &aml_resource_source[1])) + 1;
+		total_length =
+		    (u32)
+		    ACPI_STRLEN(ACPI_CAST_PTR(char, &aml_resource_source[1])) +
+		    1;
 		total_length = (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(total_length);
 
 		ACPI_MEMSET(resource_source->string_ptr, 0, total_length);
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index e38bef4..7d0a1b5 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -412,7 +412,7 @@ static const u8 acpi_gbl_resource_types[] = {
  ******************************************************************************/
 
 acpi_status
-acpi_ut_walk_aml_resources(u8 * aml,
+acpi_ut_walk_aml_resources(u8 *aml,
 			   acpi_size aml_length,
 			   acpi_walk_aml_callback user_function, void **context)
 {
@@ -525,7 +525,7 @@ acpi_ut_walk_aml_resources(u8 * aml,
  *
  ******************************************************************************/
 
-acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
+acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index)
 {
 	union aml_resource *aml_resource;
 	u8 resource_type;
@@ -800,8 +800,7 @@ u32 acpi_ut_get_descriptor_length(void *aml)
  ******************************************************************************/
 
 acpi_status
-acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc,
-			     u8 ** end_tag)
+acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, u8 **end_tag)
 {
 	acpi_status status;
 
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 4315274..7d0895b 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -102,10 +102,8 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
 /*
  * Spinlock primitives
  */
-
 #ifndef acpi_os_create_lock
-acpi_status
-acpi_os_create_lock(acpi_spinlock *out_handle);
+acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
 #endif
 
 void acpi_os_delete_lock(acpi_spinlock handle);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 04/15] ACPICA: Fixes code maintenance divergences.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (2 preceding siblings ...)
  2012-11-21 10:07 ` [PATCH 03/15] ACPICA: Fixes indent " Lv Zheng
@ 2012-11-21 10:07 ` Lv Zheng
  2012-11-27  3:46   ` Brown, Len
  2012-11-21 10:07 ` [PATCH 05/15] ACPICA: Fixes call depth check caused divergences Lv Zheng
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This patch fixes divergences caused by the simple code maintenance work:
1. Deletion of the unused include files.
2. Changing of the codes positions.
3. Replacing the values with the well defined macros.

Given the fact that Linux will not enable the following compilation macros:
1. ACPI_DEBUGGER
2. ACPI_REDUCED_HARDWARE
This patch will not affect the generated vmlinux binary.

This will decrease 270 lines of 20121018 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/accommon.h |    1 +
 drivers/acpi/acpica/acglobal.h |   33 +++++++++++++++++----------------
 drivers/acpi/acpica/amlresrc.h |    6 ++++++
 drivers/acpi/acpica/dsobject.c |    2 +-
 drivers/acpi/acpica/evgpe.c    |    2 +-
 drivers/acpi/acpica/hwregs.c   |    1 -
 drivers/acpi/acpica/hwsleep.c  |    3 ++-
 drivers/acpi/acpica/nsdumpdv.c |    1 -
 drivers/acpi/acpica/nsutils.c  |    1 -
 drivers/acpi/acpica/tbutils.c  |    4 ----
 drivers/acpi/acpica/utglobal.c |    3 ++-
 drivers/acpi/acpica/utmisc.c   |    8 ++++----
 drivers/acpi/acpica/utxface.c  |    4 ----
 include/acpi/acpiosxf.h        |    5 +++--
 include/acpi/acpixf.h          |   36 +++++++++++++++++-------------------
 15 files changed, 54 insertions(+), 56 deletions(-)

diff --git a/drivers/acpi/acpica/accommon.h b/drivers/acpi/acpica/accommon.h
index 8a7d51b..8632d71 100644
--- a/drivers/acpi/acpica/accommon.h
+++ b/drivers/acpi/acpica/accommon.h
@@ -51,6 +51,7 @@
  *
  * Note: The order of these include files is important.
  */
+#include <acpi/acconfig.h>	/* Global configuration constants */
 #include "acmacros.h"		/* C macros */
 #include "aclocal.h"		/* Internal data types */
 #include "acobject.h"		/* ACPI internal object */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 1ef7ca4..864806e 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -192,14 +192,6 @@ ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
 ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
 ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
 
-/* Mutex for _OSI support */
-
-ACPI_EXTERN acpi_mutex acpi_gbl_osi_mutex;
-
-/* Reader/Writer lock is used for namespace walk and dynamic table unload */
-
-ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;
-
 /*****************************************************************************
  *
  * Mutual exclusion within ACPICA subsystem
@@ -233,6 +225,14 @@ ACPI_EXTERN u8 acpi_gbl_global_lock_pending;
 ACPI_EXTERN acpi_spinlock acpi_gbl_gpe_lock;	/* For GPE data structs and registers */
 ACPI_EXTERN acpi_spinlock acpi_gbl_hardware_lock;	/* For ACPI H/W except GPE registers */
 
+/* Mutex for _OSI support */
+
+ACPI_EXTERN acpi_mutex acpi_gbl_osi_mutex;
+
+/* Reader/Writer lock is used for namespace walk and dynamic table unload */
+
+ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;
+
 /*****************************************************************************
  *
  * Miscellaneous globals
@@ -304,6 +304,7 @@ extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
 ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
 ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
 ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
+ACPI_EXTERN u8 acpi_gbl_disable_mem_tracking;
 #endif
 
 /*****************************************************************************
@@ -365,19 +366,18 @@ ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
  *
  ****************************************************************************/
 
-extern struct acpi_fixed_event_info
-    acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
-ACPI_EXTERN struct acpi_fixed_event_handler
-    acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
-ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
-ACPI_EXTERN struct acpi_gpe_block_info
-*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
-
 #if (!ACPI_REDUCED_HARDWARE)
 
 ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized;
+ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
+ACPI_EXTERN struct acpi_gpe_block_info
+    *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
 ACPI_EXTERN acpi_gbl_event_handler acpi_gbl_global_event_handler;
 ACPI_EXTERN void *acpi_gbl_global_event_handler_context;
+ACPI_EXTERN struct acpi_fixed_event_handler
+    acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
+extern struct acpi_fixed_event_info
+    acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
 
 #endif				/* !ACPI_REDUCED_HARDWARE */
 
@@ -428,6 +428,7 @@ extern u8 acpi_gbl_db_terminate_threads;
 ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
 ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
 ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
+ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;
 
 ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
 ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h
index 9684496..bdbb7d0 100644
--- a/drivers/acpi/acpica/amlresrc.h
+++ b/drivers/acpi/acpica/amlresrc.h
@@ -199,6 +199,12 @@ struct aml_resource_fixed_dma {
 struct aml_resource_large_header {
 AML_RESOURCE_LARGE_HEADER_COMMON};
 
+/* General Flags for address space resource descriptors */
+
+#define ACPI_RESOURCE_FLAG_DEC      2
+#define ACPI_RESOURCE_FLAG_MIF      4
+#define ACPI_RESOURCE_FLAG_MAF      8
+
 struct aml_resource_memory24 {
 	AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
 	u16 minimum;
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index c9f15d3..13844a1 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -388,7 +388,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 	union acpi_parse_object *parent;
 	union acpi_operand_object *obj_desc = NULL;
 	acpi_status status = AE_OK;
-	unsigned i;
+	u32 i;
 	u16 index;
 	u16 reference_count;
 
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index a137ce81..4cbb600 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -765,7 +765,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
 					 gpe_event_info);
 		if (ACPI_FAILURE(status)) {
 			ACPI_EXCEPTION((AE_INFO, status,
-					"Unable to queue handler for GPE%2X - event disabled",
+					"Unable to queue handler for GPE%02X - event disabled",
 					gpe_number));
 		}
 		break;
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 83f73cf..fd4e2dc 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -44,7 +44,6 @@
 
 #include <acpi/acpi.h>
 #include "accommon.h"
-#include "acnamesp.h"
 #include "acevents.h"
 
 #define _COMPONENT          ACPI_HARDWARE
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index 3fddde0..11a2951 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -323,7 +323,8 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
 	 * and use it to determine whether the system is rebooting or
 	 * resuming. Clear WAK_STS for compatibility.
 	 */
-	acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, 1);
+	(void)acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS,
+				      ACPI_CLEAR_STATUS);
 	acpi_gbl_system_awake_and_running = TRUE;
 
 	/* Enable power button */
diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c
index 944d4c8..4ae9360 100644
--- a/drivers/acpi/acpica/nsdumpdv.c
+++ b/drivers/acpi/acpica/nsdumpdv.c
@@ -42,7 +42,6 @@
  */
 
 #include <acpi/acpi.h>
-#include "accommon.h"
 
 /* TBD: This entire module is apparently obsolete and should be removed */
 
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 7bfaa6f..7e8bd2a 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -46,7 +46,6 @@
 #include "accommon.h"
 #include "acnamesp.h"
 #include "amlcode.h"
-#include "actables.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsutils")
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 285e24b..b4469a6 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -384,10 +384,6 @@ void acpi_tb_check_dsdt_header(void)
 		acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
 		acpi_tb_print_table_header(0, acpi_gbl_DSDT);
 
-		ACPI_ERROR((AE_INFO,
-			    "Please send DMI info to linux-acpi@vger.kernel.org\n"
-			    "If system does not work as expected, please boot with acpi=copy_dsdt"));
-
 		/* Disable further error messages */
 
 		acpi_gbl_original_dsdt_header.length = acpi_gbl_DSDT->length;
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index c083611..7b4dd21 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -293,11 +293,11 @@ acpi_status acpi_ut_init_globals(void)
 
 	/* GPE support */
 
+	acpi_gbl_all_gpes_initialized = FALSE;
 	acpi_gbl_gpe_xrupt_list_head = NULL;
 	acpi_gbl_gpe_fadt_blocks[0] = NULL;
 	acpi_gbl_gpe_fadt_blocks[1] = NULL;
 	acpi_current_gpe_count = 0;
-	acpi_gbl_all_gpes_initialized = FALSE;
 
 	acpi_gbl_global_event_handler = NULL;
 
@@ -367,6 +367,7 @@ acpi_status acpi_ut_init_globals(void)
 
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 	acpi_gbl_display_final_mem_stats = FALSE;
+	acpi_gbl_disable_mem_tracking = FALSE;
 #endif
 
 	return_ACPI_STATUS(AE_OK);
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
index 9286a69..2881992 100644
--- a/drivers/acpi/acpica/utmisc.c
+++ b/drivers/acpi/acpica/utmisc.c
@@ -748,12 +748,12 @@ void acpi_ut_repair_name(char *name)
 
 		if (!acpi_gbl_enable_interpreter_slack) {
 			ACPI_WARNING((AE_INFO,
-				      "Found bad character(s) in name, repaired: [%4.4s]\n",
-				      name));
+				      "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
+					  original_name, name));
 		} else {
 			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-					  "Found bad character(s) in name, repaired: [%4.4s]\n",
-					  name));
+					  "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
+					  original_name, name));
 		}
 	}
 }
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 390db0c..cb85a7b 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -44,11 +44,7 @@
 #include <linux/export.h>
 #include <acpi/acpi.h>
 #include "accommon.h"
-#include "acevents.h"
-#include "acnamesp.h"
 #include "acdebug.h"
-#include "actables.h"
-#include "acinterp.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utxface")
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 7d0895b..6a44a38 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -178,12 +178,13 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object);
  * Interrupt handlers
  */
 acpi_status
-acpi_os_install_interrupt_handler(u32 gsi,
+acpi_os_install_interrupt_handler(u32 interrupt_number,
 				  acpi_osd_handler service_routine,
 				  void *context);
 
 acpi_status
-acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine);
+acpi_os_remove_interrupt_handler(u32 interrupt_number,
+				 acpi_osd_handler service_routine);
 
 void acpi_os_gpe_count(u32 gpe_number);
 void acpi_os_fixed_event_count(u32 fixed_event_number);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index d8ec35b..e0c7303 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -58,6 +58,10 @@ extern u8 acpi_gbl_permanent_mmap;
 /*
  * Globals that are publically available
  */
+extern u32 acpi_current_gpe_count;
+extern struct acpi_table_fadt acpi_gbl_FADT;
+extern u8 acpi_gbl_system_awake_and_running;
+extern u8 acpi_gbl_reduced_hardware;	/* ACPI 5.0 */
 
 /* Runtime configuration of debug print levels */
 
@@ -104,11 +108,6 @@ extern u8 acpi_gbl_disable_auto_repair;
 
 #endif				/* !ACPI_REDUCED_HARDWARE */
 
-extern u32 acpi_current_gpe_count;
-extern struct acpi_table_fadt acpi_gbl_FADT;
-extern u8 acpi_gbl_system_awake_and_running;
-extern u8 acpi_gbl_reduced_hardware;	/* ACPI 5.0 */
-
 extern u32 acpi_rsdt_forced;
 /*
  * Initialization
@@ -469,6 +468,10 @@ acpi_buffer_to_resource(u8 *aml_buffer,
  */
 acpi_status acpi_reset(void);
 
+acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg);
+
+acpi_status acpi_write(u64 value, struct acpi_generic_address *reg);
+
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				acpi_read_bit_register(u32 register_id,
 						       u32 *return_value))
@@ -477,20 +480,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				acpi_write_bit_register(u32 register_id,
 							u32 value))
 
-ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
-				acpi_set_firmware_waking_vector(u32
-								physical_address))
-
-#if ACPI_MACHINE_WIDTH == 64
-ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
-				acpi_set_firmware_waking_vector64(u64
-								  physical_address))
-#endif
-
-acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg);
-
-acpi_status acpi_write(u64 value, struct acpi_generic_address *reg);
-
 /*
  * Sleep/Wake interfaces
  */
@@ -507,6 +496,15 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
 
 acpi_status acpi_leave_sleep_state(u8 sleep_state);
 
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				acpi_set_firmware_waking_vector(u32
+								physical_address))
+
+#if ACPI_MACHINE_WIDTH == 64
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				acpi_set_firmware_waking_vector64(u64
+								  physical_address))
+#endif
 /*
  * ACPI Timer interfaces
  */
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 05/15] ACPICA: Fixes call depth check caused divergences.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (3 preceding siblings ...)
  2012-11-21 10:07 ` [PATCH 04/15] ACPICA: Fixes code maintenance divergences Lv Zheng
@ 2012-11-21 10:07 ` Lv Zheng
  2012-11-27  3:52   ` Brown, Len
  2012-11-21 10:07 ` [PATCH 06/15] ACPICA: Fix possible memory leak Lv Zheng
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

The ACPICA uses a call depth check mechnism by wrapping the return statements.
This patch fixes divergences caused by this mechanism.

This patch will not affect the generated vmlinux binary.
This will decrease 340 lines of 20121018 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/exconfig.c |    4 ++--
 drivers/acpi/acpica/exfldio.c  |    1 -
 drivers/acpi/acpica/hwgpe.c    |    6 ++++--
 drivers/acpi/acpica/hwvalid.c  |   18 +++++++++---------
 drivers/acpi/acpica/nspredef.c |    2 +-
 drivers/acpi/acpica/nswalk.c   |    4 ++--
 drivers/acpi/acpica/nsxfeval.c |    4 ++--
 drivers/acpi/acpica/nsxfname.c |   14 +++++++-------
 drivers/acpi/acpica/rscalc.c   |    2 +-
 drivers/acpi/acpica/rsutils.c  |    2 +-
 drivers/acpi/acpica/tbutils.c  |    2 +-
 drivers/acpi/acpica/utcopy.c   |    4 ++--
 drivers/acpi/acpica/utlock.c   |   14 +++++++-------
 13 files changed, 39 insertions(+), 38 deletions(-)

diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index b4f42f5..d0cc2a4 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -304,7 +304,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer)
 		    acpi_ev_address_space_dispatch(obj_desc, NULL, ACPI_READ,
 						   region_offset, 8, &value);
 		if (ACPI_FAILURE(status)) {
-			return status;
+			return (status);
 		}
 
 		*buffer = (u8)value;
@@ -312,7 +312,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer)
 		region_offset++;
 	}
 
-	return AE_OK;
+	return (AE_OK);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index aa2ccfb..2c2146c 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -329,7 +329,6 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
 static u8
 acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value)
 {
-	ACPI_FUNCTION_NAME(ex_register_overflow);
 
 	if (obj_desc->common_field.bit_length >= ACPI_INTEGER_BIT_SIZE) {
 		/*
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 6456004..095666b 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -69,8 +69,10 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 
 u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info)
 {
-	return (u32)1 << (gpe_event_info->gpe_number -
-		 gpe_event_info->register_info->base_gpe_number);
+
+	return ((u32)1 <<
+		(gpe_event_info->gpe_number -
+		 gpe_event_info->register_info->base_gpe_number));
 }
 
 /******************************************************************************
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
index b6aae58..70686cd 100644
--- a/drivers/acpi/acpica/hwvalid.c
+++ b/drivers/acpi/acpica/hwvalid.c
@@ -135,7 +135,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
 	if ((bit_width != 8) && (bit_width != 16) && (bit_width != 32)) {
 		ACPI_ERROR((AE_INFO,
 			    "Bad BitWidth parameter: %8.8X", bit_width));
-		return AE_BAD_PARAMETER;
+		return (AE_BAD_PARAMETER);
 	}
 
 	port_info = acpi_protected_ports;
@@ -234,11 +234,11 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
 	status = acpi_hw_validate_io_request(address, width);
 	if (ACPI_SUCCESS(status)) {
 		status = acpi_os_read_port(address, value, width);
-		return status;
+		return (status);
 	}
 
 	if (status != AE_AML_ILLEGAL_ADDRESS) {
-		return status;
+		return (status);
 	}
 
 	/*
@@ -253,7 +253,7 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
 		if (acpi_hw_validate_io_request(address, 8) == AE_OK) {
 			status = acpi_os_read_port(address, &one_byte, 8);
 			if (ACPI_FAILURE(status)) {
-				return status;
+				return (status);
 			}
 
 			*value |= (one_byte << i);
@@ -262,7 +262,7 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
 		address++;
 	}
 
-	return AE_OK;
+	return (AE_OK);
 }
 
 /******************************************************************************
@@ -297,11 +297,11 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width)
 	status = acpi_hw_validate_io_request(address, width);
 	if (ACPI_SUCCESS(status)) {
 		status = acpi_os_write_port(address, value, width);
-		return status;
+		return (status);
 	}
 
 	if (status != AE_AML_ILLEGAL_ADDRESS) {
-		return status;
+		return (status);
 	}
 
 	/*
@@ -317,12 +317,12 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width)
 			status =
 			    acpi_os_write_port(address, (value >> i) & 0xFF, 8);
 			if (ACPI_FAILURE(status)) {
-				return status;
+				return (status);
 			}
 		}
 
 		address++;
 	}
 
-	return AE_OK;
+	return (AE_OK);
 }
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 352be3b..1f0e934 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -147,7 +147,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
 
 	pathname = acpi_ns_get_external_pathname(node);
 	if (!pathname) {
-		return AE_OK;	/* Could not get pathname, ignore */
+		return (AE_OK);	/* Could not get pathname, ignore */
 	}
 
 	/*
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index 0483877..4657e75 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -76,12 +76,12 @@ struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node
 
 		/* It's really the parent's _scope_ that we want */
 
-		return parent_node->child;
+		return (parent_node->child);
 	}
 
 	/* Otherwise just return the next peer */
 
-	return child_node->peer;
+	return (child_node->peer);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index d6a9f77..b8e4463 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -492,7 +492,7 @@ acpi_walk_namespace(acpi_object_type type,
 	 */
 	status = acpi_ut_acquire_read_lock(&acpi_gbl_namespace_rw_lock);
 	if (ACPI_FAILURE(status)) {
-		return status;
+		return_ACPI_STATUS(status);
 	}
 
 	/*
@@ -550,7 +550,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 
 	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
 	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
+		return (status);
 	}
 
 	node = acpi_ns_validate_handle(obj_handle);
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 811c6f1..520bab4 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -539,14 +539,14 @@ acpi_status acpi_install_method(u8 *buffer)
 	/* Parameter validation */
 
 	if (!buffer) {
-		return AE_BAD_PARAMETER;
+		return (AE_BAD_PARAMETER);
 	}
 
 	/* Table must be a DSDT or SSDT */
 
 	if (!ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) &&
 	    !ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT)) {
-		return AE_BAD_HEADER;
+		return (AE_BAD_HEADER);
 	}
 
 	/* First AML opcode in the table must be a control method */
@@ -554,7 +554,7 @@ acpi_status acpi_install_method(u8 *buffer)
 	parser_state.aml = buffer + sizeof(struct acpi_table_header);
 	opcode = acpi_ps_peek_opcode(&parser_state);
 	if (opcode != AML_METHOD_OP) {
-		return AE_BAD_PARAMETER;
+		return (AE_BAD_PARAMETER);
 	}
 
 	/* Extract method information from the raw AML */
@@ -572,13 +572,13 @@ acpi_status acpi_install_method(u8 *buffer)
 	 */
 	aml_buffer = ACPI_ALLOCATE(aml_length);
 	if (!aml_buffer) {
-		return AE_NO_MEMORY;
+		return (AE_NO_MEMORY);
 	}
 
 	method_obj = acpi_ut_create_internal_object(ACPI_TYPE_METHOD);
 	if (!method_obj) {
 		ACPI_FREE(aml_buffer);
-		return AE_NO_MEMORY;
+		return (AE_NO_MEMORY);
 	}
 
 	/* Lock namespace for acpi_ns_lookup, we may be creating a new node */
@@ -644,12 +644,12 @@ acpi_status acpi_install_method(u8 *buffer)
 	/* Remove local reference to the method object */
 
 	acpi_ut_remove_reference(method_obj);
-	return status;
+	return (status);
 
 error_exit:
 
 	ACPI_FREE(aml_buffer);
 	ACPI_FREE(method_obj);
-	return status;
+	return (status);
 }
 ACPI_EXPORT_SYMBOL(acpi_install_method)
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index 147feb6..4f39bd6 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -84,7 +84,7 @@ static u8 acpi_rs_count_set_bits(u16 bit_field)
 		bit_field &= (u16) (bit_field - 1);
 	}
 
-	return bits_set;
+	return (bits_set);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 441447f..5adae5a 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -108,7 +108,7 @@ u16 acpi_rs_encode_bitmask(u8 * list, u8 count)
 		mask |= (0x1 << list[i]);
 	}
 
-	return mask;
+	return (mask);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index b4469a6..8b987e6 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -147,7 +147,7 @@ acpi_status acpi_tb_initialize_facs(void)
 					 ACPI_CAST_INDIRECT_PTR(struct
 								acpi_table_header,
 								&acpi_gbl_FACS));
-	return status;
+	return (status);
 }
 #endif				/* !ACPI_REDUCED_HARDWARE */
 
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index 294692a..99549ee 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -785,7 +785,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
 
 		status = acpi_os_create_mutex(&dest_desc->mutex.os_mutex);
 		if (ACPI_FAILURE(status)) {
-			return status;
+			return (status);
 		}
 		break;
 
@@ -795,7 +795,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
 						  &dest_desc->event.
 						  os_semaphore);
 		if (ACPI_FAILURE(status)) {
-			return status;
+			return (status);
 		}
 		break;
 
diff --git a/drivers/acpi/acpica/utlock.c b/drivers/acpi/acpica/utlock.c
index b1eb7f1..8d1a749 100644
--- a/drivers/acpi/acpica/utlock.c
+++ b/drivers/acpi/acpica/utlock.c
@@ -66,11 +66,11 @@ acpi_status acpi_ut_create_rw_lock(struct acpi_rw_lock *lock)
 	lock->num_readers = 0;
 	status = acpi_os_create_mutex(&lock->reader_mutex);
 	if (ACPI_FAILURE(status)) {
-		return status;
+		return (status);
 	}
 
 	status = acpi_os_create_mutex(&lock->writer_mutex);
-	return status;
+	return (status);
 }
 
 void acpi_ut_delete_rw_lock(struct acpi_rw_lock *lock)
@@ -108,7 +108,7 @@ acpi_status acpi_ut_acquire_read_lock(struct acpi_rw_lock *lock)
 
 	status = acpi_os_acquire_mutex(lock->reader_mutex, ACPI_WAIT_FOREVER);
 	if (ACPI_FAILURE(status)) {
-		return status;
+		return (status);
 	}
 
 	/* Acquire the write lock only for the first reader */
@@ -121,7 +121,7 @@ acpi_status acpi_ut_acquire_read_lock(struct acpi_rw_lock *lock)
 	}
 
 	acpi_os_release_mutex(lock->reader_mutex);
-	return status;
+	return (status);
 }
 
 acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock)
@@ -130,7 +130,7 @@ acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock)
 
 	status = acpi_os_acquire_mutex(lock->reader_mutex, ACPI_WAIT_FOREVER);
 	if (ACPI_FAILURE(status)) {
-		return status;
+		return (status);
 	}
 
 	/* Release the write lock only for the very last reader */
@@ -141,7 +141,7 @@ acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock)
 	}
 
 	acpi_os_release_mutex(lock->reader_mutex);
-	return status;
+	return (status);
 }
 
 /*******************************************************************************
@@ -165,7 +165,7 @@ acpi_status acpi_ut_acquire_write_lock(struct acpi_rw_lock *lock)
 	acpi_status status;
 
 	status = acpi_os_acquire_mutex(lock->writer_mutex, ACPI_WAIT_FOREVER);
-	return status;
+	return (status);
 }
 
 void acpi_ut_release_write_lock(struct acpi_rw_lock *lock)
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 06/15] ACPICA: Fix possible memory leak.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (4 preceding siblings ...)
  2012-11-21 10:07 ` [PATCH 05/15] ACPICA: Fixes call depth check caused divergences Lv Zheng
@ 2012-11-21 10:07 ` Lv Zheng
  2012-11-21 10:07 ` [PATCH 07/15] ACPICA: Performance enhancement for ACPI package objects Lv Zheng
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Jesper Juhl, Bob Moore, Lv Zheng

From: Jesper Juhl <jj@chaosbits.net>

Ensure cleanup after a memory allocation failure in dsmethod.c.
Original Linux change from Jesper Juhl.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/dsmethod.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index f7a7cf3..4ce1d57 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -376,7 +376,8 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 	 */
 	info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
 	if (!info) {
-		return_ACPI_STATUS(AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup;
 	}
 
 	info->parameters = &this_walk_state->operands[0];
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 07/15] ACPICA: Performance enhancement for ACPI package objects.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (5 preceding siblings ...)
  2012-11-21 10:07 ` [PATCH 06/15] ACPICA: Fix possible memory leak Lv Zheng
@ 2012-11-21 10:07 ` Lv Zheng
  2012-11-21 10:07 ` [PATCH 08/15] ACPICA: Performance: Remove function tracing from critical allocation functions Lv Zheng
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Chao Guan, Bob Moore, Lv Zheng

From: Chao Guan <chao.guan@intel.com>

This change greatly increases the performance of package objects
within the interpreter. It changes the processing of reference
counts for packages by optimizing for the most common case where
the package subobjects are either integers, strings, or buffers.
Increases the performance of the ASLTS test suite by 1.5X.
Chao Guan. ACPICA BZ 943.
https://www.acpica.org/bugzilla/show_bug.cgi?id=943

Signed-off-by: Chao Guan <chao.guan@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/utdelete.c |   42 +++++++++++++++++++++++++++++++---------
 1 file changed, 33 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index 7981054..e806fb0 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -530,18 +530,42 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 			 */
 			for (i = 0; i < object->package.count; i++) {
 				/*
-				 * Push each element onto the stack for later processing.
-				 * Note: There can be null elements within the package,
-				 * these are simply ignored
+				 * Null package elements are legal and can be simply
+				 * ignored.
 				 */
-				status =
-				    acpi_ut_create_update_state_and_push
-				    (object->package.elements[i], action,
-				     &state_list);
-				if (ACPI_FAILURE(status)) {
-					goto error_exit;
+				next_object = object->package.elements[i];
+				if (!next_object) {
+					continue;
+				}
+
+				switch (next_object->common.type) {
+				case ACPI_TYPE_INTEGER:
+				case ACPI_TYPE_STRING:
+				case ACPI_TYPE_BUFFER:
+					/*
+					 * For these very simple sub-objects, we can just
+					 * update the reference count here and continue.
+					 * Greatly increases performance of this operation.
+					 */
+					acpi_ut_update_ref_count(next_object,
+								 action);
+					break;
+
+				default:
+					/*
+					 * For complex sub-objects, push them onto the stack
+					 * for later processing (this eliminates recursion.)
+					 */
+					status =
+					    acpi_ut_create_update_state_and_push
+					    (next_object, action, &state_list);
+					if (ACPI_FAILURE(status)) {
+						goto error_exit;
+					}
+					break;
 				}
 			}
+			next_object = NULL;
 			break;
 
 		case ACPI_TYPE_BUFFER_FIELD:
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 08/15] ACPICA: Performance: Remove function tracing from critical allocation functions.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (6 preceding siblings ...)
  2012-11-21 10:07 ` [PATCH 07/15] ACPICA: Performance enhancement for ACPI package objects Lv Zheng
@ 2012-11-21 10:07 ` Lv Zheng
  2012-11-21 10:08 ` [PATCH 09/15] ACPICA: Debugger: Major update for the Disassemble<method> command Lv Zheng
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

Tracing is no longer needed for many of the low-level function.
Removing the trace mechanism from these functions improves
performance a small amount, also simplifies the debug trace output.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/nsutils.c  |    8 ++++----
 drivers/acpi/acpica/utdelete.c |   26 +++++++++++++-------------
 drivers/acpi/acpica/uteval.c   |    2 +-
 drivers/acpi/acpica/utstate.c  |   40 ++++++++++++++++++----------------------
 drivers/acpi/acpica/uttrack.c  |   16 ++++++++--------
 5 files changed, 44 insertions(+), 48 deletions(-)

diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 7e8bd2a..4479654 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -663,17 +663,17 @@ void acpi_ns_terminate(void)
 
 u32 acpi_ns_opens_scope(acpi_object_type type)
 {
-	ACPI_FUNCTION_TRACE_STR(ns_opens_scope, acpi_ut_get_type_name(type));
+	ACPI_FUNCTION_ENTRY();
 
-	if (!acpi_ut_valid_object_type(type)) {
+	if (type > ACPI_TYPE_LOCAL_MAX) {
 
 		/* type code out of range  */
 
 		ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type));
-		return_UINT32(ACPI_NS_NORMAL);
+		return (ACPI_NS_NORMAL);
 	}
 
-	return_UINT32(((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
+	return (((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index e806fb0..53e6af8 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -340,7 +340,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list)
 {
 	union acpi_operand_object **internal_obj;
 
-	ACPI_FUNCTION_TRACE(ut_delete_internal_object_list);
+	ACPI_FUNCTION_NAME(ut_delete_internal_object_list);
 
 	/* Walk the null-terminated internal list */
 
@@ -351,7 +351,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list)
 	/* Free the combined parameter pointer list and object array */
 
 	ACPI_FREE(obj_list);
-	return_VOID;
+	return;
 }
 
 /*******************************************************************************
@@ -484,7 +484,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 	union acpi_generic_state *state;
 	u32 i;
 
-	ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object);
+	ACPI_FUNCTION_NAME(ut_update_object_reference);
 
 	while (object) {
 
@@ -493,7 +493,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 		if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) {
 			ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
 					  "Object %p is NS handle\n", object));
-			return_ACPI_STATUS(AE_OK);
+			return (AE_OK);
 		}
 
 		/*
@@ -643,7 +643,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 		}
 	}
 
-	return_ACPI_STATUS(AE_OK);
+	return (AE_OK);
 
       error_exit:
 
@@ -657,7 +657,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 		acpi_ut_delete_generic_state(state);
 	}
 
-	return_ACPI_STATUS(status);
+	return (status);
 }
 
 /*******************************************************************************
@@ -676,12 +676,12 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 void acpi_ut_add_reference(union acpi_operand_object *object)
 {
 
-	ACPI_FUNCTION_TRACE_PTR(ut_add_reference, object);
+	ACPI_FUNCTION_NAME(ut_add_reference);
 
 	/* Ensure that we have a valid object */
 
 	if (!acpi_ut_valid_internal_object(object)) {
-		return_VOID;
+		return;
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
@@ -691,7 +691,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object)
 	/* Increment the reference count */
 
 	(void)acpi_ut_update_object_reference(object, REF_INCREMENT);
-	return_VOID;
+	return;
 }
 
 /*******************************************************************************
@@ -709,7 +709,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object)
 void acpi_ut_remove_reference(union acpi_operand_object *object)
 {
 
-	ACPI_FUNCTION_TRACE_PTR(ut_remove_reference, object);
+	ACPI_FUNCTION_NAME(ut_remove_reference);
 
 	/*
 	 * Allow a NULL pointer to be passed in, just ignore it. This saves
@@ -718,13 +718,13 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
 	 */
 	if (!object ||
 	    (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) {
-		return_VOID;
+		return;
 	}
 
 	/* Ensure that we have a valid object */
 
 	if (!acpi_ut_valid_internal_object(object)) {
-		return_VOID;
+		return;
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
@@ -737,5 +737,5 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
 	 * of all subobjects!)
 	 */
 	(void)acpi_ut_update_object_reference(object, REF_DECREMENT);
-	return_VOID;
+	return;
 }
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index a9c65fb..45cddb8 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -68,7 +68,7 @@ ACPI_MODULE_NAME("uteval")
  ******************************************************************************/
 
 acpi_status
-acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
+acpi_ut_evaluate_object(struct acpi_namespace_node * prefix_node,
 			char *path,
 			u32 expected_return_btypes,
 			union acpi_operand_object **return_desc)
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c
index cee0473..26a0c23 100644
--- a/drivers/acpi/acpica/utstate.c
+++ b/drivers/acpi/acpica/utstate.c
@@ -97,14 +97,13 @@ void
 acpi_ut_push_generic_state(union acpi_generic_state **list_head,
 			   union acpi_generic_state *state)
 {
-	ACPI_FUNCTION_TRACE(ut_push_generic_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Push the state object onto the front of the list (stack) */
 
 	state->common.next = *list_head;
 	*list_head = state;
-
-	return_VOID;
+	return;
 }
 
 /*******************************************************************************
@@ -124,7 +123,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE(ut_pop_generic_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Remove the state object at the head of the list (stack) */
 
@@ -136,7 +135,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
 		*list_head = state->common.next;
 	}
 
-	return_PTR(state);
+	return (state);
 }
 
 /*******************************************************************************
@@ -186,13 +185,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE(ut_create_thread_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Create the generic state object */
 
 	state = acpi_ut_create_generic_state();
 	if (!state) {
-		return_PTR(NULL);
+		return (NULL);
 	}
 
 	/* Init fields specific to the update struct */
@@ -207,7 +206,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
 		state->thread.thread_id = (acpi_thread_id) 1;
 	}
 
-	return_PTR((struct acpi_thread_state *)state);
+	return ((struct acpi_thread_state *)state);
 }
 
 /*******************************************************************************
@@ -230,13 +229,13 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE_PTR(ut_create_update_state, object);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Create the generic state object */
 
 	state = acpi_ut_create_generic_state();
 	if (!state) {
-		return_PTR(NULL);
+		return (NULL);
 	}
 
 	/* Init fields specific to the update struct */
@@ -244,8 +243,7 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
 	state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE;
 	state->update.object = object;
 	state->update.value = action;
-
-	return_PTR(state);
+	return (state);
 }
 
 /*******************************************************************************
@@ -267,13 +265,13 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE_PTR(ut_create_pkg_state, internal_object);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Create the generic state object */
 
 	state = acpi_ut_create_generic_state();
 	if (!state) {
-		return_PTR(NULL);
+		return (NULL);
 	}
 
 	/* Init fields specific to the update struct */
@@ -283,8 +281,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
 	state->pkg.dest_object = external_object;
 	state->pkg.index = index;
 	state->pkg.num_packages = 1;
-
-	return_PTR(state);
+	return (state);
 }
 
 /*******************************************************************************
@@ -304,21 +301,20 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE(ut_create_control_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Create the generic state object */
 
 	state = acpi_ut_create_generic_state();
 	if (!state) {
-		return_PTR(NULL);
+		return (NULL);
 	}
 
 	/* Init fields specific to the control struct */
 
 	state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
 	state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
-
-	return_PTR(state);
+	return (state);
 }
 
 /*******************************************************************************
@@ -336,12 +332,12 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
 
 void acpi_ut_delete_generic_state(union acpi_generic_state *state)
 {
-	ACPI_FUNCTION_TRACE(ut_delete_generic_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Ignore null state */
 
 	if (state) {
 		(void)acpi_os_release_object(acpi_gbl_state_cache, state);
 	}
-	return_VOID;
+	return;
 }
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index a424a9e..866f96e 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -436,10 +436,10 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
 	struct acpi_memory_list *mem_list;
 	acpi_status status;
 
-	ACPI_FUNCTION_TRACE(ut_remove_allocation);
+	ACPI_FUNCTION_NAME(ut_remove_allocation);
 
 	if (acpi_gbl_disable_mem_tracking) {
-		return_ACPI_STATUS(AE_OK);
+		return (AE_OK);
 	}
 
 	mem_list = acpi_gbl_global_list;
@@ -450,12 +450,12 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
 		ACPI_ERROR((module, line,
 			    "Empty allocation list, nothing to free!"));
 
-		return_ACPI_STATUS(AE_OK);
+		return (AE_OK);
 	}
 
 	status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
 	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
+		return (status);
 	}
 
 	/* Unlink */
@@ -470,15 +470,15 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
 		(allocation->next)->previous = allocation->previous;
 	}
 
+	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing %p, size 0%X\n",
+			  &allocation->user_space, allocation->size));
+
 	/* Mark the segment as deleted */
 
 	ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size);
 
-	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
-			  allocation->size));
-
 	status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
-	return_ACPI_STATUS(status);
+	return (status);
 }
 
 /*******************************************************************************
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 09/15] ACPICA: Debugger: Major update for the Disassemble<method> command.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (7 preceding siblings ...)
  2012-11-21 10:07 ` [PATCH 08/15] ACPICA: Performance: Remove function tracing from critical allocation functions Lv Zheng
@ 2012-11-21 10:08 ` Lv Zheng
  2012-11-27  3:58   ` Brown, Len
  2012-11-21 10:08 ` [PATCH 10/15] ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags Lv Zheng
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:08 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

This command was downreved and did not properly disassemble control
methods with any reasonable complexity. This fix brings the command
up to the same level as the rest of the disassembler.  Adds one
new file, dmdeferred.c, which is existing code that is now common
with the main disassembler and the debugger disassembl command.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acdisasm.h |   10 ++++--
 drivers/acpi/acpica/acutils.h  |    7 ++--
 drivers/acpi/acpica/rscalc.c   |    4 ++-
 drivers/acpi/acpica/rscreate.c |    4 +--
 drivers/acpi/acpica/rslist.c   |    7 ++--
 drivers/acpi/acpica/utresrc.c  |   74 +++++++++++++++++++++-------------------
 6 files changed, 60 insertions(+), 46 deletions(-)

diff --git a/drivers/acpi/acpica/acdisasm.h b/drivers/acpi/acpica/acdisasm.h
index 4294f58..5dcedba 100644
--- a/drivers/acpi/acpica/acdisasm.h
+++ b/drivers/acpi/acpica/acdisasm.h
@@ -490,9 +490,13 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
 u8 acpi_dm_is_pld_buffer(union acpi_parse_object *op);
 
 /*
- * dmextern
+ * dmdeferred
  */
+acpi_status acpi_dm_parse_deferred_ops(union acpi_parse_object *root);
 
+/*
+ * dmextern
+ */
 acpi_status acpi_dm_add_to_external_file_list(char *path_list);
 
 void acpi_dm_clear_external_file_list(void);
@@ -525,7 +529,9 @@ acpi_dm_resource_template(struct acpi_op_walk_info *info,
 			  union acpi_parse_object *op,
 			  u8 *byte_data, u32 byte_count);
 
-acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
+acpi_status
+acpi_dm_is_resource_template(struct acpi_walk_state *walk_state,
+			     union acpi_parse_object *op);
 
 void acpi_dm_bit_list(u16 mask);
 
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index b0f5f92..6e51d193 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -535,12 +535,15 @@ acpi_ut_display_init_pathname(u8 type,
  * utresrc
  */
 acpi_status
-acpi_ut_walk_aml_resources(u8 *aml,
+acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
+			   u8 *aml,
 			   acpi_size aml_length,
 			   acpi_walk_aml_callback user_function,
 			   void **context);
 
-acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index);
+acpi_status
+acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
+			  void *aml, u8 *return_index);
 
 u32 acpi_ut_get_descriptor_length(void *aml);
 
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index 4f39bd6..da178b4 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -407,7 +407,9 @@ acpi_rs_get_list_length(u8 * aml_buffer,
 
 		/* Validate the Resource Type and Resource Length */
 
-		status = acpi_ut_validate_resource(aml_buffer, &resource_index);
+		status =
+		    acpi_ut_validate_resource(NULL, aml_buffer,
+					      &resource_index);
 		if (ACPI_FAILURE(status)) {
 			/*
 			 * Exit on failure. Cannot continue because the descriptor length
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index 8133326..55e0908 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -98,7 +98,7 @@ acpi_buffer_to_resource(u8 *aml_buffer,
 
 	/* Perform the AML-to-Resource conversion */
 
-	status = acpi_ut_walk_aml_resources(aml_buffer, aml_buffer_length,
+	status = acpi_ut_walk_aml_resources(NULL, aml_buffer, aml_buffer_length,
 					    acpi_rs_convert_aml_to_resources,
 					    &current_resource_ptr);
 	if (status == AE_AML_NO_RESOURCE_END_TAG) {
@@ -174,7 +174,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
 	/* Do the conversion */
 
 	resource = output_buffer->pointer;
-	status = acpi_ut_walk_aml_resources(aml_start, aml_buffer_length,
+	status = acpi_ut_walk_aml_resources(NULL, aml_start, aml_buffer_length,
 					    acpi_rs_convert_aml_to_resources,
 					    &resource);
 	if (ACPI_FAILURE(status)) {
diff --git a/drivers/acpi/acpica/rslist.c b/drivers/acpi/acpica/rslist.c
index 8b64db9..83e6158 100644
--- a/drivers/acpi/acpica/rslist.c
+++ b/drivers/acpi/acpica/rslist.c
@@ -217,9 +217,10 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
 
 		/* Perform final sanity check on the new AML resource descriptor */
 
-		status =
-		    acpi_ut_validate_resource(ACPI_CAST_PTR
-					      (union aml_resource, aml), NULL);
+		status = acpi_ut_validate_resource(NULL,
+						   ACPI_CAST_PTR(union
+								 aml_resource,
+								 aml), NULL);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index 7d0a1b5..546ea73 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -383,26 +383,16 @@ static const u8 acpi_gbl_resource_types[] = {
 	ACPI_VARIABLE_LENGTH	/* 0E *serial_bus */
 };
 
-/*
- * For the iASL compiler/disassembler, we don't want any error messages
- * because the disassembler uses the resource validation code to determine
- * if Buffer objects are actually Resource Templates.
- */
-#ifdef ACPI_ASL_COMPILER
-#define ACPI_RESOURCE_ERROR(plist)
-#else
-#define ACPI_RESOURCE_ERROR(plist)  ACPI_ERROR(plist)
-#endif
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_walk_aml_resources
  *
- * PARAMETERS:  aml             - Pointer to the raw AML resource template
- *              aml_length      - Length of the entire template
- *              user_function   - Called once for each descriptor found. If
- *                                NULL, a pointer to the end_tag is returned
- *              context         - Passed to user_function
+ * PARAMETERS:  walk_state          - Current walk info
+ * PARAMETERS:  aml                 - Pointer to the raw AML resource template
+ *              aml_length          - Length of the entire template
+ *              user_function       - Called once for each descriptor found. If
+ *                                    NULL, a pointer to the end_tag is returned
+ *              context             - Passed to user_function
  *
  * RETURN:      Status
  *
@@ -412,7 +402,8 @@ static const u8 acpi_gbl_resource_types[] = {
  ******************************************************************************/
 
 acpi_status
-acpi_ut_walk_aml_resources(u8 *aml,
+acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
+			   u8 *aml,
 			   acpi_size aml_length,
 			   acpi_walk_aml_callback user_function, void **context)
 {
@@ -441,7 +432,8 @@ acpi_ut_walk_aml_resources(u8 *aml,
 
 		/* Validate the Resource Type and Resource Length */
 
-		status = acpi_ut_validate_resource(aml, &resource_index);
+		status =
+		    acpi_ut_validate_resource(walk_state, aml, &resource_index);
 		if (ACPI_FAILURE(status)) {
 			/*
 			 * Exit on failure. Cannot continue because the descriptor length
@@ -498,7 +490,8 @@ acpi_ut_walk_aml_resources(u8 *aml,
 
 		/* Insert an end_tag anyway. acpi_rs_get_list_length always leaves room */
 
-		(void)acpi_ut_validate_resource(end_tag, &resource_index);
+		(void)acpi_ut_validate_resource(walk_state, end_tag,
+						&resource_index);
 		status =
 		    user_function(end_tag, 2, offset, resource_index, context);
 		if (ACPI_FAILURE(status)) {
@@ -513,9 +506,10 @@ acpi_ut_walk_aml_resources(u8 *aml,
  *
  * FUNCTION:    acpi_ut_validate_resource
  *
- * PARAMETERS:  aml             - Pointer to the raw AML resource descriptor
- *              return_index    - Where the resource index is returned. NULL
- *                                if the index is not required.
+ * PARAMETERS:  walk_state          - Current walk info
+ *              aml                 - Pointer to the raw AML resource descriptor
+ *              return_index        - Where the resource index is returned. NULL
+ *                                    if the index is not required.
  *
  * RETURN:      Status, and optionally the Index into the global resource tables
  *
@@ -525,7 +519,9 @@ acpi_ut_walk_aml_resources(u8 *aml,
  *
  ******************************************************************************/
 
-acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index)
+acpi_status
+acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
+			  void *aml, u8 *return_index)
 {
 	union aml_resource *aml_resource;
 	u8 resource_type;
@@ -627,10 +623,12 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index)
 		if ((aml_resource->common_serial_bus.type == 0) ||
 		    (aml_resource->common_serial_bus.type >
 		     AML_RESOURCE_MAX_SERIALBUSTYPE)) {
-			ACPI_RESOURCE_ERROR((AE_INFO,
-					     "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
-					     aml_resource->common_serial_bus.
-					     type));
+			if (walk_state) {
+				ACPI_ERROR((AE_INFO,
+					    "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
+					    aml_resource->common_serial_bus.
+					    type));
+			}
 			return (AE_AML_INVALID_RESOURCE_TYPE);
 		}
 	}
@@ -645,18 +643,22 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index)
 
       invalid_resource:
 
-	ACPI_RESOURCE_ERROR((AE_INFO,
-			     "Invalid/unsupported resource descriptor: Type 0x%2.2X",
-			     resource_type));
+	if (walk_state) {
+		ACPI_ERROR((AE_INFO,
+			    "Invalid/unsupported resource descriptor: Type 0x%2.2X",
+			    resource_type));
+	}
 	return (AE_AML_INVALID_RESOURCE_TYPE);
 
       bad_resource_length:
 
-	ACPI_RESOURCE_ERROR((AE_INFO,
-			     "Invalid resource descriptor length: Type "
-			     "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
-			     resource_type, resource_length,
-			     minimum_resource_length));
+	if (walk_state) {
+		ACPI_ERROR((AE_INFO,
+			    "Invalid resource descriptor length: Type "
+			    "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
+			    resource_type, resource_length,
+			    minimum_resource_length));
+	}
 	return (AE_AML_BAD_RESOURCE_LENGTH);
 }
 
@@ -815,7 +817,7 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, u8 **end_tag)
 
 	/* Validate the template and get a pointer to the end_tag */
 
-	status = acpi_ut_walk_aml_resources(obj_desc->buffer.pointer,
+	status = acpi_ut_walk_aml_resources(NULL, obj_desc->buffer.pointer,
 					    obj_desc->buffer.length, NULL,
 					    (void **)end_tag);
 
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 10/15] ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (8 preceding siblings ...)
  2012-11-21 10:08 ` [PATCH 09/15] ACPICA: Debugger: Major update for the Disassemble<method> command Lv Zheng
@ 2012-11-21 10:08 ` Lv Zheng
  2012-11-21 10:08 ` [PATCH 11/15] ACPICA: Add macros to extract flag bits from resource descriptors Lv Zheng
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:08 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

This changes adds the ShareAndWake and ExclusiveAndWake flags which
were added to the Irq, Interrupt, and Gpio resource descriptors
in ACPI 5.0.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/rsdump.c  |    6 +++---
 drivers/acpi/acpica/utresrc.c |    4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index 276e52f..0b7381f 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -98,7 +98,7 @@ struct acpi_rsdump_info acpi_rs_dump_irq[7] = {
 	 acpi_gbl_he_decode},
 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity",
 	 acpi_gbl_ll_decode},
-	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing",
+	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing",
 	 acpi_gbl_shr_decode},
 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count),
 	 "Interrupt Count", NULL},
@@ -287,7 +287,7 @@ struct acpi_rsdump_info acpi_rs_dump_ext_irq[8] = {
 	 "Triggering", acpi_gbl_he_decode},
 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity",
 	 acpi_gbl_ll_decode},
-	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.sharable), "Sharing",
+	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(extended_irq.sharable), "Sharing",
 	 acpi_gbl_shr_decode},
 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL,
 	 NULL},
@@ -320,7 +320,7 @@ struct acpi_rsdump_info acpi_rs_dump_gpio[16] = {
 	 "ProducerConsumer", acpi_gbl_consume_decode},
 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig",
 	 acpi_gbl_ppc_decode},
-	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharable",
+	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharing",
 	 acpi_gbl_shr_decode},
 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction),
 	 "IoRestriction", acpi_gbl_ior_decode},
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index 546ea73..8f8eab9 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -127,7 +127,9 @@ const char *acpi_gbl_rw_decode[] = {
 
 const char *acpi_gbl_shr_decode[] = {
 	"Exclusive",
-	"Shared"
+	"Shared",
+	"ExclusiveAndWake",	/* ACPI 5.0 */
+	"SharedAndWake"		/* ACPI 5.0 */
 };
 
 const char *acpi_gbl_siz_decode[] = {
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 11/15] ACPICA: Add macros to extract flag bits from resource descriptors.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (9 preceding siblings ...)
  2012-11-21 10:08 ` [PATCH 10/15] ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags Lv Zheng
@ 2012-11-21 10:08 ` Lv Zheng
  2012-11-21 10:08 ` [PATCH 12/15] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros Lv Zheng
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:08 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

Improves readability and maintainability of the code.  Fixes a
problem with the UART serial bus descriptor for the number of
data bits flags (was incorrectly 2 bits, should be 3).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acmacros.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 5efad99..1fa91f1 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -293,6 +293,20 @@
 #define ACPI_16BIT_MASK     0x0000FFFF
 #define ACPI_24BIT_MASK     0x00FFFFFF
 
+/* Macros to extract flag bits from position zero */
+
+#define ACPI_GET_1BIT_FLAG(value)                   ((value) & ACPI_1BIT_MASK)
+#define ACPI_GET_2BIT_FLAG(value)                   ((value) & ACPI_2BIT_MASK)
+#define ACPI_GET_3BIT_FLAG(value)                   ((value) & ACPI_3BIT_MASK)
+#define ACPI_GET_4BIT_FLAG(value)                   ((value) & ACPI_4BIT_MASK)
+
+/* Macros to extract flag bits from position one and above */
+
+#define ACPI_EXTRACT_1BIT_FLAG(field, position)     (ACPI_GET_1BIT_FLAG ((field) >> position))
+#define ACPI_EXTRACT_2BIT_FLAG(field, position)     (ACPI_GET_2BIT_FLAG ((field) >> position))
+#define ACPI_EXTRACT_3BIT_FLAG(field, position)     (ACPI_GET_3BIT_FLAG ((field) >> position))
+#define ACPI_EXTRACT_4BIT_FLAG(field, position)     (ACPI_GET_4BIT_FLAG ((field) >> position))
+
 /*
  * An object of type struct acpi_namespace_node can appear in some contexts
  * where a pointer to an object of type union acpi_operand_object can also
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 12/15] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (10 preceding siblings ...)
  2012-11-21 10:08 ` [PATCH 11/15] ACPICA: Add macros to extract flag bits from resource descriptors Lv Zheng
@ 2012-11-21 10:08 ` Lv Zheng
  2012-11-27  4:04   ` Brown, Len
  2012-11-21 10:08 ` [PATCH 13/15] ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE Lv Zheng
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:08 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng, Bob Moore

Improve the implementation of the macros.  Change the SETx macros
to the style of (destination, source).  Also add ACPI_CASTx
companion macros.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acmacros.h |   20 ++++++-----
 drivers/acpi/acpica/exregion.c |    8 ++---
 drivers/acpi/acpica/rsmisc.c   |   71 +++++++++++++++++++++-------------------
 3 files changed, 54 insertions(+), 45 deletions(-)

diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 1fa91f1..3ba11d2 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -49,14 +49,18 @@
  * get into potential aligment issues -- see the STORE macros below.
  * Use with care.
  */
-#define ACPI_GET8(ptr)                  *ACPI_CAST_PTR (u8, ptr)
-#define ACPI_GET16(ptr)                 *ACPI_CAST_PTR (u16, ptr)
-#define ACPI_GET32(ptr)                 *ACPI_CAST_PTR (u32, ptr)
-#define ACPI_GET64(ptr)                 *ACPI_CAST_PTR (u64, ptr)
-#define ACPI_SET8(ptr)                  *ACPI_CAST_PTR (u8, ptr)
-#define ACPI_SET16(ptr)                 *ACPI_CAST_PTR (u16, ptr)
-#define ACPI_SET32(ptr)                 *ACPI_CAST_PTR (u32, ptr)
-#define ACPI_SET64(ptr)                 *ACPI_CAST_PTR (u64, ptr)
+#define ACPI_CAST8(ptr)                 ACPI_CAST_PTR (u8, (ptr))
+#define ACPI_CAST16(ptr)                ACPI_CAST_PTR (u16, (ptr))
+#define ACPI_CAST32(ptr)                ACPI_CAST_PTR (u32, (ptr))
+#define ACPI_CAST64(ptr)                ACPI_CAST_PTR (u64, (ptr))
+#define ACPI_GET8(ptr)                  (*ACPI_CAST8 (ptr))
+#define ACPI_GET16(ptr)                 (*ACPI_CAST16 (ptr))
+#define ACPI_GET32(ptr)                 (*ACPI_CAST32 (ptr))
+#define ACPI_GET64(ptr)                 (*ACPI_CAST64 (ptr))
+#define ACPI_SET8(ptr, val)             (*ACPI_CAST8 (ptr) = (u8) (val))
+#define ACPI_SET16(ptr, val)            (*ACPI_CAST16 (ptr) = (u16) (val))
+#define ACPI_SET32(ptr, val)            (*ACPI_CAST32 (ptr) = (u32) (val))
+#define ACPI_SET64(ptr, val)            (*ACPI_CAST64 (ptr) = (u64) (val))
 
 /*
  * printf() format helpers
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 06a4924..28d3cd9 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -239,19 +239,19 @@ acpi_ex_system_memory_space_handler(u32 function,
 
 		switch (bit_width) {
 		case 8:
-			ACPI_SET8(logical_addr_ptr) = (u8)*value;
+			ACPI_SET8(logical_addr_ptr, *value);
 			break;
 
 		case 16:
-			ACPI_SET16(logical_addr_ptr) = (u16)*value;
+			ACPI_SET16(logical_addr_ptr, *value);
 			break;
 
 		case 32:
-			ACPI_SET32(logical_addr_ptr) = (u32)*value;
+			ACPI_SET32(logical_addr_ptr, *value);
 			break;
 
 		case 64:
-			ACPI_SET64(logical_addr_ptr) = (u64)*value;
+			ACPI_SET64(logical_addr_ptr, *value);
 			break;
 
 		default:
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index 3d0e15c..7b094eb 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -136,30 +136,30 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			/*
 			 * Mask and shift the flag bit
 			 */
-			ACPI_SET8(destination) = (u8)
-			    ((ACPI_GET8(source) >> info->value) & 0x01);
+			ACPI_SET8(destination,
+				  ((ACPI_GET8(source) >> info->value) & 0x01));
 			break;
 
 		case ACPI_RSC_2BITFLAG:
 			/*
 			 * Mask and shift the flag bits
 			 */
-			ACPI_SET8(destination) = (u8)
-			    ((ACPI_GET8(source) >> info->value) & 0x03);
+			ACPI_SET8(destination,
+				  ((ACPI_GET8(source) >> info->value) & 0x03));
 			break;
 
 		case ACPI_RSC_3BITFLAG:
 			/*
 			 * Mask and shift the flag bits
 			 */
-			ACPI_SET8(destination) = (u8)
-			    ((ACPI_GET8(source) >> info->value) & 0x07);
+			ACPI_SET8(destination,
+				  ((ACPI_GET8(source) >> info->value) & 0x07));
 			break;
 
 		case ACPI_RSC_COUNT:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8)item_count;
+			ACPI_SET8(destination, item_count);
 
 			resource->length = resource->length +
 			    (info->value * (item_count - 1));
@@ -168,7 +168,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT16:
 
 			item_count = aml_resource_length;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 
 			resource->length = resource->length +
 			    (info->value * (item_count - 1));
@@ -181,13 +181,13 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 
 			resource->length = resource->length + item_count;
 			item_count = item_count / 2;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 			break;
 
 		case ACPI_RSC_COUNT_GPIO_VEN:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8)item_count;
+			ACPI_SET8(destination, item_count);
 
 			resource->length = resource->length +
 			    (info->value * item_count);
@@ -216,7 +216,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			resource->length = resource->length + item_count;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 			break;
 
 		case ACPI_RSC_COUNT_SERIAL_VEN:
@@ -224,7 +224,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			item_count = ACPI_GET16(source) - info->value;
 
 			resource->length = resource->length + item_count;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 			break;
 
 		case ACPI_RSC_COUNT_SERIAL_RES:
@@ -234,7 +234,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			    - ACPI_GET16(source) - info->value;
 
 			resource->length = resource->length + item_count;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 			break;
 
 		case ACPI_RSC_LENGTH:
@@ -385,7 +385,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			target = ACPI_ADD_PTR(char, resource, info->value);
-			ACPI_SET8(target) = (u8)item_count;
+			ACPI_SET8(target, item_count);
 			break;
 
 		case ACPI_RSC_BITMASK16:
@@ -401,7 +401,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			target = ACPI_ADD_PTR(char, resource, info->value);
-			ACPI_SET8(target) = (u8)item_count;
+			ACPI_SET8(target, item_count);
 			break;
 
 		case ACPI_RSC_EXIT_NE:
@@ -514,37 +514,40 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/*
 			 * Clear the flag byte
 			 */
-			ACPI_SET8(destination) = 0;
+			ACPI_SET8(destination, 0);
 			break;
 
 		case ACPI_RSC_1BITFLAG:
 			/*
 			 * Mask and shift the flag bit
 			 */
-			ACPI_SET8(destination) |= (u8)
-			    ((ACPI_GET8(source) & 0x01) << info->value);
+			ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
+				     ((ACPI_GET8(source) & 0x01) << info->
+				      value));
 			break;
 
 		case ACPI_RSC_2BITFLAG:
 			/*
 			 * Mask and shift the flag bits
 			 */
-			ACPI_SET8(destination) |= (u8)
-			    ((ACPI_GET8(source) & 0x03) << info->value);
+			ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
+				     ((ACPI_GET8(source) & 0x03) << info->
+				      value));
 			break;
 
 		case ACPI_RSC_3BITFLAG:
 			/*
 			 * Mask and shift the flag bits
 			 */
-			ACPI_SET8(destination) |= (u8)
-			    ((ACPI_GET8(source) & 0x07) << info->value);
+			ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
+				     ((ACPI_GET8(source) & 0x07) << info->
+				      value));
 			break;
 
 		case ACPI_RSC_COUNT:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8)item_count;
+			ACPI_SET8(destination, item_count);
 
 			aml_length =
 			    (u16) (aml_length +
@@ -561,18 +564,18 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT_GPIO_PIN:
 
 			item_count = ACPI_GET16(source);
-			ACPI_SET16(destination) = (u16)aml_length;
+			ACPI_SET16(destination, aml_length);
 
 			aml_length = (u16)(aml_length + item_count * 2);
 			target = ACPI_ADD_PTR(void, aml, info->value);
-			ACPI_SET16(target) = (u16)aml_length;
+			ACPI_SET16(target, aml_length);
 			acpi_rs_set_resource_length(aml_length, aml);
 			break;
 
 		case ACPI_RSC_COUNT_GPIO_VEN:
 
 			item_count = ACPI_GET16(source);
-			ACPI_SET16(destination) = (u16)item_count;
+			ACPI_SET16(destination, item_count);
 
 			aml_length =
 			    (u16)(aml_length + (info->value * item_count));
@@ -584,7 +587,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/* Set resource source string length */
 
 			item_count = ACPI_GET16(source);
-			ACPI_SET16(destination) = (u16)aml_length;
+			ACPI_SET16(destination, aml_length);
 
 			/* Compute offset for the Vendor Data */
 
@@ -594,7 +597,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/* Set vendor offset only if there is vendor data */
 
 			if (resource->data.gpio.vendor_length) {
-				ACPI_SET16(target) = (u16)aml_length;
+				ACPI_SET16(target, aml_length);
 			}
 
 			acpi_rs_set_resource_length(aml_length, aml);
@@ -603,7 +606,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT_SERIAL_VEN:
 
 			item_count = ACPI_GET16(source);
-			ACPI_SET16(destination) = item_count + info->value;
+			ACPI_SET16(destination, item_count + info->value);
 			aml_length = (u16)(aml_length + item_count);
 			acpi_rs_set_resource_length(aml_length, aml);
 			break;
@@ -707,10 +710,12 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/*
 			 * 8-bit encoded bitmask (DMA macro)
 			 */
-			ACPI_SET8(destination) = (u8)
-			    acpi_rs_encode_bitmask(source,
-						   *ACPI_ADD_PTR(u8, resource,
-								 info->value));
+			ACPI_SET8(destination,
+				  acpi_rs_encode_bitmask(source,
+							 *ACPI_ADD_PTR(u8,
+								       resource,
+								       info->
+								       value)));
 			break;
 
 		case ACPI_RSC_BITMASK16:
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 13/15] ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (11 preceding siblings ...)
  2012-11-21 10:08 ` [PATCH 12/15] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros Lv Zheng
@ 2012-11-21 10:08 ` Lv Zheng
  2012-11-21 10:08 ` [PATCH 14/15] ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure Lv Zheng
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:08 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng, Bob Moore

Cleanup the ACPI_NEXT_RESOURCE macro.  Update AcpiWalkResources
to use ACPI_NEXT_RESOURCE.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/rsxface.c |    4 +---
 include/acpi/acrestyp.h       |    5 ++++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c
index 5aad744..3a5ace7 100644
--- a/drivers/acpi/acpica/rsxface.c
+++ b/drivers/acpi/acpica/rsxface.c
@@ -606,9 +606,7 @@ acpi_walk_resources(acpi_handle device_handle,
 
 		/* Get the next resource descriptor */
 
-		resource =
-		    ACPI_ADD_PTR(struct acpi_resource, resource,
-				 resource->length);
+		resource = ACPI_NEXT_RESOURCE(resource);
 	}
 
 	ACPI_FREE(buffer.pointer);
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index 40349ae..17f2d05 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -591,7 +591,10 @@ struct acpi_resource {
 #define ACPI_RS_SIZE_MIN                    (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
 #define ACPI_RS_SIZE(type)                  (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
 
-#define ACPI_NEXT_RESOURCE(res)             (struct acpi_resource *)((u8 *) res + res->length)
+/* Macro for walking resource templates with multiple descriptors */
+
+#define ACPI_NEXT_RESOURCE(res) \
+	ACPI_ADD_PTR (struct acpi_resource, (res), (res)->length)
 
 struct acpi_pci_routing_table {
 	u32 length;
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 14/15] ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (12 preceding siblings ...)
  2012-11-21 10:08 ` [PATCH 13/15] ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE Lv Zheng
@ 2012-11-21 10:08 ` Lv Zheng
  2012-11-21 10:08 ` [PATCH 15/15] ACPICA: Update version to 20121114 Lv Zheng
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:08 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

No need for a goto to the bottom of the function, simply return
the status code immediately.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/nsxfname.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 520bab4..a8deae8 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -290,7 +290,7 @@ acpi_get_object_info(acpi_handle handle,
 
 	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
 	if (ACPI_FAILURE(status)) {
-		goto cleanup;
+		return (status);
 	}
 
 	node = acpi_ns_validate_handle(handle);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH 15/15] ACPICA: Update version to 20121114.
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (13 preceding siblings ...)
  2012-11-21 10:08 ` [PATCH 14/15] ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure Lv Zheng
@ 2012-11-21 10:08 ` Lv Zheng
  2012-11-22  0:15 ` [PATCH 00/15] ACPICA 20121114 Release Rafael J. Wysocki
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
  16 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-11-21 10:08 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

Version 20121114.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 include/acpi/acpixf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index e0c7303..be3793f 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20121018
+#define ACPI_CA_VERSION                 0x20121114
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* Re: [PATCH 00/15] ACPICA 20121114 Release
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (14 preceding siblings ...)
  2012-11-21 10:08 ` [PATCH 15/15] ACPICA: Update version to 20121114 Lv Zheng
@ 2012-11-22  0:15 ` Rafael J. Wysocki
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
  16 siblings, 0 replies; 53+ messages in thread
From: Rafael J. Wysocki @ 2012-11-22  0:15 UTC (permalink / raw)
  To: Lv Zheng; +Cc: Len Brown, Rafael J Wysocki, linux-acpi

On Wednesday, November 21, 2012 06:06:45 PM Lv Zheng wrote:
> The 20121114 ACPICA linuxized patches are based on the pm/linux-next branch.
> Please review though the patches have passed the basic build & boot tests.
> 
> Bob Moore (6):
>   ACPICA: Performance: Remove function tracing from critical allocation
>     functions.
>   ACPICA: Debugger: Major update for the Disassemble<method> command.
>   ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags.
>   ACPICA: Add macros to extract flag bits from resource descriptors.
>   ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure.
>   ACPICA: Update version to 20121114.
> 
> Chao Guan (1):
>   ACPICA: Performance enhancement for ACPI package objects.
> 
> Jesper Juhl (1):
>   ACPICA: Fix possible memory leak.
> 
> Lv Zheng (7):
>   ACPICA: Fixes unmerged (dis)assember divergences.
>   ACPICA: Fixes comments caused divergences.
>   ACPICA: Fixes indent caused divergences.
>   ACPICA: Fixes code maintenance divergences.
>   ACPICA: Fixes call depth check caused divergences.
>   ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros.
>   ACPICA: Resource Manager: update template walking with
>     ACPI_NEXT_RESOURCE.

Whole series applied to linux-pm.git/linux-next as v3.8 material.

Thanks Lv!

Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences.
  2012-11-21 10:06 ` [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences Lv Zheng
@ 2012-11-27  2:58   ` Brown, Len
  2012-11-27  5:41     ` Zheng, Lv
  2012-12-10  8:23     ` Zheng, Lv
  0 siblings, 2 replies; 53+ messages in thread
From: Brown, Len @ 2012-11-27  2:58 UTC (permalink / raw)
  To: Zheng, Lv, Wysocki, Rafael J; +Cc: linux-acpi

>  drivers/acpi/acpica/acdisasm.h |  641 ++++++++++++++++++++++++++++++++++++++++

please do not include this file in the linux kenrel.

thanks,
-Len

^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 02/15] ACPICA: Fixes comments caused divergences.
  2012-11-21 10:07 ` [PATCH 02/15] ACPICA: Fixes comments caused divergences Lv Zheng
@ 2012-11-27  3:32   ` Brown, Len
  2012-11-27  5:35     ` Zheng, Lv
  0 siblings, 1 reply; 53+ messages in thread
From: Brown, Len @ 2012-11-27  3:32 UTC (permalink / raw)
  To: Zheng, Lv, Wysocki, Rafael J; +Cc: linux-acpi

> diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index c743ca4..89fcc3e
> 100644
> --- a/include/acpi/platform/acenv.h
> +++ b/include/acpi/platform/acenv.h
> @@ -1,6 +1,6 @@
>  /******************************************************************************
>   *
> - * Name: acenv.h - Generation environment specific items
> + * Name: acenv.h - Host and compiler configuration
>   *
>   *****************************************************************************/
> 
> @@ -44,6 +44,12 @@
>  #ifndef __ACENV_H__
>  #define __ACENV_H__
> 
> +/*
> + * Environment configuration. The purpose of this file is to interface
> +ACPICA
> + * to the local environment. This includes compiler-specific,
> +OS-specific,
> + * and machine-specific configuration.
> + */
> +

Looks like the syntax got messed up here and line-wrapped before creating the patch.

-L

^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 04/15] ACPICA: Fixes code maintenance divergences.
  2012-11-21 10:07 ` [PATCH 04/15] ACPICA: Fixes code maintenance divergences Lv Zheng
@ 2012-11-27  3:46   ` Brown, Len
  2012-11-27  5:33     ` Zheng, Lv
  0 siblings, 1 reply; 53+ messages in thread
From: Brown, Len @ 2012-11-27  3:46 UTC (permalink / raw)
  To: Zheng, Lv, Wysocki, Rafael J; +Cc: linux-acpi

> This patch will not affect the generated vmlinux binary.

If this is the goal, then please VERIFY that the goal was met
by building both ways and comparing the kernel.

due to the hunk below, we know that this patch DOES change
the kernel, and not in a correct way:

> diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 285e24b..b4469a6
> 100644
> --- a/drivers/acpi/acpica/tbutils.c
> +++ b/drivers/acpi/acpica/tbutils.c
> @@ -384,10 +384,6 @@ void acpi_tb_check_dsdt_header(void)
>  		acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
>  		acpi_tb_print_table_header(0, acpi_gbl_DSDT);
> 
> -		ACPI_ERROR((AE_INFO,
> -			    "Please send DMI info to linux-acpi@vger.kernel.org\n"
> -			    "If system does not work as expected, please boot with acpi=copy_dsdt"));
> -
>  		/* Disable further error messages */

Please retain this difference between Linux and ACPICA --
it is there for a reason.

thanks,
-Len




^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 05/15] ACPICA: Fixes call depth check caused divergences.
  2012-11-21 10:07 ` [PATCH 05/15] ACPICA: Fixes call depth check caused divergences Lv Zheng
@ 2012-11-27  3:52   ` Brown, Len
  2012-11-27  5:30     ` Zheng, Lv
  0 siblings, 1 reply; 53+ messages in thread
From: Brown, Len @ 2012-11-27  3:52 UTC (permalink / raw)
  To: Zheng, Lv, Wysocki, Rafael J; +Cc: linux-acpi

> The ACPICA uses a call depth check mechnism by wrapping the return statements.
> This patch fixes divergences caused by this mechanism.

There is 1 line that does this, and that is fine.

The rest of the patch adds ()'s to return statements.
I'm fine with ACPICA's divergence from official Linux style on that one,
but it should really do that in a separate patch (next time).

thanks,
-Len


^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 09/15] ACPICA: Debugger: Major update for the Disassemble<method> command.
  2012-11-21 10:08 ` [PATCH 09/15] ACPICA: Debugger: Major update for the Disassemble<method> command Lv Zheng
@ 2012-11-27  3:58   ` Brown, Len
  0 siblings, 0 replies; 53+ messages in thread
From: Brown, Len @ 2012-11-27  3:58 UTC (permalink / raw)
  To: Zheng, Lv; +Cc: linux-acpi



> -----Original Message-----
> From: Zheng, Lv
> Sent: Wednesday, November 21, 2012 5:08 AM
> To: Brown, Len; Wysocki, Rafael J
> Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zheng, Lv
> Subject: [PATCH 09/15] ACPICA: Debugger: Major update for the Disassemble<method> command.
> 
> From: Bob Moore <robert.moore@intel.com>
> 
> This command was downreved and did not properly disassemble control methods with any reasonable
> complexity. This fix brings the command up to the same level as the rest of the disassembler.  Adds
> one new file, dmdeferred.c, which is existing code that is now common with the main disassembler and
> the debugger disassembl command.
> 
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> ---
>  drivers/acpi/acpica/acdisasm.h |   10 ++++--
>  drivers/acpi/acpica/acutils.h  |    7 ++--
>  drivers/acpi/acpica/rscalc.c   |    4 ++-
>  drivers/acpi/acpica/rscreate.c |    4 +--
>  drivers/acpi/acpica/rslist.c   |    7 ++--
>  drivers/acpi/acpica/utresrc.c  |   74 +++++++++++++++++++++-------------------
>  6 files changed, 60 insertions(+), 46 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/acdisasm.h b/drivers/acpi/acpica/acdisasm.h index 4294f58..5dcedba
> 100644
> --- a/drivers/acpi/acpica/acdisasm.h
> +++ b/drivers/acpi/acpica/acdisasm.h
> @@ -490,9 +490,13 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
>  u8 acpi_dm_is_pld_buffer(union acpi_parse_object *op);
> 
>  /*
> - * dmextern
> + * dmdeferred
>   */
> +acpi_status acpi_dm_parse_deferred_ops(union acpi_parse_object *root);
> 
> +/*
> + * dmextern
> + */
>  acpi_status acpi_dm_add_to_external_file_list(char *path_list);
> 
>  void acpi_dm_clear_external_file_list(void);
> @@ -525,7 +529,9 @@ acpi_dm_resource_template(struct acpi_op_walk_info *info,
>  			  union acpi_parse_object *op,
>  			  u8 *byte_data, u32 byte_count);
> 
> -acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
> +acpi_status
> +acpi_dm_is_resource_template(struct acpi_walk_state *walk_state,
> +			     union acpi_parse_object *op);
> 
>  void acpi_dm_bit_list(u16 mask);
> 
> diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index b0f5f92..6e51d193
> 100644
> --- a/drivers/acpi/acpica/acutils.h
> +++ b/drivers/acpi/acpica/acutils.h
> @@ -535,12 +535,15 @@ acpi_ut_display_init_pathname(u8 type,
>   * utresrc
>   */
>  acpi_status
> -acpi_ut_walk_aml_resources(u8 *aml,
> +acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
> +			   u8 *aml,
>  			   acpi_size aml_length,
>  			   acpi_walk_aml_callback user_function,
>  			   void **context);
> 
> -acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index);
> +acpi_status
> +acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
> +			  void *aml, u8 *return_index);
> 
>  u32 acpi_ut_get_descriptor_length(void *aml);
> 
> diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c index 4f39bd6..da178b4 100644
> --- a/drivers/acpi/acpica/rscalc.c
> +++ b/drivers/acpi/acpica/rscalc.c
> @@ -407,7 +407,9 @@ acpi_rs_get_list_length(u8 * aml_buffer,
> 
>  		/* Validate the Resource Type and Resource Length */
> 
> -		status = acpi_ut_validate_resource(aml_buffer, &resource_index);
> +		status =
> +		    acpi_ut_validate_resource(NULL, aml_buffer,
> +					      &resource_index);
>  		if (ACPI_FAILURE(status)) {
>  			/*
>  			 * Exit on failure. Cannot continue because the descriptor length diff --git
> a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 8133326..55e0908 100644
> --- a/drivers/acpi/acpica/rscreate.c
> +++ b/drivers/acpi/acpica/rscreate.c
> @@ -98,7 +98,7 @@ acpi_buffer_to_resource(u8 *aml_buffer,
> 
>  	/* Perform the AML-to-Resource conversion */
> 
> -	status = acpi_ut_walk_aml_resources(aml_buffer, aml_buffer_length,
> +	status = acpi_ut_walk_aml_resources(NULL, aml_buffer,
> +aml_buffer_length,
>  					    acpi_rs_convert_aml_to_resources,
>  					    &current_resource_ptr);
>  	if (status == AE_AML_NO_RESOURCE_END_TAG) { @@ -174,7 +174,7 @@
> acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
>  	/* Do the conversion */
> 
>  	resource = output_buffer->pointer;
> -	status = acpi_ut_walk_aml_resources(aml_start, aml_buffer_length,
> +	status = acpi_ut_walk_aml_resources(NULL, aml_start,
> +aml_buffer_length,

This syntax change makes things worse instead of better.
Please find out how it happened and prevent it from happening again.

thanks,
-Len


^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 12/15] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros.
  2012-11-21 10:08 ` [PATCH 12/15] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros Lv Zheng
@ 2012-11-27  4:04   ` Brown, Len
  2012-11-27  5:37     ` Zheng, Lv
  0 siblings, 1 reply; 53+ messages in thread
From: Brown, Len @ 2012-11-27  4:04 UTC (permalink / raw)
  To: Zheng, Lv, Wysocki, Rafael J; +Cc: linux-acpi, Moore, Robert

Thank you for verifying that this syntax change did not have any effect
on the resulting binary!  That would be a great thing to note in patch
check-in comments in the future:-)

thanks,
-Len

^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 05/15] ACPICA: Fixes call depth check caused divergences.
  2012-11-27  3:52   ` Brown, Len
@ 2012-11-27  5:30     ` Zheng, Lv
  0 siblings, 0 replies; 53+ messages in thread
From: Zheng, Lv @ 2012-11-27  5:30 UTC (permalink / raw)
  To: Brown, Len, Wysocki, Rafael J; +Cc: linux-acpi

Yes, they can be split into 2 patches.
Thanks for the suggestions.

Best regards/Lv Zheng

> -----Original Message-----
> From: Brown, Len
> Sent: Tuesday, November 27, 2012 11:52 AM
> To: Zheng, Lv; Wysocki, Rafael J
> Cc: linux-acpi@vger.kernel.org
> Subject: RE: [PATCH 05/15] ACPICA: Fixes call depth check caused divergences.
> 
> > The ACPICA uses a call depth check mechnism by wrapping the return
> statements.
> > This patch fixes divergences caused by this mechanism.
> 
> There is 1 line that does this, and that is fine.
> 
> The rest of the patch adds ()'s to return statements.
> I'm fine with ACPICA's divergence from official Linux style on that one, but it
> should really do that in a separate patch (next time).
> 
> thanks,
> -Len


^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 04/15] ACPICA: Fixes code maintenance divergences.
  2012-11-27  3:46   ` Brown, Len
@ 2012-11-27  5:33     ` Zheng, Lv
  2012-11-27 11:46       ` Rafael J. Wysocki
  0 siblings, 1 reply; 53+ messages in thread
From: Zheng, Lv @ 2012-11-27  5:33 UTC (permalink / raw)
  To: Brown, Len, Wysocki, Rafael J; +Cc: linux-acpi

> > This patch will not affect the generated vmlinux binary.
> 
> If this is the goal, then please VERIFY that the goal was met by building both
> ways and comparing the kernel.

It's not the goal of this patch, it should be better stated as no function changes.

> due to the hunk below, we know that this patch DOES change the kernel, and
> not in a correct way:
> 
> > diff --git a/drivers/acpi/acpica/tbutils.c
> > b/drivers/acpi/acpica/tbutils.c index 285e24b..b4469a6
> > 100644
> > --- a/drivers/acpi/acpica/tbutils.c
> > +++ b/drivers/acpi/acpica/tbutils.c
> > @@ -384,10 +384,6 @@ void acpi_tb_check_dsdt_header(void)
> >  		acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
> >  		acpi_tb_print_table_header(0, acpi_gbl_DSDT);
> >
> > -		ACPI_ERROR((AE_INFO,
> > -			    "Please send DMI info to linux-acpi@vger.kernel.org\n"
> > -			    "If system does not work as expected, please boot with
> acpi=copy_dsdt"));
> > -
> >  		/* Disable further error messages */
> 
> Please retain this difference between Linux and ACPICA -- it is there for a
> reason.

Agreed.
I shouldn't make this vanished.
I will add this back to Linux during the next release if this is needed.

Best regards/Lv Zheng


> thanks,
> -Len
> 
> 


^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 02/15] ACPICA: Fixes comments caused divergences.
  2012-11-27  3:32   ` Brown, Len
@ 2012-11-27  5:35     ` Zheng, Lv
  0 siblings, 0 replies; 53+ messages in thread
From: Zheng, Lv @ 2012-11-27  5:35 UTC (permalink / raw)
  To: Brown, Len, Wysocki, Rafael J; +Cc: linux-acpi

> > +/*
> > + * Environment configuration. The purpose of this file is to
> > +interface ACPICA
> > + * to the local environment. This includes compiler-specific,
> > +OS-specific,
> > + * and machine-specific configuration.
> > + */
> > +
> 
> Looks like the syntax got messed up here and line-wrapped before creating the
> patch.

Yes, I need to track this issue by manually executing the process.

Thanks and best regards/Lv Zheng


^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 12/15] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros.
  2012-11-27  4:04   ` Brown, Len
@ 2012-11-27  5:37     ` Zheng, Lv
  0 siblings, 0 replies; 53+ messages in thread
From: Zheng, Lv @ 2012-11-27  5:37 UTC (permalink / raw)
  To: Brown, Len, Wysocki, Rafael J; +Cc: linux-acpi, Moore, Robert

Yes, I've performed compilation and then compared the decompiled ones for these macro changes.
Thanks for mention this.

Best regards/Lv Zheng
> -----Original Message-----
> From: Brown, Len
> Sent: Tuesday, November 27, 2012 12:05 PM
> To: Zheng, Lv; Wysocki, Rafael J
> Cc: linux-acpi@vger.kernel.org; Moore, Robert
> Subject: RE: [PATCH 12/15] ACPICA: Enhance the ACPI_GETx and ACPI_SETx
> macros.
> 
> Thank you for verifying that this syntax change did not have any effect on the
> resulting binary!  That would be a great thing to note in patch check-in
> comments in the future:-)
> 
> thanks,
> -Len

^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences.
  2012-11-27  2:58   ` Brown, Len
@ 2012-11-27  5:41     ` Zheng, Lv
  2012-12-10  8:23     ` Zheng, Lv
  1 sibling, 0 replies; 53+ messages in thread
From: Zheng, Lv @ 2012-11-27  5:41 UTC (permalink / raw)
  To: Brown, Len, Wysocki, Rafael J; +Cc: linux-acpi

I agreed.
It's assembler and disassembler specific changes.
Fixing them will make release engineering a easier process.
But adding this header file does not do much help on reducing the divergences.

Best regards/Lv Zheng

> -----Original Message-----
> From: Brown, Len
> Sent: Tuesday, November 27, 2012 10:59 AM
> To: Zheng, Lv; Wysocki, Rafael J
> Cc: linux-acpi@vger.kernel.org
> Subject: RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember
> divergences.
> 
> >  drivers/acpi/acpica/acdisasm.h |  641
> ++++++++++++++++++++++++++++++++++++++++
> 
> please do not include this file in the linux kenrel.
> 
> thanks,
> -Len

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 04/15] ACPICA: Fixes code maintenance divergences.
  2012-11-27  5:33     ` Zheng, Lv
@ 2012-11-27 11:46       ` Rafael J. Wysocki
  0 siblings, 0 replies; 53+ messages in thread
From: Rafael J. Wysocki @ 2012-11-27 11:46 UTC (permalink / raw)
  To: linux-acpi; +Cc: Zheng, Lv, Brown, Len, Wysocki, Rafael J

On Tuesday, November 27, 2012 05:33:55 AM Zheng, Lv wrote:
> > > This patch will not affect the generated vmlinux binary.
> > 
> > If this is the goal, then please VERIFY that the goal was met by building both
> > ways and comparing the kernel.
> 
> It's not the goal of this patch, it should be better stated as no function changes.
> 
> > due to the hunk below, we know that this patch DOES change the kernel, and
> > not in a correct way:
> > 
> > > diff --git a/drivers/acpi/acpica/tbutils.c
> > > b/drivers/acpi/acpica/tbutils.c index 285e24b..b4469a6
> > > 100644
> > > --- a/drivers/acpi/acpica/tbutils.c
> > > +++ b/drivers/acpi/acpica/tbutils.c
> > > @@ -384,10 +384,6 @@ void acpi_tb_check_dsdt_header(void)
> > >  		acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
> > >  		acpi_tb_print_table_header(0, acpi_gbl_DSDT);
> > >
> > > -		ACPI_ERROR((AE_INFO,
> > > -			    "Please send DMI info to linux-acpi@vger.kernel.org\n"
> > > -			    "If system does not work as expected, please boot with
> > acpi=copy_dsdt"));
> > > -
> > >  		/* Disable further error messages */
> > 
> > Please retain this difference between Linux and ACPICA -- it is there for a
> > reason.
> 
> Agreed.
> I shouldn't make this vanished.
> I will add this back to Linux during the next release if this is needed.

No, the next release would be too late.

Please do it now.  Please address all of the Len's comments in all of the
patches and resend the whole series.  And _please_ be more careful, I asked
you for that last time already.

I'll drop it from linux-next for now and will wait for the new submissoion.

Thanks,
Rafael


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences.
  2012-11-27  2:58   ` Brown, Len
  2012-11-27  5:41     ` Zheng, Lv
@ 2012-12-10  8:23     ` Zheng, Lv
  2012-12-10  8:54       ` Zheng, Lv
  1 sibling, 1 reply; 53+ messages in thread
From: Zheng, Lv @ 2012-12-10  8:23 UTC (permalink / raw)
  To: Brown, Len, Wysocki, Rafael J; +Cc: linux-acpi

Hi, Len and Rafael

Please also look at the [PATCH 09/15] ACPICA: Debugger: Major update for the Disassemble<method> command.

There is acdisasm.h updates in the patch 09.
If we can introduce acdisasm.h into linux but surround it with #ifdef/#endif to make it compiled out, then no manual fixes are needed for the [PATCH 09/15] thus less bugs in release process,
Or fixes are needed to be included as a special case in the acpica release scripts.

Please think about the benefit of adding this file.
I'm waiting for the decision on this.

Best regards
-Lv

> -----Original Message-----
> From: Brown, Len
> Sent: Tuesday, November 27, 2012 10:59 AM
> To: Zheng, Lv; Wysocki, Rafael J
> Cc: linux-acpi@vger.kernel.org
> Subject: RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember
> divergences.
> 
> >  drivers/acpi/acpica/acdisasm.h |  641
> ++++++++++++++++++++++++++++++++++++++++
> 
> please do not include this file in the linux kenrel.
> 
> thanks,
> -Len

^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences.
  2012-12-10  8:23     ` Zheng, Lv
@ 2012-12-10  8:54       ` Zheng, Lv
  2012-12-10 13:04         ` Rafael J. Wysocki
  0 siblings, 1 reply; 53+ messages in thread
From: Zheng, Lv @ 2012-12-10  8:54 UTC (permalink / raw)
  To: Zheng, Lv, Brown, Len, Wysocki, Rafael J; +Cc: linux-acpi, Moore, Robert

Hi, I can offer detailed proof hereafter:

After I reverted the acdisasm.h inclusion and refreshed all of the release patches, I could found the following differences between the final patches and the linuxize.sh generated ones:

PATCH 06 - 15 are marked as 20121114-01 -> 10 in my quilt stack.

release patches
patch name (acpica)	state	patch diff lines
20121114-01.patch(01)	100%	0
20121114-02.patch(02)	100%	0
20121114-03.patch(07)	100%	1 (indent)
20121114-04.patch(10)	100%	10 (acdisasm) + 7 (context)
20121114-05.patch(13)	100%	0
20121114-06.patch(15)	100%	0
20121114-07.patch(17)	100%	1 (indent)
20121114-08.patch(18)	100%	0
20121114-09.patch(19)	100%	0
20121114-10.patch(30)	100%	2 (include)

20121114-03.patch:
> -acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
> +acpi_ut_evaluate_object(struct acpi_namespace_node * prefix_node,

This is there due to the indentation divergences fixes which are not what I'm worrying about.

20121114-04.patch:
> - * dmextern
> + * dmdeferred
> +acpi_status acpi_dm_parse_deferred_ops(union acpi_parse_object *root);
> +/*
> + * dmextern
> + */
> -acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
> +acpi_status
> +acpi_dm_is_resource_template(struct acpi_walk_state *walk_state,
> +			     union acpi_parse_object *op);
<  			   acpi_walk_aml_callback user_function,
<  			   void **context);
>  			   acpi_walk_aml_callback user_function, void *context);
<  			   acpi_walk_aml_callback user_function, void **context)
>  			   acpi_walk_aml_callback user_function, void *context)
<  					    (void **)end_tag);
>  					    end_tag);

10 lines are caused by lacking of acdisasm.h and 7 lines are caused by (void **) fixes. The latter will be seen in the next acpica release which is not what I'm worrying about.
I just care about the acdisasm.h, if it is included, my life can be easier and it will not be a trouble for the developers currently using ACPICA in the community.

20121114-07.patch:
<  			    (u16) (aml_length +
>  			    (u16)(aml_length +

This is there due to the indentation divergences fixes which are not what I'm worrying about.

20121114-10.patch:
<  #include <acpi/acconfig.h>
<  #include <acpi/actypes.h>
>  #include "acconfig.h"
>  #include "actypes.h"

This is there due to the header inclusion changes which are not what I'm worrying about.

Best regards
-Lv

> -----Original Message-----
> From: linux-acpi-owner@vger.kernel.org
> [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Zheng, Lv
> Sent: Monday, December 10, 2012 4:24 PM
> To: Brown, Len; Wysocki, Rafael J
> Cc: linux-acpi@vger.kernel.org
> Subject: RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember
> divergences.
> 
> Hi, Len and Rafael
> 
> Please also look at the [PATCH 09/15] ACPICA: Debugger: Major update for the
> Disassemble<method> command.
> 
> There is acdisasm.h updates in the patch 09.
> If we can introduce acdisasm.h into linux but surround it with #ifdef/#endif to
> make it compiled out, then no manual fixes are needed for the [PATCH 09/15]
> thus less bugs in release process, Or fixes are needed to be included as a
> special case in the acpica release scripts.
> 
> Please think about the benefit of adding this file.
> I'm waiting for the decision on this.
> 
> Best regards
> -Lv
> 
> > -----Original Message-----
> > From: Brown, Len
> > Sent: Tuesday, November 27, 2012 10:59 AM
> > To: Zheng, Lv; Wysocki, Rafael J
> > Cc: linux-acpi@vger.kernel.org
> > Subject: RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember
> > divergences.
> >
> > >  drivers/acpi/acpica/acdisasm.h |  641
> > ++++++++++++++++++++++++++++++++++++++++
> >
> > please do not include this file in the linux kenrel.
> >
> > thanks,
> > -Len
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body
> of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 53+ messages in thread

* Re: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences.
  2012-12-10  8:54       ` Zheng, Lv
@ 2012-12-10 13:04         ` Rafael J. Wysocki
  2012-12-11  0:15           ` Zheng, Lv
  0 siblings, 1 reply; 53+ messages in thread
From: Rafael J. Wysocki @ 2012-12-10 13:04 UTC (permalink / raw)
  To: Zheng, Lv; +Cc: Brown, Len, linux-acpi, Moore, Robert

Hi,

On 12/10/2012 9:54 AM, Zheng, Lv wrote:
> Hi, I can offer detailed proof hereafter:
>
> After I reverted the acdisasm.h inclusion and refreshed all of the release patches, I could found the following differences between the final patches and the linuxize.sh generated ones:
>
> PATCH 06 - 15 are marked as 20121114-01 -> 10 in my quilt stack.
>
> release patches
> patch name (acpica)	state	patch diff lines
> 20121114-01.patch(01)	100%	0
> 20121114-02.patch(02)	100%	0
> 20121114-03.patch(07)	100%	1 (indent)
> 20121114-04.patch(10)	100%	10 (acdisasm) + 7 (context)
> 20121114-05.patch(13)	100%	0
> 20121114-06.patch(15)	100%	0
> 20121114-07.patch(17)	100%	1 (indent)
> 20121114-08.patch(18)	100%	0
> 20121114-09.patch(19)	100%	0
> 20121114-10.patch(30)	100%	2 (include)
>
> 20121114-03.patch:
>> -acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
>> +acpi_ut_evaluate_object(struct acpi_namespace_node * prefix_node,
> This is there due to the indentation divergences fixes which are not what I'm worrying about.
>
> 20121114-04.patch:
>> - * dmextern
>> + * dmdeferred
>> +acpi_status acpi_dm_parse_deferred_ops(union acpi_parse_object *root);
>> +/*
>> + * dmextern
>> + */
>> -acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
>> +acpi_status
>> +acpi_dm_is_resource_template(struct acpi_walk_state *walk_state,
>> +			     union acpi_parse_object *op);
> <  			   acpi_walk_aml_callback user_function,
> <  			   void **context);
>>   			   acpi_walk_aml_callback user_function, void *context);
> <  			   acpi_walk_aml_callback user_function, void **context)
>>   			   acpi_walk_aml_callback user_function, void *context)
> <  					    (void **)end_tag);
>>   					    end_tag);
> 10 lines are caused by lacking of acdisasm.h and 7 lines are caused by (void **) fixes. The latter will be seen in the next acpica release which is not what I'm worrying about.
> I just care about the acdisasm.h, if it is included, my life can be easier and it will not be a trouble for the developers currently using ACPICA in the community.

But Len has told you very clearly not to include it.  This is not a 
Len's whim, there's a reason for that.

Is the reason not known to you or don't you agree with it?

> 20121114-07.patch:
> <  			    (u16) (aml_length +
>>   			    (u16)(aml_length +
> This is there due to the indentation divergences fixes which are not what I'm worrying about.
>
> 20121114-10.patch:
> <  #include <acpi/acconfig.h>
> <  #include <acpi/actypes.h>
>>   #include "acconfig.h"
>>   #include "actypes.h"
> This is there due to the header inclusion changes which are not what I'm worrying about.

OK, thanks.

Rafael


>
>> -----Original Message-----
>> From: linux-acpi-owner@vger.kernel.org
>> [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Zheng, Lv
>> Sent: Monday, December 10, 2012 4:24 PM
>> To: Brown, Len; Wysocki, Rafael J
>> Cc: linux-acpi@vger.kernel.org
>> Subject: RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember
>> divergences.
>>
>> Hi, Len and Rafael
>>
>> Please also look at the [PATCH 09/15] ACPICA: Debugger: Major update for the
>> Disassemble<method> command.
>>
>> There is acdisasm.h updates in the patch 09.
>> If we can introduce acdisasm.h into linux but surround it with #ifdef/#endif to
>> make it compiled out, then no manual fixes are needed for the [PATCH 09/15]
>> thus less bugs in release process, Or fixes are needed to be included as a
>> special case in the acpica release scripts.
>>
>> Please think about the benefit of adding this file.
>> I'm waiting for the decision on this.
>>
>> Best regards
>> -Lv
>>
>>> -----Original Message-----
>>> From: Brown, Len
>>> Sent: Tuesday, November 27, 2012 10:59 AM
>>> To: Zheng, Lv; Wysocki, Rafael J
>>> Cc: linux-acpi@vger.kernel.org
>>> Subject: RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember
>>> divergences.
>>>
>>>>   drivers/acpi/acpica/acdisasm.h |  641
>>> ++++++++++++++++++++++++++++++++++++++++
>>>
>>> please do not include this file in the linux kenrel.
>>>
>>> thanks,
>>> -Len
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body
>> of a message to majordomo@vger.kernel.org More majordomo info at
>> http://vger.kernel.org/majordomo-info.html

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk

Sad Rejonowy Gdansk Polnoc w Gdansku, 
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, 
numer KRS 101882

NIP 957-07-52-316
Kapital zakladowy 200.000 zl

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply	[flat|nested] 53+ messages in thread

* RE: [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences.
  2012-12-10 13:04         ` Rafael J. Wysocki
@ 2012-12-11  0:15           ` Zheng, Lv
  0 siblings, 0 replies; 53+ messages in thread
From: Zheng, Lv @ 2012-12-11  0:15 UTC (permalink / raw)
  To: Wysocki, Rafael J; +Cc: Brown, Len, linux-acpi, Moore, Robert

> > 20121114-04.patch:
> >> - * dmextern
> >> + * dmdeferred
> >> +acpi_status acpi_dm_parse_deferred_ops(union acpi_parse_object
> >> +*root);
> >> +/*
> >> + * dmextern
> >> + */
> >> -acpi_status acpi_dm_is_resource_template(union acpi_parse_object
> >> *op);
> >> +acpi_status
> >> +acpi_dm_is_resource_template(struct acpi_walk_state *walk_state,
> >> +			     union acpi_parse_object *op);
> > <  			   acpi_walk_aml_callback user_function,
> > <  			   void **context);
> >>   			   acpi_walk_aml_callback user_function, void *context);
> > <  			   acpi_walk_aml_callback user_function, void **context)
> >>   			   acpi_walk_aml_callback user_function, void *context)
> > <  					    (void **)end_tag);
> >>   					    end_tag);
> > 10 lines are caused by lacking of acdisasm.h and 7 lines are caused by (void **)
> fixes. The latter will be seen in the next acpica release which is not what I'm
> worrying about.
> > I just care about the acdisasm.h, if it is included, my life can be easier and it
> will not be a trouble for the developers currently using ACPICA in the
> community.
> 
> But Len has told you very clearly not to include it.  This is not a Len's whim,
> there's a reason for that.
> 
> Is the reason not known to you or don't you agree with it?

I agreed w/ what we've been discussing about and reworked then found this.
I just wonder whether we could think about it from a different perspective.
Now we have the directory-by-directory "exceptions" maintained in the release scripts:
 common/compiler/debugger/disassembler/interpreter/os_specific/tools.
I just wonder do we need to maintain the file-by-file "exceptions" for the release process.
It will be convenient if there's no such exceptions, then ACPICA can freely manage the files under the "white listed" directories.

Best regards
-Lv

^ permalink raw reply	[flat|nested] 53+ messages in thread

* [PATCH v2 01/19] ACPICA: Cleanup updated comments.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
@ 2012-12-19  5:36   ` Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 03/19] ACPICA: Update codes under disabled build options Lv Zheng
                     ` (17 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:36 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 558 lines of 20121018 divergence.diff.

This patch reduces the source code diff between Linux and ACPICA by
cleaning the comments that already have been updated in ACPICA.

There is no extra indentation done in this patch. Even the empty line
deletions and insertions are also splitted into another cleanup patch so
that this patch can be easily reviewed, and the binary differences can be
hold to a lowest level (lowest __LINE__ changes).

===========================================================================

         Background of "ACPICA <-> Linux Divergences Fixes"

The divergences fixes are meant to make the ACPICA release engineering work
easier. More jobs can be done by the scripts running on the machines without
the human intervention if the divergences can be controlled down to an
acceptable level.

The fixes will use the following two steps to reduce the divergences:
1. Fix the "cosmetic" stuff:
   The ACPICA release engineers will focus on the divergences that relate
   to the "commentary", "indentation", "coding styles", "debug messages",
   "code block offsetting", etc. in this step.
   Such divergences are fixed so that the "useful" stuff can rise to the
   surface. Most of the fixes do not affect the generation of the Linux
   binary, some of them do not affect the functionality of the generated
   Linux binary. Since introducing such fixes to Linux is low risk and some
   release patches depend on the divergences fixes, the work might be done
   by the ACPICA release engineers using a reduced community process. Such
   fixes will be attached on top of the release patch set directly during
   the release work.
   Such "cosmetic" fixes are expected to be done in 2-4 merge cycles.
2. Fix the "useful" stuff:
   Either by porting the Linux bug fixes to the ACPICA.
   Or by merging the lost ACPICA features to the Linux.
   These patches will be sent to community one by one, awaiting comments,
   then get merged. They will not appear in the release patch set.

Every "cosmetic" divergences fix patch lists the line number of the
divergences reduced by the patch.
The divergences result is generated by the following steps:
---------------------------------------------------------------------------
1. pop the patch from the kernel
2. divergence.sh -s <kernel source tree>
3. push the patch to the kernel
4. divergence.sh -s <kernel source tree>
---------------------------------------------------------------------------
Where the divergence.sh can be found in the generate/linux folder of the
acpica project source tree.

If a "cosmetic" divergences fix patch does not affect the generation of the
Linux binary, you can find a binary comparision result in the patch
description.
The comparision result is generated by the following steps:
---------------------------------------------------------------------------
1. pop the patch and build the kernel
2. objcopy -R .notes binary1 > binary2
3. objdump -d binary2 > before.dump
4. push the patch and build the kernel
5. objcopy -R .notes binary1 > binary2
6. objdump -d binary2 > after.dump
7. diff -u before.dump after.dump
---------------------------------------------------------------------------
Where:
1. Basically, binary1 will be "drivers/acpi/acpica/acpi.o". The same
   process will be executed on "vmlinux" for confirmation if there are
   header file changes that will seriously affect the generation of the
   vmlinux.
2. The build step is done by an i386 toolchain so we need to delete .note
   section which belongs to the .text section to avoid confusions.

If you have concerns about such fixes, please do not send your blame to the
code authors or the subsystem maintainers as they have done the right
things to help improve the Linux or the ACPICA. Please send your blame to
the following mail address whose owner is the culprit doing the bad things
(ex. introducing the mistakes) during the release engineering work.
---------------------------------------------------------------------------
Lv "ZETALOG" Zheng <lv.zheng@intel.com>
---------------------------------------------------------------------------

NOTE: This description will always be attached in the first patch of an
      ACPICA linuxized patch set if there are "cosmetic" divergences fixes
      embedded in the release.

===========================================================================

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Binary comparision result:
  Changes can be found are caused by the line folding:
  -    6a74:	68 16 02 00 00       	push   $0x216
  +    6a74:	68 1a 02 00 00       	push   $0x21a
  exconfig.c(538): acpi_ex_load_op
  ACPI_INFO -> AE_INFO -> __LINE__
  -    6c1e:	68 03 01 00 00       	push   $0x103
  +    6c1e:	68 07 01 00 00       	push   $0x107
  exconfig.c(263): acpi_ex_load_table_op
  ACPI_INFO -> AE_INFO -> __LINE__
  -    a704:	68 b1 00 00 00       	push   $0xb1
  +    a704:	68 b5 00 00 00       	push   $0xb5
  exregion.c(181-3): acpi_ex_system_memory_space_handler
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    dc19:	68 c5 00 00 00       	push   $0xc5
  +    dc19:	68 c6 00 00 00       	push   $0xc6
  nsnames.c(198-2): acpi_ns_get_pathname_length
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    dc87:	68 98 00 00 00       	push   $0x98
  +    dc87:	68 99 00 00 00       	push   $0x99
  nsnames.c(153): acpi_ns_get_external_pathname
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    e06f:	68 fb 03 00 00       	push   $0x3fb
  +    e06f:	68 fa 03 00 00       	push   $0x3fa
  nspredef.c(1018-4): acpi_ns_check_object_type
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e0e3:	68 6e 04 00 00       	push   $0x46e
  +    e0e3:	68 6d 04 00 00       	push   $0x46d
  nspredef.c(1133-3): acpi_ns_check_object_type
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e159:	68 41 04 00 00       	push   $0x441
  +    e159:	68 40 04 00 00       	push   $0x440
  nspredef.c(1088-3): acpi_ns_check_object_type
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e188:	68 47 04 00 00       	push   $0x447
  +    e188:	68 46 04 00 00       	push   $0x446
  nspredef.c(1094-4): acpi_ns_check_object_type
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e3c4:	68 89 03 00 00       	push   $0x389
  +    e3c4:	68 88 03 00 00       	push   $0x388
  nspredef.c(904-2): acpi_ns_check_package_list
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e419:	68 41 01 00 00       	push   $0x141
  +    e419:	68 40 01 00 00       	push   $0x140
  nspredef.c(320-3): acpi_ns_check_parameter_count
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e432:	68 46 01 00 00       	push   $0x146
  +    e432:	68 45 01 00 00       	push   $0x145
  nspredef.c(325-3): acpi_ns_check_parameter_count
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e460:	68 5a 01 00 00       	push   $0x15a
  +    e460:	68 59 01 00 00       	push   $0x159
  nspredef.c(345-5): acpi_ns_check_parameter_count
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e48e:	68 67 01 00 00       	push   $0x167
  +    e48e:	68 66 01 00 00       	push   $0x166
  nspredef.c(358-2): acpi_ns_check_parameter_count
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e556:	68 bc 00 00 00       	push   $0xbc
  +    e556:	68 bb 00 00 00       	push   $0xbb
  nspredef.c(187-2): acpi_ns_check_predefined_names
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e644:	68 cf 01 00 00       	push   $0x1cf
  +    e644:	68 ce 01 00 00       	push   $0x1ce
  nspredef.c(462-1): acpi_ns_check_package
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e7c9:	68 9a 02 00 00       	push   $0x29a
  +    e7c9:	68 99 02 00 00       	push   $0x299
  nspredef.c(665-2): acpi_ns_check_predefined_names
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    e7f3:	68 a7 02 00 00       	push   $0x2a7
  +    e7f3:	68 a6 02 00 00       	push   $0x2a6
  nspredef.c(678-2): acpi_ns_check_predefined_names
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -   135eb:	68 36 01 00 00       	push   $0x136
  +   135eb:	68 37 01 00 00       	push   $0x137
  tbfadt.c(311-4): acpi_tb_create_local_fadt
  ACPI_BIOS_WARNING -> AE_INFO -> __LINE__
  -   13675:	68 8a 01 00 00       	push   $0x18a
  +   13675:	68 8b 01 00 00       	push   $0x18b
  tbfadt.c(395-1): acpi_tb_convert_fadt
  ACPI_WARNING -> AE_INFO -> __LINE__
  -   136c0:	68 92 01 00 00       	push   $0x192
  +   136c0:	68 93 01 00 00       	push   $0x193
  tbfadt.c(403-1): acpi_tb_convert_fadt
  ACPI_WARNING -> AE_INFO -> __LINE__
  -   1374c:	68 cd 01 00 00       	push   $0x1cd
  +   1374c:	68 ce 01 00 00       	push   $0x1ce
  tbfadt.c(462-5): acpi_tb_convert_fadt
  ACPI_BIOS_ERROR -> AE_INFO -> __LINE__
  -   13790:	68 c9 00 00 00       	push   $0xc9
  +   13790:	68 ca 00 00 00       	push   $0xca
  tbfadt.c(202-3): acpi_tb_init_generic_address
  ACPI_ERROR -> AE_INFO -> __LINE__
  -   137f1:	68 09 02 00 00       	push   $0x209
  +   137f1:	68 0a 02 00 00       	push   $0x20a
  tbfadt.c(522-4): acpi_tb_validate_fadt
  ACPI_BIOS_WARNING -> AE_INFO -> __LINE__
  -   1383e:	68 14 02 00 00       	push   $0x214
  +   1383e:	68 15 02 00 00       	push   $0x215
  tbfadt.c(533-4): acpi_tb_validate_fadt
  ACPI_BIOS_WARNING -> AE_INFO -> __LINE__
  -   138c0:	68 37 02 00 00       	push   $0x237
  +   138c0:	68 38 02 00 00       	push   $0x238
  tbfadt.c(568-3): acpi_tb_validate_fadt
  ACPI_BIOS_WARNING -> AE_INFO -> __LINE__
  -   138fe:	68 46 02 00 00       	push   $0x246
  +   138fe:	68 47 02 00 00       	push   $0x247
  tbfadt.c(583-6): acpi_tb_validate_fadt
  ACPI_BIOS_ERROR -> AE_INFO -> __LINE__
  -   13933:	68 56 02 00 00       	push   $0x256
  +   13933:	68 57 02 00 00       	push   $0x257
  tbfadt.c(599-6): acpi_tb_validate_fadt
  ACPI_BIOS_WARNING -> AE_INFO -> __LINE__
  -   139ac:	68 88 02 00 00       	push   $0x288
  +   139ac:	68 89 02 00 00       	push   $0x289
  tbfadt.c(649-6): acpi_tb_setup_fadt_registers
  ACPI_BIOS_WARNING -> AE_INFO -> __LINE__
---
Divergences fixing result:
  Before applying: 3978 Lines, 138.4 Kbytes
  After applying: 3420 Lines, 115.8 Kbytes
---
 drivers/acpi/acpica/aclocal.h   |   14 ++++++++-----
 drivers/acpi/acpica/acobject.h  |    2 +-
 drivers/acpi/acpica/acpredef.h  |   14 +++++++------
 drivers/acpi/acpica/dsopcode.c  |   14 ++++++-------
 drivers/acpi/acpica/evgpe.c     |    4 ++--
 drivers/acpi/acpica/evxface.c   |   21 +++++++++----------
 drivers/acpi/acpica/evxfevnt.c  |    4 ++--
 drivers/acpi/acpica/evxfgpe.c   |    8 +++----
 drivers/acpi/acpica/exconfig.c  |    8 +++++--
 drivers/acpi/acpica/exmutex.c   |    2 +-
 drivers/acpi/acpica/exregion.c  |   12 +++++++----
 drivers/acpi/acpica/hwesleep.c  |    1 -
 drivers/acpi/acpica/hwregs.c    |    2 +-
 drivers/acpi/acpica/hwxface.c   |   10 ++++-----
 drivers/acpi/acpica/hwxfsleep.c |    7 ++++---
 drivers/acpi/acpica/nsdump.c    |    4 ++--
 drivers/acpi/acpica/nsinit.c    |    5 -----
 drivers/acpi/acpica/nsnames.c   |    3 ++-
 drivers/acpi/acpica/nspredef.c  |    1 -
 drivers/acpi/acpica/nsxfeval.c  |    1 +
 drivers/acpi/acpica/tbfadt.c    |    5 +++--
 drivers/acpi/acpica/utglobal.c  |    1 +
 drivers/acpi/acpica/utobject.c  |    2 +-
 drivers/acpi/acpica/utxferror.c |    4 ++--
 include/acpi/acconfig.h         |    2 +-
 include/acpi/acpixf.h           |   10 ++++++---
 include/acpi/actbl1.h           |    6 +++---
 include/acpi/actypes.h          |    4 ++--
 include/acpi/platform/acenv.h   |   44 ++++++++++++++++-----------------------
 29 files changed, 111 insertions(+), 104 deletions(-)

diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index ff8bd00..3453ea6 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -189,11 +189,10 @@ struct acpi_namespace_node {
 #define ANOBJ_EVALUATED                 0x20	/* Set on first evaluation of node */
 #define ANOBJ_ALLOCATED_BUFFER          0x40	/* Method AML buffer is dynamic (install_method) */
 
-#define ANOBJ_IS_EXTERNAL               0x08	/* i_aSL only: This object created via External() */
-#define ANOBJ_METHOD_NO_RETVAL          0x10	/* i_aSL only: Method has no return value */
-#define ANOBJ_METHOD_SOME_NO_RETVAL     0x20	/* i_aSL only: Method has at least one return value */
-#define ANOBJ_IS_BIT_OFFSET             0x40	/* i_aSL only: Reference is a bit offset */
-#define ANOBJ_IS_REFERENCED             0x80	/* i_aSL only: Object was referenced */
+#define ANOBJ_IS_EXTERNAL               0x08	/* iASL only: This object created via External() */
+#define ANOBJ_METHOD_NO_RETVAL          0x10	/* iASL only: Method has no return value */
+#define ANOBJ_METHOD_SOME_NO_RETVAL     0x20	/* iASL only: Method has at least one return value */
+#define ANOBJ_IS_REFERENCED             0x80	/* iASL only: Object was referenced */
 
 /* Internal ACPI table management - master table list */
 
@@ -416,6 +415,10 @@ struct acpi_gpe_notify_object {
 	struct acpi_gpe_notify_object *next;
 };
 
+/*
+ * GPE dispatch info. At any time, the GPE can have at most one type
+ * of dispatch - Method, Handler, or Implicit Notify.
+ */
 union acpi_gpe_dispatch_info {
 	struct acpi_namespace_node *method_node;	/* Method node for this GPE level */
 	struct acpi_gpe_handler_info *handler;  /* Installed GPE handler */
@@ -679,6 +682,7 @@ struct acpi_opcode_info {
 	u8 type;		/* Opcode type */
 };
 
+/* Value associated with the parse object */
 union acpi_parse_value {
 	u64 integer;		/* Integer constant (Up to 64 bits) */
 	u32 size;		/* bytelist or field size */
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
index 24eb9ea..921262e 100644
--- a/drivers/acpi/acpica/acobject.h
+++ b/drivers/acpi/acpica/acobject.h
@@ -307,7 +307,7 @@ struct acpi_object_addr_handler {
 	struct acpi_namespace_node *node;	/* Parent device */
 	void *context;
 	acpi_adr_space_setup setup;
-	union acpi_operand_object *region_list;	/* regions using this handler */
+	union acpi_operand_object *region_list;	/* Regions using this handler */
 	union acpi_operand_object *next;
 };
 
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index 9dfa1c8..55fff56 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -1,7 +1,6 @@
 /******************************************************************************
  *
  * Name: acpredef - Information table for ACPI predefined methods and objects
- *              $Revision: 1.1 $
  *
  *****************************************************************************/
 
@@ -51,13 +50,13 @@
  *
  * 1) PTYPE1 packages do not contain sub-packages.
  *
- * ACPI_PTYPE1_FIXED: Fixed length, 1 or 2 object types:
+ * ACPI_PTYPE1_FIXED: Fixed-length length, 1 or 2 object types:
  *      object type
  *      count
  *      object type
  *      count
  *
- * ACPI_PTYPE1_VAR: Variable length:
+ * ACPI_PTYPE1_VAR: Variable-length length:
  *      object type (Int/Buf/Ref)
  *
  * ACPI_PTYPE1_OPTION: Package has some required and some optional elements
@@ -85,10 +84,10 @@
  *      count
  *      (Used for _CST)
  *
- * ACPI_PTYPE2_FIXED: Each subpackage is of fixed length
+ * ACPI_PTYPE2_FIXED: Each subpackage is of Fixed-length
  *      (Used for _PRT)
  *
- * ACPI_PTYPE2_MIN: Each subpackage has a variable but minimum length
+ * ACPI_PTYPE2_MIN: Each subpackage has a Variable-length but minimum length
  *      (Used for _HPX)
  *
  * ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length
@@ -124,7 +123,8 @@ enum acpi_return_package_types {
  * These are the names that can actually be evaluated via acpi_evaluate_object.
  * Not present in this table are the following:
  *
- *      1) Predefined/Reserved names that are never evaluated via acpi_evaluate_object:
+ *      1) Predefined/Reserved names that are never evaluated via
+ *         acpi_evaluate_object:
  *          _Lxx and _Exx GPE methods
  *          _Qxx EC methods
  *          _T_x compiler temporary variables
@@ -149,6 +149,8 @@ enum acpi_return_package_types {
  * information about the expected structure of the package. This information
  * is saved here (rather than in a separate table) in order to minimize the
  * overall size of the stored data.
+ *
+ * Note: The additional braces are intended to promote portability.
  */
 static const union acpi_predefined_info predefined_names[] = {
 	{{"_AC0", 0, ACPI_RTYPE_INTEGER}},
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 0df024e..8e9bdce 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -486,18 +486,18 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
 	ACPI_FUNCTION_TRACE_PTR(ds_eval_table_region_operands, op);
 
 	/*
-	 * This is where we evaluate the signature_string and oem_iDString
-	 * and oem_table_iDString of the data_table_region declaration
+	 * This is where we evaluate the Signature string, oem_id string,
+	 * and oem_table_id string of the Data Table Region declaration
 	 */
 	node = op->common.node;
 
-	/* next_op points to signature_string op */
+	/* next_op points to Signature string op */
 
 	next_op = op->common.value.arg;
 
 	/*
-	 * Evaluate/create the signature_string and oem_iDString
-	 * and oem_table_iDString operands
+	 * Evaluate/create the Signature string, oem_id string,
+	 * and oem_table_id string operands
 	 */
 	status = acpi_ds_create_operands(walk_state, next_op);
 	if (ACPI_FAILURE(status)) {
@@ -505,8 +505,8 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
 	}
 
 	/*
-	 * Resolve the signature_string and oem_iDString
-	 * and oem_table_iDString operands
+	 * Resolve the Signature string, oem_id string,
+	 * and oem_table_id string operands
 	 */
 	status = acpi_ex_resolve_operands(op->common.aml_opcode,
 					  ACPI_WALK_OPERANDS, walk_state);
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index 36d1205..a137ce81 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -561,8 +561,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 			status = AE_NO_MEMORY;
 		} else {
 			/*
-			 * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
-			 * control method that corresponds to this GPE
+			 * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the
+			 * _Lxx/_Exx control method that corresponds to this GPE
 			 */
 			info->prefix_node =
 			    local_gpe_event_info->dispatch.method_node;
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index ae668f3..76cfe71 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -56,13 +56,13 @@ ACPI_MODULE_NAME("evxface")
  *
  * FUNCTION:    acpi_install_notify_handler
  *
- * PARAMETERS:  Device          - The device for which notifies will be handled
+ * PARAMETERS:  device          - The device for which notifies will be handled
  *              handler_type    - The type of handler:
  *                                  ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
  *                                  ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
  *                                  ACPI_ALL_NOTIFY:    Both System and Device
- *              Handler         - Address of the handler
- *              Context         - Value passed to the handler on each GPE
+ *              handler         - Address of the handler
+ *              context         - Value passed to the handler on each GPE
  *
  * RETURN:      Status
  *
@@ -217,12 +217,12 @@ ACPI_EXPORT_SYMBOL(acpi_install_notify_handler)
  *
  * FUNCTION:    acpi_remove_notify_handler
  *
- * PARAMETERS:  Device          - The device for which the handler is installed
+ * PARAMETERS:  device          - The device for which the handler is installed
  *              handler_type    - The type of handler:
  *                                  ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
  *                                  ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
  *                                  ACPI_ALL_NOTIFY:    Both System and Device
- *              Handler         - Address of the handler
+ *              handler         - Address of the handler
  *
  * RETURN:      Status
  *
@@ -249,7 +249,7 @@ acpi_remove_notify_handler(acpi_handle device,
 	    (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) {
 		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
-	/* Make sure all deferred tasks are completed */
+	/* Make sure all deferred notify tasks are completed */
 
 	acpi_os_wait_events_complete();
 
@@ -596,7 +596,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 		return_ACPI_STATUS(status);
 	}
 
-	/* Allocate memory for the handler object */
+	/* Allocate and init handler object (before lock) */
 
 	handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_handler_info));
 	if (!handler) {
@@ -622,7 +622,6 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 		goto free_and_exit;
 	}
 
-	/* Allocate and init handler object */
 
 	handler->address = address;
 	handler->context = context;
@@ -631,7 +630,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 			(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
 
 	/*
-	 * If the GPE is associated with a method, it might have been enabled
+	 * If the GPE is associated with a method, it may have been enabled
 	 * automatically during initialization, in which case it has to be
 	 * disabled now to avoid spurious execution of the handler.
 	 */
@@ -646,7 +645,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
 	gpe_event_info->dispatch.handler = handler;
 
-	/* Setup up dispatch flags to indicate handler (vs. method) */
+	/* Setup up dispatch flags to indicate handler (vs. method/notify) */
 
 	gpe_event_info->flags &=
 	    ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
@@ -697,7 +696,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
 		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
-	/* Make sure all deferred tasks are completed */
+	/* Make sure all deferred GPE tasks are completed */
 
 	acpi_os_wait_events_complete();
 
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index 35520c6..ee6e96c 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -210,8 +210,8 @@ ACPI_EXPORT_SYMBOL(acpi_enable_event)
  *
  * FUNCTION:    acpi_disable_event
  *
- * PARAMETERS:  Event           - The fixed eventto be enabled
- *              Flags           - Reserved
+ * PARAMETERS:  event           - The fixed event to be disabled
+ *              flags           - Reserved
  *
  * RETURN:      Status
  *
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index 3f30e75..d8095c1 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -51,7 +51,7 @@
 ACPI_MODULE_NAME("evxfgpe")
 
 #if (!ACPI_REDUCED_HARDWARE)	/* Entire module */
-/******************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    acpi_update_all_gpes
  *
@@ -225,7 +225,7 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device,
 		    ACPI_CAST_PTR(struct acpi_namespace_node, wake_device);
 	}
 
-	/* Validate WakeDevice is of type Device */
+	/* Validate wake_device is of type Device */
 
 	if (device_node->type != ACPI_TYPE_DEVICE) {
 		return_ACPI_STATUS (AE_BAD_PARAMETER);
@@ -432,8 +432,8 @@ ACPI_EXPORT_SYMBOL(acpi_clear_gpe)
  *
  * PARAMETERS:  gpe_device      - Parent GPE Device. NULL for GPE0/GPE1
  *              gpe_number      - GPE level within the GPE block
- *              event_status    - Where the current status of the event will
- *                                be returned
+ *              event_status        - Where the current status of the event
+ *                                    will be returned
  *
  * RETURN:      Status
  *
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 16219bd..9ad6420 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -120,7 +120,11 @@ acpi_ex_add_table(u32 table_index,
 	acpi_ns_exec_module_code_list();
 	acpi_ex_enter_interpreter();
 
-	/* Update GPEs for any new _Lxx/_Exx methods. Ignore errors */
+	/*
+	 * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
+	 * responsible for discovering any new wake GPEs by running _PRW methods
+	 * that may have been loaded by this table.
+	 */
 
 	status = acpi_tb_get_owner_id(table_index, &owner_id);
 	if (ACPI_SUCCESS(status)) {
@@ -158,7 +162,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
 
 	ACPI_FUNCTION_TRACE(ex_load_table_op);
 
-	/* Validate lengths for the signature_string, OEMIDString, OEMtable_iD */
+	/* Validate lengths for the Signature, oem_id, and oem_table_id strings */
 
 	if ((operand[0]->string.length > ACPI_NAME_SIZE) ||
 	    (operand[1]->string.length > ACPI_OEM_ID_SIZE) ||
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c
index d1f449d..900a251 100644
--- a/drivers/acpi/acpica/exmutex.c
+++ b/drivers/acpi/acpica/exmutex.c
@@ -377,7 +377,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		return_ACPI_STATUS(AE_AML_MUTEX_NOT_ACQUIRED);
 	}
 
-	/* Must have a valid thread. */
+	/* Must have a valid thread ID */
 	if (!walk_state->thread) {
 		ACPI_ERROR((AE_INFO,
 			    "Cannot release Mutex [%4.4s], null thread info",
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 1db2c0b..0a01e19 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -142,9 +142,9 @@ acpi_ex_system_memory_space_handler(u32 function,
 		}
 
 		/*
-		 * Attempt to map from the requested address to the end of the region.
-		 * However, we will never map more than one page, nor will we cross
-		 * a page boundary.
+		 * October 2009: Attempt to map from the requested address to the
+		 * end of the region. However, we will never map more than one
+		 * page, nor will we cross a page boundary.
 		 */
 		map_length = (acpi_size)
 		    ((mem_info->address + mem_info->length) - address);
@@ -154,7 +154,11 @@ acpi_ex_system_memory_space_handler(u32 function,
 		 * a page boundary, just map up to the page boundary, do not cross.
 		 * On some systems, crossing a page boundary while mapping regions
 		 * can cause warnings if the pages have different attributes
-		 * due to resource management
+		 * due to resource management.
+		 *
+		 * This has the added benefit of constraining a single mapping to
+		 * one page, which is similar to the original code that used a 4k
+		 * maximum window.
 		 */
 		page_boundary_map_length =
 		    ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c
index 94996f9..6c0b1a9 100644
--- a/drivers/acpi/acpica/hwesleep.c
+++ b/drivers/acpi/acpica/hwesleep.c
@@ -200,7 +200,6 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state)
  * FUNCTION:    acpi_hw_extended_wake
  *
  * PARAMETERS:  sleep_state         - Which sleep state we just exited
- *              flags               - Reserved, set to zero
  *
  * RETURN:      Status
  *
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index f4e5750..165395f 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -485,7 +485,7 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
 						&acpi_gbl_xpm1b_status);
 		break;
 
-	case ACPI_REGISTER_PM1_ENABLE:	/* PM1 A/B: 16-bit access */
+	case ACPI_REGISTER_PM1_ENABLE:	/* PM1 A/B: 16-bit access each */
 
 		status = acpi_hw_write_multiple(value,
 						&acpi_gbl_xpm1a_enable,
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 05a154c..e835645 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -80,10 +80,10 @@ acpi_status acpi_reset(void)
 
 	if (reset_reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
 		/*
-		 * For I/O space, write directly to the OSL. This
-		 * bypasses the port validation mechanism, which may
-		 * block a valid write to the reset register. Spec
-		 * section 4.7.3.6 requires register width to be 8.
+		 * For I/O space, write directly to the OSL. This bypasses the port
+		 * validation mechanism, which may block a valid write to the reset
+		 * register.
+		 * Spec section 4.7.3.6 requires register width to be 8.
 		 */
 		status =
 		    acpi_os_write_port((acpi_io_address) reset_reg->address,
@@ -333,7 +333,7 @@ ACPI_EXPORT_SYMBOL(acpi_read_bit_register)
  * FUNCTION:    acpi_write_bit_register
  *
  * PARAMETERS:  register_id     - ID of ACPI Bit Register to access
- *              Value           - Value to write to the register, in bit
+ *              value           - Value to write to the register, in bit
  *                                position zero. The bit is automatically
  *                                shifted to the correct position.
  *
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index ae443fe2..2898011 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -350,7 +350,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231)
+ * DESCRIPTION: Enter a system sleep state
  *              THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
  *
  ******************************************************************************/
@@ -382,8 +382,9 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
  * RETURN:      Status
  *
  * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
- *              sleep.
- *              Called with interrupts DISABLED.
+ *              sleep. Called with interrupts DISABLED.
+ *              We break wake/resume into 2 stages so that OSPM can handle
+ *              various OS-specific tasks between the two steps.
  *
  ******************************************************************************/
 acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 924b3c7..8e6f0037 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -729,5 +729,5 @@ void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth)
 			     ACPI_OWNER_ID_MAX, search_handle);
 	return_VOID;
 }
-#endif				/* _ACPI_ASL_COMPILER */
-#endif				/* defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) */
+#endif
+#endif
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index 4328e2a..bb6888f 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -572,11 +572,6 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
 	info->parameters = NULL;
 	info->flags = ACPI_IGNORE_RETURN_VALUE;
 
-	/*
-	 * Some hardware relies on this being executed as atomically
-	 * as possible (without an NMI being received in the middle of
-	 * this) - so disable NMIs and initialize the device:
-	 */
 	status = acpi_ns_evaluate(info);
 
 	if (ACPI_SUCCESS(status)) {
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c
index 55a175e..7d34641 100644
--- a/drivers/acpi/acpica/nsnames.c
+++ b/drivers/acpi/acpica/nsnames.c
@@ -126,7 +126,8 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,
  *              the node, In external format (name segments separated by path
  *              separators.)
  *
- * DESCRIPTION: Used for debug printing in acpi_ns_search_table().
+ * DESCRIPTION: Used to obtain the full pathname to a namespace node, usually
+ *              for error and debug statements.
  *
  ******************************************************************************/
 
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 2419f41..352be3b 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -1,7 +1,6 @@
 /******************************************************************************
  *
  * Module Name: nspredef - Validation of ACPI predefined methods and objects
- *              $Revision: 1.1 $
  *
  *****************************************************************************/
 
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index d6a9f77..70bbc1f 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -606,6 +606,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 			for (i = 0; i < cid->count; i++) {
 				if (ACPI_STRCMP(cid->ids[i].string, info->hid)
 				    == 0) {
+					/* Found a matching CID */
 					found = 1;
 					break;
 				}
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 3906518..882285b 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -172,6 +172,7 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = {
  * FUNCTION:    acpi_tb_init_generic_address
  *
  * PARAMETERS:  generic_address     - GAS struct to be initialized
+ *              space_id            - ACPI Space ID for this register
  *              byte_width          - Width of this register
  *              address             - Address of the register
  *
@@ -407,8 +408,8 @@ static void acpi_tb_convert_fadt(void)
 	 * should be zero are indeed zero. This will workaround BIOSs that
 	 * inadvertently place values in these fields.
 	 *
-	 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at
-	 * offset 45, 55, 95, and the word located at offset 109, 110.
+	 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located
+	 * at offset 45, 55, 95, and the word located at offset 109, 110.
 	 *
 	 * Note: The FADT revision value is unreliable. Only the length can be
 	 * trusted.
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index ed18931..d7919a3 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -368,6 +368,7 @@ acpi_status acpi_ut_init_globals(void)
 	return_ACPI_STATUS(AE_OK);
 }
 
+/* Public globals */
 ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
 ACPI_EXPORT_SYMBOL(acpi_dbg_level)
 ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c
index 5c52ca7..822600b 100644
--- a/drivers/acpi/acpica/utobject.c
+++ b/drivers/acpi/acpica/utobject.c
@@ -419,7 +419,7 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object)
 {
 	ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object);
 
-	/* Object must be a union acpi_operand_object */
+	/* Object must be of type union acpi_operand_object */
 
 	if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) {
 		ACPI_ERROR((AE_INFO,
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index d4d3826..a247a22 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -297,9 +297,9 @@ ACPI_EXPORT_SYMBOL(acpi_bios_warning)
  *
  * PARAMETERS:  module_name     - Caller's module name (for error output)
  *              line_number     - Caller's line number (for error output)
- *              Pathname        - Full pathname to the node
+ *              pathname        - Full pathname to the node
  *              node_flags      - From Namespace node for the method/object
- *              Format          - Printf format string + additional args
+ *              format          - Printf format string + additional args
  *
  * RETURN:      None
  *
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 0943457..358258a 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -138,7 +138,7 @@
 
 /* Maximum sleep allowed via Sleep() operator */
 
-#define ACPI_MAX_SLEEP                  2000	/* Two seconds */
+#define ACPI_MAX_SLEEP                  2000	/* 2000 millisec == two seconds */
 
 /* Address Range lists are per-space_id (Memory and I/O only) */
 
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 3d88395..defbcaa 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -56,11 +56,12 @@
 extern u8 acpi_gbl_permanent_mmap;
 
 /*
- * Globals that are publicly available, allowing for
- * run time configuration
+ * Globals that are publically available
  */
+/* Runtime configuration of debug print levels */
 extern u32 acpi_dbg_level;
 extern u32 acpi_dbg_layer;
+/* ACPICA runtime options */
 extern u8 acpi_gbl_enable_interpreter_slack;
 extern u8 acpi_gbl_all_methods_serialized;
 extern u8 acpi_gbl_create_osi_method;
@@ -106,7 +107,7 @@ extern u8 acpi_gbl_reduced_hardware;	/* ACPI 5.0 */
 
 extern u32 acpi_rsdt_forced;
 /*
- * Global interfaces
+ * Initialization
  */
 acpi_status
 acpi_initialize_tables(struct acpi_table_desc *initial_storage,
@@ -124,6 +125,9 @@ acpi_status acpi_terminate(void);
 acpi_status acpi_subsystem_status(void);
 #endif
 
+/*
+ * Miscellaneous global interfaces
+ */
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
 
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 280fc45..61f04c0 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -768,7 +768,7 @@ struct acpi_madt_interrupt_source {
 
 struct acpi_madt_local_x2apic {
 	struct acpi_subtable_header header;
-	u16 reserved;		/* Reserved - must be zero */
+	u16 reserved;		/* reserved - must be zero */
 	u32 local_apic_id;	/* Processor x2APIC ID  */
 	u32 lapic_flags;
 	u32 uid;		/* ACPI processor UID */
@@ -781,14 +781,14 @@ struct acpi_madt_local_x2apic_nmi {
 	u16 inti_flags;
 	u32 uid;		/* ACPI processor UID */
 	u8 lint;		/* LINTn to which NMI is connected */
-	u8 reserved[3];
+	u8 reserved[3];		/* reserved - must be zero */
 };
 
 /* 11: Generic Interrupt (ACPI 5.0) */
 
 struct acpi_madt_generic_interrupt {
 	struct acpi_subtable_header header;
-	u16 reserved;		/* Reserved - must be zero */
+	u16 reserved;		/* reserved - must be zero */
 	u32 gic_id;
 	u32 uid;
 	u32 flags;
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 4f43f1f..35d4dea0 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -595,7 +595,7 @@ typedef u32 acpi_object_type;
 
 /*
  * These are special object types that never appear in
- * a Namespace node, only in a union acpi_operand_object
+ * a Namespace node, only in an object of union acpi_operand_object
  */
 #define ACPI_TYPE_LOCAL_EXTRA           0x1C
 #define ACPI_TYPE_LOCAL_DATA            0x1D
@@ -662,7 +662,7 @@ typedef u32 acpi_event_status;
 #define ACPI_GPE_MAX                    0xFF
 #define ACPI_NUM_GPE                    256
 
-/* Actions for acpi_set_gpe_wake_mask, acpi_hw_low_set_gpe */
+/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */
 
 #define ACPI_GPE_ENABLE                 0
 #define ACPI_GPE_DISABLE                1
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 89cee88..e3409b6 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: acenv.h - Generation environment specific items
+ * Name: acenv.h - Host and compiler configuration
  *
  *****************************************************************************/
 
@@ -60,14 +60,12 @@
  *
  *****************************************************************************/
 
+/* Linkable ACPICA library */
 #ifdef ACPI_LIBRARY
-/*
- * Note: The non-debug version of the acpi_library does not contain any
- * debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG
- */
 #define ACPI_USE_LOCAL_CACHE
 #endif
 
+/* iASL configuration */
 #ifdef ACPI_ASL_COMPILER
 #define ACPI_DEBUG_OUTPUT
 #define ACPI_APPLICATION
@@ -77,6 +75,7 @@
 #define ACPI_DATA_TABLE_DISASSEMBLY
 #endif
 
+/* acpi_exec configuration. Multithreaded with full AML debugger */
 #ifdef ACPI_EXEC_APP
 #undef DEBUGGER_THREADING
 #define DEBUGGER_THREADING      DEBUGGER_SINGLE_THREADED
@@ -87,11 +86,13 @@
 #define ACPI_DBG_TRACK_ALLOCATIONS
 #endif
 
+/* Common for all ACPICA applications */
 #ifdef ACPI_APPLICATION
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_LOCAL_CACHE
 #endif
 
+/* Common debug support */
 #ifdef ACPI_FULL_DEBUG
 #define ACPI_DEBUGGER
 #define ACPI_DEBUG_OUTPUT
@@ -186,9 +187,7 @@
  *
  *****************************************************************************/
 
-/*
- * Are mutexes supported by the host? default is no, use binary semaphores.
- */
+/* Type of mutex supported by host. Default is binary semaphores. */
 #ifndef ACPI_MUTEX_TYPE
 #define ACPI_MUTEX_TYPE             ACPI_BINARY_SEMAPHORE
 #endif
@@ -230,9 +229,7 @@
  * We want to keep these to a minimum.
  */
 #ifdef ACPI_USE_STANDARD_HEADERS
-/*
- * Use the standard headers from the standard locations
- */
+/* Use the standard headers from the standard locations */
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
@@ -240,9 +237,7 @@
 
 #endif				/* ACPI_USE_STANDARD_HEADERS */
 
-/*
- * We will be linking to the standard Clib functions
- */
+/* We will be linking to the standard Clib functions */
 #define ACPI_STRSTR(s1,s2)      strstr((s1), (s2))
 #define ACPI_STRCHR(s1,c)       strchr((s1), (c))
 #define ACPI_STRLEN(s)          (acpi_size) strlen((s))
@@ -274,12 +269,12 @@
  *
  *****************************************************************************/
 
- /*
-  * Use local definitions of C library macros and functions
-  * NOTE: The function implementations may not be as efficient
-  * as an inline or assembly code implementation provided by a
-  * native C library.
-  */
+/*
+ * Use local definitions of C library macros and functions. These function
+ * implementations may not be as efficient as an inline or assembly code
+ * implementation provided by a native C library, but they are functionally
+ * equivalent.
+ */
 
 #ifndef va_arg
 
@@ -288,15 +283,11 @@
 typedef char *va_list;
 #endif				/* _VALIST */
 
-/*
- * Storage alignment properties
- */
+/* Storage alignment properties */
 #define  _AUPBND                (sizeof (acpi_native_int) - 1)
 #define  _ADNBND                (sizeof (acpi_native_int) - 1)
 
-/*
- * Variable argument list macro definitions
- */
+/* Variable argument list macro definitions */
 #define _bnd(X, bnd)            (((sizeof (X)) + (bnd)) & (~(bnd)))
 #define va_arg(ap, T)           (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
 #define va_end(ap)              (void) 0
@@ -304,6 +295,7 @@ typedef char *va_list;
 
 #endif				/* va_arg */
 
+/* Use the local (ACPICA) definitions of the clib functions */
 #define ACPI_STRSTR(s1,s2)      acpi_ut_strstr ((s1), (s2))
 #define ACPI_STRCHR(s1,c)       acpi_ut_strchr ((s1), (c))
 #define ACPI_STRLEN(s)          (acpi_size) acpi_ut_strlen ((s))
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 03/19] ACPICA: Update codes under disabled build options.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
  2012-12-19  5:36   ` [PATCH v2 01/19] ACPICA: Cleanup updated comments Lv Zheng
@ 2012-12-19  5:37   ` Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 05/19] ACPICA: Cleanup indentation to reduce differences between Linux and ACPICA Lv Zheng
                     ` (16 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:37 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 170 lines of 20121018 divergence.diff.

This patch updates ACPICA codes surrounded by some disabled build options
so that the source code diff between Linux and ACPICA can be reduced.

Some of these build options may never be used in the kernel, so they may
be deleted entirely in future patches.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Binary comparision result:
  Changes can be found are caused by the line folding:
  -    2bbd:	ba be 00 00 00       	mov    $0xbe,%edx
  +    2bbd:	ba bf 00 00 00       	mov    $0xbf,%edx
  dswload.c(191): acpi_ds_load1_begin_op
  ACPI_ERROR_NAMESPACE -> AE_INFO -> __LINE__
  -    2c3d:	68 ff 00 00 00       	push   $0xff
  +    2c3d:	68 00 01 00 00       	push   $0x100
  dswload.c(256-4): acpi_ds_load1_begin_op
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    2d36:	ba 5f 01 00 00       	mov    $0x15f,%edx
  +    2d36:	ba 60 01 00 00       	mov    $0x160,%edx
  dswload.c(352): acpi_ds_load1_begin_op
  ACPI_ERROR_NAMESPACE -> AE_INFO -> __LINE__
---
Divergences fixing result:
  Before applying: 3120 Lines, 107.7 Kbytes
  After applying: 2950 Lines, 103.0 Kbytes
---
 drivers/acpi/acpica/acglobal.h |    2 ++
 drivers/acpi/acpica/aclocal.h  |   25 ++++++++++++++++++++++
 drivers/acpi/acpica/dsmethod.c |    2 +-
 drivers/acpi/acpica/dswload.c  |    5 +++--
 drivers/acpi/acpica/nssearch.c |    5 +++++
 drivers/acpi/acpica/utglobal.c |    4 ++++
 include/acpi/acoutput.h        |    1 +
 include/acpi/platform/acenv.h  |   45 +++++++++++++++++++++++++++++++---------
 8 files changed, 76 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 64472e4..1ef7ca4 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -415,6 +415,8 @@ ACPI_EXTERN u8 acpi_gbl_db_output_flags;
 
 ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
 ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
+ACPI_EXTERN struct acpi_external_list *acpi_gbl_external_list;
+ACPI_EXTERN struct acpi_external_file *acpi_gbl_external_file_list;
 #endif
 
 #ifdef ACPI_DEBUGGER
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 3453ea6..50f8b97 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -1029,6 +1029,31 @@ struct acpi_port_info {
 
 /*****************************************************************************
  *
+ * Disassembler
+ *
+ ****************************************************************************/
+
+struct acpi_external_list {
+	char *path;
+	char *internal_path;
+	struct acpi_external_list *next;
+	u32 value;
+	u16 length;
+	u8 type;
+	u8 flags;
+};
+
+/* Values for Flags field above */
+
+#define ACPI_IPATH_ALLOCATED    0x01
+
+struct acpi_external_file {
+	char *path;
+	struct acpi_external_file *next;
+};
+
+/*****************************************************************************
+ *
  * Debugger
  *
  ****************************************************************************/
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 52eb4e0..735c059 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -47,7 +47,7 @@
 #include "acinterp.h"
 #include "acnamesp.h"
 #ifdef	ACPI_DISASSEMBLER
-#include <acpi/acdisasm.h>
+#include "acdisasm.h"
 #endif
 
 #define _COMPONENT          ACPI_DISPATCHER
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 5575100..d290740 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -50,7 +50,7 @@
 #include "acnamesp.h"
 
 #ifdef ACPI_ASL_COMPILER
-#include <acpi/acdisasm.h>
+#include "acdisasm.h"
 #endif
 
 #define _COMPONENT          ACPI_DISPATCHER
@@ -178,7 +178,8 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
 			 * Target of Scope() not found. Generate an External for it, and
 			 * insert the name into the namespace.
 			 */
-			acpi_dm_add_to_external_list(path, ACPI_TYPE_DEVICE, 0);
+			acpi_dm_add_to_external_list(op, path, ACPI_TYPE_DEVICE,
+						     0);
 			status =
 			    acpi_ns_lookup(walk_state->scope_info, path,
 					   object_type, ACPI_IMODE_LOAD_PASS1,
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c
index 1d2d8ff..b7f4264 100644
--- a/drivers/acpi/acpica/nssearch.c
+++ b/drivers/acpi/acpica/nssearch.c
@@ -328,6 +328,11 @@ acpi_ns_search_and_enter(u32 target_name,
 		if ((status == AE_OK) && (flags & ACPI_NS_ERROR_IF_FOUND)) {
 			status = AE_ALREADY_EXISTS;
 		}
+#ifdef ACPI_ASL_COMPILER
+		if (*return_node && (*return_node)->type == ACPI_TYPE_ANY) {
+			(*return_node)->flags |= ANOBJ_IS_EXTERNAL;
+		}
+#endif
 
 		/* Either found it or there was an error: finished either way */
 
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index d7919a3..4080088 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -357,6 +357,10 @@ acpi_status acpi_ut_init_globals(void)
 	acpi_gbl_root_node_struct.peer = NULL;
 	acpi_gbl_root_node_struct.object = NULL;
 
+#ifdef ACPI_DISASSEMBLER
+	acpi_gbl_external_list = NULL;
+#endif
+
 #ifdef ACPI_DEBUG_OUTPUT
 	acpi_gbl_lowest_stack_pointer = ACPI_CAST_PTR(acpi_size, ACPI_SIZE_MAX);
 #endif
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 2457ac8..38e1be0 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -72,6 +72,7 @@
 #define ACPI_EXAMPLE                0x00004000
 #define ACPI_DRIVER                 0x00008000
 #define DT_COMPILER                 0x00010000
+#define ASL_PREPROCESSOR            0x00020000
 
 #define ACPI_ALL_COMPONENTS         0x0001FFFF
 #define ACPI_COMPONENT_DEFAULT      (ACPI_ALL_COMPONENTS)
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 68a58a1..13ac538 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -65,32 +65,57 @@
  *
  *****************************************************************************/
 
-/* Linkable ACPICA library */
-#ifdef ACPI_LIBRARY
-#define ACPI_USE_LOCAL_CACHE
-#endif
-
 /* iASL configuration */
 #ifdef ACPI_ASL_COMPILER
-#define ACPI_DEBUG_OUTPUT
 #define ACPI_APPLICATION
 #define ACPI_DISASSEMBLER
+#define ACPI_DEBUG_OUTPUT
 #define ACPI_CONSTANT_EVAL_ONLY
 #define ACPI_LARGE_NAMESPACE_NODE
 #define ACPI_DATA_TABLE_DISASSEMBLY
+#define ACPI_SINGLE_THREADED
 #endif
 
 /* acpi_exec configuration. Multithreaded with full AML debugger */
 #ifdef ACPI_EXEC_APP
-#undef DEBUGGER_THREADING
-#define DEBUGGER_THREADING      DEBUGGER_SINGLE_THREADED
-#define ACPI_FULL_DEBUG
 #define ACPI_APPLICATION
-#define ACPI_DEBUGGER
+#define ACPI_FULL_DEBUG
 #define ACPI_MUTEX_DEBUG
 #define ACPI_DBG_TRACK_ALLOCATIONS
 #endif
 
+/* acpi_names configuration. Single threaded with debugger output enabled. */
+
+#ifdef ACPI_NAMES_APP
+#define ACPI_DEBUGGER
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#endif
+
+/*
+ * acpi_bin/acpi_help/acpi_src configuration. All single threaded, with
+ * no debug output.
+ */
+#if (defined ACPI_BIN_APP)   || \
+	(defined ACPI_SRC_APP)   || \
+	(defined ACPI_XTRACT_APP)
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#endif
+
+#ifdef ACPI_HELP_APP
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#define ACPI_NO_ERROR_MESSAGES
+#endif
+
+/* Linkable ACPICA library */
+
+#ifdef ACPI_LIBRARY
+#define ACPI_USE_LOCAL_CACHE
+#define ACPI_FUTURE_USAGE
+#endif
+
 /* Common for all ACPICA applications */
 #ifdef ACPI_APPLICATION
 #define ACPI_USE_SYSTEM_CLIBRARY
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 05/19] ACPICA: Cleanup indentation to reduce differences between Linux and ACPICA.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
  2012-12-19  5:36   ` [PATCH v2 01/19] ACPICA: Cleanup updated comments Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 03/19] ACPICA: Update codes under disabled build options Lv Zheng
@ 2012-12-19  5:37   ` Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 06/19] ACPICA: Cleanup coding style " Lv Zheng
                     ` (15 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:37 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 210 lines of 20121018 divergence.diff.

The ACPICA source codes uses a totally different indentation style from the
Linux to be compatible with other users (operating systems or BIOS).

Indentation differences are critical to the release automation. There are
two causes related to the "indentation" that are affecting the release
automation:
1. The ACPICA -> Linux release process is:
     ACPICA source -- acpisrc - hierarchy - indent ->
     linuxized ACPICA source -- diff ->
     linuxized ACPICA patch (x) -- human intervention ->
     linuxized ACPICA patch (o)
     Where
       'x' means "cannot be directly applied to the Linux"
       'o' means "can be directly applied to the Linux"
   Different "indent" version or "indent" options used in the "indent"
   step will lead to different divergences.
   The version of "indent" used for the current release process is:
     GNU indent 2.2.11
   The options of "indent" used for the current release process is:
     -npro -kr -i8 -ts8 -sob -l80 -ss -ncs
2. Manual indentation prettifying work in the Linux side will also harm the
   automatically generated linuxized ACPICA patches, making them impossible
   to apply directly.

This patch fixes source code differences caused by the two causes so that
the "human intervention" can be reduced in the future.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Binary comparision result:
  Changes can be found are caused by the line folding:
  -    5c1c:	68 e6 01 00 00       	push   $0x1e6
  +    5c1c:	68 e7 01 00 00       	push   $0x1e7
  evxface.c(487-1): acpi_install_fixed_event_handler
  ACPI_WARNING -> AE_INFO -> __LINE__
  -    5ca0:	68 23 02 00 00       	push   $0x223
  +    5ca0:	68 24 02 00 00       	push   $0x224
  evxface.c(548-2): acpi_remove_fixed_event_handler
  ACPI_WARNING -> AE_INFO -> __LINE__
  -    5f47:	6a 5b                	push   $0x5b
  +    5f47:	6a 5a                	push   $0x5a
  evxfevnt.c(90-1): acpi_enable
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    5f6a:	6a 65                	push   $0x65
  +    5f6a:	6a 64                	push   $0x64
  evxfevnt.c(100-1): acpi_enable
  ACPI_WARNING -> AE_INFO -> __LINE__
  -    5f98:	6a 6b                	push   $0x6b
  +    5f98:	6a 6a                	push   $0x6a
  evxfevnt.c(106): acpi_enable
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    5fce:	68 8c 00 00 00       	push   $0x8c
  +    5fce:	68 8b 00 00 00       	push   $0x8b
  evxfevnt.c(139): acpi_disable
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    6038:	68 c8 00 00 00       	push   $0xc8
  +    6038:	68 c7 00 00 00       	push   $0xc7
  evxfevnt.c(199-2): acpi_enable_event
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    60a1:	68 ff 00 00 00       	push   $0xff
  +    60a1:	68 fe 00 00 00       	push   $0xfe
  evxfevnt.c(254-2): acpi_disable_event
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    6352:	68 7a 01 00 00       	push   $0x17a
  +    6352:	68 7b 01 00 00       	push   $0x17b
  evxfgpe.c(379): acpi_set_gpe_wake_mask
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    64e0:	ba 59 02 00 00       	mov    $0x259,%edx
  +    64e0:	ba 5a 02 00 00       	mov    $0x25a,%edx
  evxfgpe.c(602): acpi_install_gpe_block
  acpi_ut_create_internal_object -> acpi_ut_create_internal_object_dbg ->
  __LINE__
  -    6a74:	68 1a 02 00 00       	push   $0x21a
  +    6a74:	68 19 02 00 00       	push   $0x219
  exconfig.c(537): acpi_ex_load_op
  ACPI_INFO -> AE_INFO -> __LINE__
  -    6c1e:	68 07 01 00 00       	push   $0x107
  +    6c1e:	68 06 01 00 00       	push   $0x106
  exconfig.c(262): acpi_ex_load_table_op
  ACPI_INFO -> AE_INFO -> __LINE__
  -    853f:	68 80 01 00 00       	push   $0x180
  +    853f:	68 81 01 00 00       	push   $0x181
  exmutex.c(385-2):  acpi_ex_release_mutex
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    858b:	68 8e 01 00 00       	push   $0x18e
  +    858b:	68 8f 01 00 00       	push   $0x18f
  exmutex.c(399-4):  acpi_ex_release_mutex
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    85c8:	68 9e 01 00 00       	push   $0x19e
  +    85c8:	68 9f 01 00 00       	push   $0x19f
  exmutex.c(415-4):  acpi_ex_release_mutex
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    934d:	68 d7 03 00 00       	push   $0x3d7
  +    934d:	68 d1 03 00 00       	push   $0x3d1
  exoparg1.c(977-3): acpi_ex_opcode_1A_0T_1R
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    9391:	68 f3 03 00 00       	push   $0x3f3
  +    9391:	68 ed 03 00 00       	push   $0x3ed
  exoparg1.c(1005-3): acpi_ex_opcode_1A_0T_1R
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    93b0:	68 fe 03 00 00       	push   $0x3fe
  +    93b0:	68 f8 03 00 00       	push   $0x3f8
  exoparg1.c(1016-1): acpi_ex_opcode_1A_0T_1R
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    a704:	68 b5 00 00 00       	push   $0xb5
  +    a704:	68 b4 00 00 00       	push   $0xb4
  exregion.c(180-3): acpi_ex_system_memory_space_handler
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    bb64:	6a 7b                	push   $0x7b
  +    bb64:	6a 7a                	push   $0x7a
  hwacpi.c(122-1): acpi_hw_set_mode
  ACPI_EXCEPTION -> AE_INFO -> __LINE__
  -    c35b:	68 a7 01 00 00       	push   $0x1a7
  +    c35b:	68 a6 01 00 00       	push   $0x1a6
  hwregs.c(422): acpi_hw_register_read
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    c440:	68 2f 02 00 00       	push   $0x22f
  +    c440:	68 2e 02 00 00       	push   $0x22e
  hwregs.c(558): acpi_hw_register_write
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    eb96:	68 23 01 00 00       	push   $0x123
  +    eb96:	68 24 01 00 00       	push   $0x124
  nsrepair2.c(292-4): acpi_ns_repair_FDE
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    edba:	68 b6 01 00 00       	push   $0x1b6
  +    edba:	68 b7 01 00 00       	push   $0x1b7
  nsrepair2.c(439-1): acpi_ns_repair_HID
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -    ef19:	68 4d 02 00 00       	push   $0x24d
  +    ef19:	68 4e 02 00 00       	push   $0x24e
  nsrepair2.c(590-3): acpi_ns_repair_PSS
  ACPI_WARN_PREDEFINED -> AE_INFO -> __LINE__
  -   12ebf:	68 f1 02 00 00       	push   $0x2f1
  +   12ebf:	68 f2 02 00 00       	push   $0x2f2
  rsmisc.c(754-1): acpi_rs_convert_resource_to_aml
  ACPI_ERROR -> AE_INFO -> __LINE__
  -   12ed9:	68 03 03 00 00       	push   $0x303
  +   12ed9:	68 04 03 00 00       	push   $0x304
  rsmisc.c(772): acpi_rs_convert_resource_to_aml
  ACPI_ERROR -> AE_INFO -> __LINE__
  -   131eb:	ba f2 02 00 00       	mov    $0x2f2,%edx
  +   131eb:	ba f4 02 00 00       	mov    $0x2f4,%edx
  rsutils.c(756): acpi_rs_set_srs_method_data
  acpi_ut_create_internal_object -> acpi_ut_create_internal_object_dbg ->
  __LINE__
---
Divergences fixing result:
  Before applying: 2561 Lines, 90.4 Kbytes
  After applying: 2351 Lines, 82.4 Kbytes
---
 drivers/acpi/acpica/aclocal.h   |    1 +
 drivers/acpi/acpica/evxface.c   |   13 +++++++------
 drivers/acpi/acpica/evxfevnt.c  |    1 -
 drivers/acpi/acpica/evxfgpe.c   |    1 +
 drivers/acpi/acpica/exconfig.c  |    1 -
 drivers/acpi/acpica/exmutex.c   |    1 +
 drivers/acpi/acpica/exoparg1.c  |    8 +-------
 drivers/acpi/acpica/exregion.c  |    9 ++++-----
 drivers/acpi/acpica/hwacpi.c    |    3 +--
 drivers/acpi/acpica/hwregs.c    |    3 +--
 drivers/acpi/acpica/nsrepair2.c |    3 ++-
 drivers/acpi/acpica/nsutils.c   |    6 +++---
 drivers/acpi/acpica/nsxfeval.c  |    2 ++
 drivers/acpi/acpica/psutils.c   |    2 +-
 drivers/acpi/acpica/rscreate.c  |    3 +--
 drivers/acpi/acpica/rsdump.c    |    3 ++-
 drivers/acpi/acpica/rsirq.c     |    6 ++----
 drivers/acpi/acpica/rsmemory.c  |    6 ++----
 drivers/acpi/acpica/rsmisc.c    |   11 ++++++-----
 drivers/acpi/acpica/rsutils.c   |    6 ++++--
 drivers/acpi/acpica/uteval.c    |    2 +-
 drivers/acpi/acpica/utglobal.c  |    1 +
 drivers/acpi/acpica/utresrc.c   |    7 +++----
 include/acpi/acpiosxf.h         |    4 +---
 include/acpi/acpixf.h           |    4 ++++
 include/acpi/actbl.h            |    1 -
 include/acpi/platform/acenv.h   |   13 ++++++++++++-
 include/acpi/platform/aclinux.h |    1 -
 28 files changed, 64 insertions(+), 58 deletions(-)

diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 421b048..5ce0693 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -678,6 +678,7 @@ struct acpi_opcode_info {
 };
 
 /* Value associated with the parse object */
+
 union acpi_parse_value {
 	u64 integer;		/* Integer constant (Up to 64 bits) */
 	u32 size;		/* bytelist or field size */
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 76cfe71..db82060 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -249,6 +249,7 @@ acpi_remove_notify_handler(acpi_handle device,
 	    (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) {
 		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
+
 	/* Make sure all deferred notify tasks are completed */
 
 	acpi_os_wait_events_complete();
@@ -622,12 +623,12 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 		goto free_and_exit;
 	}
 
-
 	handler->address = address;
 	handler->context = context;
 	handler->method_node = gpe_event_info->dispatch.method_node;
-	handler->original_flags = gpe_event_info->flags &
-			(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
+	handler->original_flags = (u8)(gpe_event_info->flags &
+				       (ACPI_GPE_XRUPT_TYPE_MASK |
+				        ACPI_GPE_DISPATCH_MASK));
 
 	/*
 	 * If the GPE is associated with a method, it may have been enabled
@@ -746,10 +747,10 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
 	 * enabled, it should be enabled at this point to restore the
 	 * post-initialization configuration.
 	 */
-
-	if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD)
-	    && handler->originally_enabled)
+	if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) &&
+	    handler->originally_enabled) {
 		(void)acpi_ev_add_gpe_reference(gpe_event_info);
+	}
 
 	/* Now we can free the handler object */
 
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index ee6e96c..be57f49 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -61,7 +61,6 @@ ACPI_MODULE_NAME("evxfevnt")
  * DESCRIPTION: Transfers the system into ACPI mode.
  *
  ******************************************************************************/
-
 acpi_status acpi_enable(void)
 {
 	acpi_status status;
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index d8095c1..36f8ad8 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -172,6 +172,7 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number)
 	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 	return_ACPI_STATUS(status);
 }
+
 ACPI_EXPORT_SYMBOL(acpi_disable_gpe)
 
 
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 9ad6420..b4f42f5 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -125,7 +125,6 @@ acpi_ex_add_table(u32 table_index,
 	 * responsible for discovering any new wake GPEs by running _PRW methods
 	 * that may have been loaded by this table.
 	 */
-
 	status = acpi_tb_get_owner_id(table_index, &owner_id);
 	if (ACPI_SUCCESS(status)) {
 		acpi_ev_update_gpes(owner_id);
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c
index 900a251..02157ef 100644
--- a/drivers/acpi/acpica/exmutex.c
+++ b/drivers/acpi/acpica/exmutex.c
@@ -378,6 +378,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 	}
 
 	/* Must have a valid thread ID */
+
 	if (!walk_state->thread) {
 		ACPI_ERROR((AE_INFO,
 			    "Cannot release Mutex [%4.4s], null thread info",
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index bbf01e9..cf50c6c 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -948,13 +948,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 					 */
 					return_desc =
 					    acpi_ut_create_integer_object((u64)
-									  temp_desc->
-									  buffer.
-									  pointer
-									  [operand
-									   [0]->
-									   reference.
-									   value]);
+									  temp_desc->buffer.pointer[operand[0]->reference.value]);
 					if (!return_desc) {
 						status = AE_NO_MEMORY;
 						goto cleanup;
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 044d441..06a4924 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -162,7 +162,6 @@ acpi_ex_system_memory_space_handler(u32 function,
 		 */
 		page_boundary_map_length =
 		    ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;
-
 		if (page_boundary_map_length == 0) {
 			page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
 		}
@@ -240,19 +239,19 @@ acpi_ex_system_memory_space_handler(u32 function,
 
 		switch (bit_width) {
 		case 8:
-			ACPI_SET8(logical_addr_ptr) = (u8) * value;
+			ACPI_SET8(logical_addr_ptr) = (u8)*value;
 			break;
 
 		case 16:
-			ACPI_SET16(logical_addr_ptr) = (u16) * value;
+			ACPI_SET16(logical_addr_ptr) = (u16)*value;
 			break;
 
 		case 32:
-			ACPI_SET32(logical_addr_ptr) = (u32) * value;
+			ACPI_SET32(logical_addr_ptr) = (u32)*value;
 			break;
 
 		case 64:
-			ACPI_SET64(logical_addr_ptr) = (u64) * value;
+			ACPI_SET64(logical_addr_ptr) = (u64)*value;
 			break;
 
 		default:
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c
index 90a9aea..effa2b0 100644
--- a/drivers/acpi/acpica/hwacpi.c
+++ b/drivers/acpi/acpica/hwacpi.c
@@ -108,8 +108,7 @@ acpi_status acpi_hw_set_mode(u32 mode)
 		 * enable bits to default
 		 */
 		status = acpi_hw_write_port(acpi_gbl_FADT.smi_command,
-					    (u32) acpi_gbl_FADT.acpi_disable,
-					    8);
+					    (u32)acpi_gbl_FADT.acpi_disable, 8);
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 				  "Attempting to enable Legacy (non-ACPI) mode\n"));
 		break;
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index e782b5a..fd4e2dc 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -363,8 +363,7 @@ acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control)
  * DESCRIPTION: Read from the specified ACPI register
  *
  ******************************************************************************/
-acpi_status
-acpi_hw_register_read(u32 register_id, u32 * return_value)
+acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value)
 {
 	u32 value = 0;
 	acpi_status status;
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 9018925..fdb818d 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -55,7 +55,8 @@ ACPI_MODULE_NAME("nsrepair2")
  */
 typedef
 acpi_status(*acpi_repair_function) (struct acpi_predefined_data *data,
-				    union acpi_operand_object **return_object_ptr);
+				    union acpi_operand_object
+				    **return_object_ptr);
 
 typedef struct acpi_repair_info {
 	char name[ACPI_NAME_SIZE];
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 479aad0..7e8bd2a 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -111,7 +111,7 @@ acpi_ns_print_node_pathname(struct acpi_namespace_node *node,
 u8 acpi_ns_valid_root_prefix(char prefix)
 {
 
-	return ((u8) (prefix == '\\'));
+	return ((u8)(prefix == '\\'));
 }
 
 /*******************************************************************************
@@ -129,7 +129,7 @@ u8 acpi_ns_valid_root_prefix(char prefix)
 static u8 acpi_ns_valid_path_separator(char sep)
 {
 
-	return ((u8) (sep == '.'));
+	return ((u8)(sep == '.'));
 }
 
 /*******************************************************************************
@@ -673,7 +673,7 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
 		return_UINT32(ACPI_NS_NORMAL);
 	}
 
-	return_UINT32(((u32) acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
+	return_UINT32(((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index 5c05ba3..a5d8ccc 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -606,7 +606,9 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 			for (i = 0; i < cid->count; i++) {
 				if (ACPI_STRCMP(cid->ids[i].string, info->hid)
 				    == 0) {
+
 					/* Found a matching CID */
+
 					found = TRUE;
 					break;
 				}
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index 4137dcb..afefb3a1 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -206,7 +206,7 @@ u8 acpi_ps_is_leading_char(u32 c)
  */
 u8 acpi_ps_is_prefix_char(u32 c)
 {
-	return ((u8) (c == '\\' || c == '^'));
+	return ((u8)(c == '\\' || c == '^'));
 }
 
 /*
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index 311cbc4..8133326 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -480,8 +480,7 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
 	status = acpi_rs_get_aml_length(linked_list_buffer, &aml_size_needed);
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
-			  (u32) aml_size_needed,
-			  acpi_format_exception(status)));
+			  (u32)aml_size_needed, acpi_format_exception(status)));
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index 4d11b072..276e52f 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -654,7 +654,8 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
 			/*
 			 * Optional resource_source for Address resources
 			 */
-			acpi_rs_dump_resource_source(ACPI_CAST_PTR(struct
+			acpi_rs_dump_resource_source(ACPI_CAST_PTR
+						     (struct
 								   acpi_resource_source,
 								   target));
 			break;
diff --git a/drivers/acpi/acpica/rsirq.c b/drivers/acpi/acpica/rsirq.c
index e23a9ec..a718eca 100644
--- a/drivers/acpi/acpica/rsirq.c
+++ b/drivers/acpi/acpica/rsirq.c
@@ -212,15 +212,13 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[9] = {
 
 	{ACPI_RSC_COUNT, ACPI_RS_OFFSET(data.extended_irq.interrupt_count),
 	 AML_OFFSET(extended_irq.interrupt_count),
-	 sizeof(u32)}
-	,
+	 sizeof(u32)},
 
 	/* Copy every IRQ in the table, each is 32 bits */
 
 	{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.extended_irq.interrupts[0]),
 	 AML_OFFSET(extended_irq.interrupts[0]),
-	 0}
-	,
+	 0},
 
 	/* Optional resource_source (Index and String) */
 
diff --git a/drivers/acpi/acpica/rsmemory.c b/drivers/acpi/acpica/rsmemory.c
index 4fd611a..d446103 100644
--- a/drivers/acpi/acpica/rsmemory.c
+++ b/drivers/acpi/acpica/rsmemory.c
@@ -156,8 +156,7 @@ struct acpi_rsconvert_info acpi_rs_get_vendor_small[3] = {
 
 	{ACPI_RSC_COUNT16, ACPI_RS_OFFSET(data.vendor.byte_length),
 	 0,
-	 sizeof(u8)}
-	,
+	 sizeof(u8)},
 
 	/* Vendor data */
 
@@ -181,8 +180,7 @@ struct acpi_rsconvert_info acpi_rs_get_vendor_large[3] = {
 
 	{ACPI_RSC_COUNT16, ACPI_RS_OFFSET(data.vendor.byte_length),
 	 0,
-	 sizeof(u8)}
-	,
+	 sizeof(u8)},
 
 	/* Vendor data */
 
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index c6f291c..3d0e15c 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -159,7 +159,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8) item_count;
+			ACPI_SET8(destination) = (u8)item_count;
 
 			resource->length = resource->length +
 			    (info->value * (item_count - 1));
@@ -385,7 +385,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			target = ACPI_ADD_PTR(char, resource, info->value);
-			ACPI_SET8(target) = (u8) item_count;
+			ACPI_SET8(target) = (u8)item_count;
 			break;
 
 		case ACPI_RSC_BITMASK16:
@@ -401,7 +401,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			target = ACPI_ADD_PTR(char, resource, info->value);
-			ACPI_SET8(target) = (u8) item_count;
+			ACPI_SET8(target) = (u8)item_count;
 			break;
 
 		case ACPI_RSC_EXIT_NE:
@@ -544,7 +544,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8) item_count;
+			ACPI_SET8(destination) = (u8)item_count;
 
 			aml_length =
 			    (u16) (aml_length +
@@ -686,7 +686,8 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			 * Optional resource_source (Index and String)
 			 */
 			aml_length =
-			    acpi_rs_set_resource_source(aml, (acpi_rs_length)
+			    acpi_rs_set_resource_source(aml,
+							(acpi_rs_length)
 							aml_length, source);
 			acpi_rs_set_resource_length(aml_length, aml);
 			break;
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 37d5241..441447f 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -358,8 +358,10 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length,
 		 *
 		 * Zero the entire area of the buffer.
 		 */
-		total_length = (u32)
-		ACPI_STRLEN(ACPI_CAST_PTR(char, &aml_resource_source[1])) + 1;
+		total_length =
+		    (u32)
+		    ACPI_STRLEN(ACPI_CAST_PTR(char, &aml_resource_source[1])) +
+		    1;
 		total_length = (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(total_length);
 
 		ACPI_MEMSET(resource_source->string_ptr, 0, total_length);
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index a9c65fb..45cddb8 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -68,7 +68,7 @@ ACPI_MODULE_NAME("uteval")
  ******************************************************************************/
 
 acpi_status
-acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
+acpi_ut_evaluate_object(struct acpi_namespace_node * prefix_node,
 			char *path,
 			u32 expected_return_btypes,
 			union acpi_operand_object **return_desc)
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 4080088..c083611 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -373,6 +373,7 @@ acpi_status acpi_ut_init_globals(void)
 }
 
 /* Public globals */
+
 ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
 ACPI_EXPORT_SYMBOL(acpi_dbg_level)
 ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index e38bef4..7d0a1b5 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -412,7 +412,7 @@ static const u8 acpi_gbl_resource_types[] = {
  ******************************************************************************/
 
 acpi_status
-acpi_ut_walk_aml_resources(u8 * aml,
+acpi_ut_walk_aml_resources(u8 *aml,
 			   acpi_size aml_length,
 			   acpi_walk_aml_callback user_function, void **context)
 {
@@ -525,7 +525,7 @@ acpi_ut_walk_aml_resources(u8 * aml,
  *
  ******************************************************************************/
 
-acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
+acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index)
 {
 	union aml_resource *aml_resource;
 	u8 resource_type;
@@ -800,8 +800,7 @@ u32 acpi_ut_get_descriptor_length(void *aml)
  ******************************************************************************/
 
 acpi_status
-acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc,
-			     u8 ** end_tag)
+acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, u8 **end_tag)
 {
 	acpi_status status;
 
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 33a3e17..dfcedc6 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -102,10 +102,8 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
 /*
  * Spinlock primitives
  */
-
 #ifndef acpi_os_create_lock
-acpi_status
-acpi_os_create_lock(acpi_spinlock *out_handle);
+acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
 #endif
 
 void acpi_os_delete_lock(acpi_spinlock handle);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index b409406..b77ee00 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -62,10 +62,14 @@ extern u32 acpi_current_gpe_count;
 extern struct acpi_table_fadt acpi_gbl_FADT;
 extern u8 acpi_gbl_system_awake_and_running;
 extern u8 acpi_gbl_reduced_hardware;	/* ACPI 5.0 */
+
 /* Runtime configuration of debug print levels */
+
 extern u32 acpi_dbg_level;
 extern u32 acpi_dbg_layer;
+
 /* ACPICA runtime options */
+
 extern u8 acpi_gbl_enable_interpreter_slack;
 extern u8 acpi_gbl_all_methods_serialized;
 extern u8 acpi_gbl_create_osi_method;
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index c0e6c32..ee050e8 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -357,7 +357,6 @@ struct acpi_table_desc {
 /*
  * Get the remaining ACPI tables
  */
-
 #include <acpi/actbl1.h>
 #include <acpi/actbl2.h>
 #include <acpi/actbl3.h>
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index cec6cd3..a74afaf 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -49,6 +49,7 @@
  * to the local environment. This includes compiler-specific, OS-specific,
  * and machine-specific configuration.
  */
+
 /* Types for ACPI_MUTEX_TYPE */
 
 #define ACPI_BINARY_SEMAPHORE       0
@@ -66,6 +67,7 @@
  *****************************************************************************/
 
 /* iASL configuration */
+
 #ifdef ACPI_ASL_COMPILER
 #define ACPI_APPLICATION
 #define ACPI_DISASSEMBLER
@@ -77,6 +79,7 @@
 #endif
 
 /* acpi_exec configuration. Multithreaded with full AML debugger */
+
 #ifdef ACPI_EXEC_APP
 #define ACPI_APPLICATION
 #define ACPI_FULL_DEBUG
@@ -117,12 +120,14 @@
 #endif
 
 /* Common for all ACPICA applications */
+
 #ifdef ACPI_APPLICATION
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_LOCAL_CACHE
 #endif
 
 /* Common debug support */
+
 #ifdef ACPI_FULL_DEBUG
 #define ACPI_DEBUGGER
 #define ACPI_DEBUG_OUTPUT
@@ -138,6 +143,7 @@
  * by the host files.
  *
  *****************************************************************************/
+
 #if defined(_LINUX) || defined(__linux__)
 #include <acpi/platform/aclinux.h>
 
@@ -294,7 +300,9 @@
 /* Use the standard C library headers. We want to keep these to a minimum. */
 
 #ifdef ACPI_USE_STANDARD_HEADERS
+
 /* Use the standard headers from the standard locations */
+
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
@@ -303,6 +311,7 @@
 #endif				/* ACPI_USE_STANDARD_HEADERS */
 
 /* We will be linking to the standard Clib functions */
+
 #define ACPI_STRSTR(s1,s2)      strstr((s1), (s2))
 #define ACPI_STRCHR(s1,c)       strchr((s1), (c))
 #define ACPI_STRLEN(s)          (acpi_size) strlen((s))
@@ -340,7 +349,6 @@
  * implementation provided by a native C library, but they are functionally
  * equivalent.
  */
-
 #ifndef va_arg
 
 #ifndef _VALIST
@@ -349,10 +357,12 @@ typedef char *va_list;
 #endif				/* _VALIST */
 
 /* Storage alignment properties */
+
 #define  _AUPBND                (sizeof (acpi_native_int) - 1)
 #define  _ADNBND                (sizeof (acpi_native_int) - 1)
 
 /* Variable argument list macro definitions */
+
 #define _bnd(X, bnd)            (((sizeof (X)) + (bnd)) & (~(bnd)))
 #define va_arg(ap, T)           (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
 #define va_end(ap)              (ap = (va_list) NULL)
@@ -361,6 +371,7 @@ typedef char *va_list;
 #endif				/* va_arg */
 
 /* Use the local (ACPICA) definitions of the clib functions */
+
 #define ACPI_STRSTR(s1,s2)      acpi_ut_strstr ((s1), (s2))
 #define ACPI_STRCHR(s1,c)       acpi_ut_strchr ((s1), (c))
 #define ACPI_STRLEN(s)          (acpi_size) acpi_ut_strlen ((s))
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 85d5d8f..33d05b0 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -108,7 +108,6 @@
 
 #include <acpi/platform/acgcc.h>
 
-
 #ifdef __KERNEL__
 #include <acpi/actypes.h>
 /*
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 06/19] ACPICA: Cleanup coding style to reduce differences between Linux and ACPICA.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (2 preceding siblings ...)
  2012-12-19  5:37   ` [PATCH v2 05/19] ACPICA: Cleanup indentation to reduce differences between Linux and ACPICA Lv Zheng
@ 2012-12-19  5:37   ` Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 07/19] ACPICA: Fix broken call depth tracing logic Lv Zheng
                     ` (14 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:37 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 314 lines of 20121018 divergence.diff.

ACPICA core uses ()'s on return statements. This is a known and committed
differences from Linux standard coding style.

This patch cleans up the Linux side ACPICA code to use this codying style
in order to reduce the source code differences between Linux and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Binary comparision result:
  Changes can be found are caused by the line folding:
  -    be3a:	68 88 00 00 00       	push   $0x88
  +    be3a:	68 8a 00 00 00       	push   $0x8a
  hwgpe.c(138): acpi_hw_low_set_gpe
  ACPI_ERROR -> AE_INFO -> __LINE__
---
Divergences fixing result:
  Before applying: 2351 Lines, 82.4 Kbytes
  After applying: 2037 Lines, 72.3 Kbytes
---
 drivers/acpi/acpica/exconfig.c |    4 ++--
 drivers/acpi/acpica/hwgpe.c    |    6 ++++--
 drivers/acpi/acpica/hwvalid.c  |   18 +++++++++---------
 drivers/acpi/acpica/nspredef.c |    2 +-
 drivers/acpi/acpica/nswalk.c   |    4 ++--
 drivers/acpi/acpica/nsxfname.c |   14 +++++++-------
 drivers/acpi/acpica/rscalc.c   |    2 +-
 drivers/acpi/acpica/rsutils.c  |    2 +-
 drivers/acpi/acpica/tbutils.c  |    2 +-
 drivers/acpi/acpica/utcopy.c   |    4 ++--
 drivers/acpi/acpica/utlock.c   |   14 +++++++-------
 11 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index b4f42f5..d0cc2a4 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -304,7 +304,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer)
 		    acpi_ev_address_space_dispatch(obj_desc, NULL, ACPI_READ,
 						   region_offset, 8, &value);
 		if (ACPI_FAILURE(status)) {
-			return status;
+			return (status);
 		}
 
 		*buffer = (u8)value;
@@ -312,7 +312,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer)
 		region_offset++;
 	}
 
-	return AE_OK;
+	return (AE_OK);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 6456004..095666b 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -69,8 +69,10 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 
 u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info)
 {
-	return (u32)1 << (gpe_event_info->gpe_number -
-		 gpe_event_info->register_info->base_gpe_number);
+
+	return ((u32)1 <<
+		(gpe_event_info->gpe_number -
+		 gpe_event_info->register_info->base_gpe_number));
 }
 
 /******************************************************************************
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
index b6aae58..70686cd 100644
--- a/drivers/acpi/acpica/hwvalid.c
+++ b/drivers/acpi/acpica/hwvalid.c
@@ -135,7 +135,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
 	if ((bit_width != 8) && (bit_width != 16) && (bit_width != 32)) {
 		ACPI_ERROR((AE_INFO,
 			    "Bad BitWidth parameter: %8.8X", bit_width));
-		return AE_BAD_PARAMETER;
+		return (AE_BAD_PARAMETER);
 	}
 
 	port_info = acpi_protected_ports;
@@ -234,11 +234,11 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
 	status = acpi_hw_validate_io_request(address, width);
 	if (ACPI_SUCCESS(status)) {
 		status = acpi_os_read_port(address, value, width);
-		return status;
+		return (status);
 	}
 
 	if (status != AE_AML_ILLEGAL_ADDRESS) {
-		return status;
+		return (status);
 	}
 
 	/*
@@ -253,7 +253,7 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
 		if (acpi_hw_validate_io_request(address, 8) == AE_OK) {
 			status = acpi_os_read_port(address, &one_byte, 8);
 			if (ACPI_FAILURE(status)) {
-				return status;
+				return (status);
 			}
 
 			*value |= (one_byte << i);
@@ -262,7 +262,7 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
 		address++;
 	}
 
-	return AE_OK;
+	return (AE_OK);
 }
 
 /******************************************************************************
@@ -297,11 +297,11 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width)
 	status = acpi_hw_validate_io_request(address, width);
 	if (ACPI_SUCCESS(status)) {
 		status = acpi_os_write_port(address, value, width);
-		return status;
+		return (status);
 	}
 
 	if (status != AE_AML_ILLEGAL_ADDRESS) {
-		return status;
+		return (status);
 	}
 
 	/*
@@ -317,12 +317,12 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width)
 			status =
 			    acpi_os_write_port(address, (value >> i) & 0xFF, 8);
 			if (ACPI_FAILURE(status)) {
-				return status;
+				return (status);
 			}
 		}
 
 		address++;
 	}
 
-	return AE_OK;
+	return (AE_OK);
 }
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 352be3b..1f0e934 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -147,7 +147,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
 
 	pathname = acpi_ns_get_external_pathname(node);
 	if (!pathname) {
-		return AE_OK;	/* Could not get pathname, ignore */
+		return (AE_OK);	/* Could not get pathname, ignore */
 	}
 
 	/*
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index 0483877..4657e75 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -76,12 +76,12 @@ struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node
 
 		/* It's really the parent's _scope_ that we want */
 
-		return parent_node->child;
+		return (parent_node->child);
 	}
 
 	/* Otherwise just return the next peer */
 
-	return child_node->peer;
+	return (child_node->peer);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 811c6f1..520bab4 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -539,14 +539,14 @@ acpi_status acpi_install_method(u8 *buffer)
 	/* Parameter validation */
 
 	if (!buffer) {
-		return AE_BAD_PARAMETER;
+		return (AE_BAD_PARAMETER);
 	}
 
 	/* Table must be a DSDT or SSDT */
 
 	if (!ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) &&
 	    !ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT)) {
-		return AE_BAD_HEADER;
+		return (AE_BAD_HEADER);
 	}
 
 	/* First AML opcode in the table must be a control method */
@@ -554,7 +554,7 @@ acpi_status acpi_install_method(u8 *buffer)
 	parser_state.aml = buffer + sizeof(struct acpi_table_header);
 	opcode = acpi_ps_peek_opcode(&parser_state);
 	if (opcode != AML_METHOD_OP) {
-		return AE_BAD_PARAMETER;
+		return (AE_BAD_PARAMETER);
 	}
 
 	/* Extract method information from the raw AML */
@@ -572,13 +572,13 @@ acpi_status acpi_install_method(u8 *buffer)
 	 */
 	aml_buffer = ACPI_ALLOCATE(aml_length);
 	if (!aml_buffer) {
-		return AE_NO_MEMORY;
+		return (AE_NO_MEMORY);
 	}
 
 	method_obj = acpi_ut_create_internal_object(ACPI_TYPE_METHOD);
 	if (!method_obj) {
 		ACPI_FREE(aml_buffer);
-		return AE_NO_MEMORY;
+		return (AE_NO_MEMORY);
 	}
 
 	/* Lock namespace for acpi_ns_lookup, we may be creating a new node */
@@ -644,12 +644,12 @@ acpi_status acpi_install_method(u8 *buffer)
 	/* Remove local reference to the method object */
 
 	acpi_ut_remove_reference(method_obj);
-	return status;
+	return (status);
 
 error_exit:
 
 	ACPI_FREE(aml_buffer);
 	ACPI_FREE(method_obj);
-	return status;
+	return (status);
 }
 ACPI_EXPORT_SYMBOL(acpi_install_method)
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index 147feb6..4f39bd6 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -84,7 +84,7 @@ static u8 acpi_rs_count_set_bits(u16 bit_field)
 		bit_field &= (u16) (bit_field - 1);
 	}
 
-	return bits_set;
+	return (bits_set);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 441447f..5adae5a 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -108,7 +108,7 @@ u16 acpi_rs_encode_bitmask(u8 * list, u8 count)
 		mask |= (0x1 << list[i]);
 	}
 
-	return mask;
+	return (mask);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 285e24b..e3cc315 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -147,7 +147,7 @@ acpi_status acpi_tb_initialize_facs(void)
 					 ACPI_CAST_INDIRECT_PTR(struct
 								acpi_table_header,
 								&acpi_gbl_FACS));
-	return status;
+	return (status);
 }
 #endif				/* !ACPI_REDUCED_HARDWARE */
 
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index 294692a..99549ee 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -785,7 +785,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
 
 		status = acpi_os_create_mutex(&dest_desc->mutex.os_mutex);
 		if (ACPI_FAILURE(status)) {
-			return status;
+			return (status);
 		}
 		break;
 
@@ -795,7 +795,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
 						  &dest_desc->event.
 						  os_semaphore);
 		if (ACPI_FAILURE(status)) {
-			return status;
+			return (status);
 		}
 		break;
 
diff --git a/drivers/acpi/acpica/utlock.c b/drivers/acpi/acpica/utlock.c
index b1eb7f1..8d1a749 100644
--- a/drivers/acpi/acpica/utlock.c
+++ b/drivers/acpi/acpica/utlock.c
@@ -66,11 +66,11 @@ acpi_status acpi_ut_create_rw_lock(struct acpi_rw_lock *lock)
 	lock->num_readers = 0;
 	status = acpi_os_create_mutex(&lock->reader_mutex);
 	if (ACPI_FAILURE(status)) {
-		return status;
+		return (status);
 	}
 
 	status = acpi_os_create_mutex(&lock->writer_mutex);
-	return status;
+	return (status);
 }
 
 void acpi_ut_delete_rw_lock(struct acpi_rw_lock *lock)
@@ -108,7 +108,7 @@ acpi_status acpi_ut_acquire_read_lock(struct acpi_rw_lock *lock)
 
 	status = acpi_os_acquire_mutex(lock->reader_mutex, ACPI_WAIT_FOREVER);
 	if (ACPI_FAILURE(status)) {
-		return status;
+		return (status);
 	}
 
 	/* Acquire the write lock only for the first reader */
@@ -121,7 +121,7 @@ acpi_status acpi_ut_acquire_read_lock(struct acpi_rw_lock *lock)
 	}
 
 	acpi_os_release_mutex(lock->reader_mutex);
-	return status;
+	return (status);
 }
 
 acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock)
@@ -130,7 +130,7 @@ acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock)
 
 	status = acpi_os_acquire_mutex(lock->reader_mutex, ACPI_WAIT_FOREVER);
 	if (ACPI_FAILURE(status)) {
-		return status;
+		return (status);
 	}
 
 	/* Release the write lock only for the very last reader */
@@ -141,7 +141,7 @@ acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock)
 	}
 
 	acpi_os_release_mutex(lock->reader_mutex);
-	return status;
+	return (status);
 }
 
 /*******************************************************************************
@@ -165,7 +165,7 @@ acpi_status acpi_ut_acquire_write_lock(struct acpi_rw_lock *lock)
 	acpi_status status;
 
 	status = acpi_os_acquire_mutex(lock->writer_mutex, ACPI_WAIT_FOREVER);
-	return status;
+	return (status);
 }
 
 void acpi_ut_release_write_lock(struct acpi_rw_lock *lock)
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 07/19] ACPICA: Fix broken call depth tracing logic.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (3 preceding siblings ...)
  2012-12-19  5:37   ` [PATCH v2 06/19] ACPICA: Cleanup coding style " Lv Zheng
@ 2012-12-19  5:37   ` Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 09/19] ACPICA: Update initialization codes Lv Zheng
                     ` (13 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:37 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This patch does not affect the generation of the Linux binary.
This patch decreases 26 lines of 20121018 divergence.diff.

The ACPICA uses a call depth tracing mechanism by wrapping the return
statements with return macros and marking the entrance with
ACPI_FUNCTION_TRACE_ macros. There are other ACPI_FUNCTION_ macros used
to mark the functions not using this tracing mechanism.

This patch fixes broken call depth tracing logic.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Binary comparision result:
  Changes can be found are caused by the line folding:
  -    7f64:	68 5e 01 00 00       	push   $0x15e
  +    7f64:	68 5d 01 00 00       	push   $0x15d
  exfldio.c(349-3): acpi_ex_field_datum_io
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    7fa2:	68 23 02 00 00       	push   $0x223
  +    7fa2:	68 22 02 00 00       	push   $0x222
  exfldio.c(546-1): acpi_ex_field_datum_io
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    801d:	68 c8 02 00 00       	push   $0x2c8
  +    801d:	68 c7 02 00 00       	push   $0x2c7
  exfldio.c(711-2): acpi_ex_extract_from_field
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    82d9:	68 8e 02 00 00       	push   $0x28e
  +    82d9:	68 8d 02 00 00       	push   $0x28d
  exfldio.c(653-4): acpi_ex_write_with_update_rule
  ACPI_ERROR -> AE_INFO -> __LINE__
---
Divergences fixing result:
  Before applying: 2037 Lines, 72.3 Kbytes
  After applying: 2011 Lines, 71.6 Kbytes
---
 drivers/acpi/acpica/exfldio.c  |    1 -
 drivers/acpi/acpica/nsxfeval.c |    4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index aa2ccfb..2c2146c 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -329,7 +329,6 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
 static u8
 acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value)
 {
-	ACPI_FUNCTION_NAME(ex_register_overflow);
 
 	if (obj_desc->common_field.bit_length >= ACPI_INTEGER_BIT_SIZE) {
 		/*
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index a5d8ccc..ef29925 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -492,7 +492,7 @@ acpi_walk_namespace(acpi_object_type type,
 	 */
 	status = acpi_ut_acquire_read_lock(&acpi_gbl_namespace_rw_lock);
 	if (ACPI_FAILURE(status)) {
-		return status;
+		return_ACPI_STATUS(status);
 	}
 
 	/*
@@ -550,7 +550,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 
 	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
 	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
+		return (status);
 	}
 
 	node = acpi_ns_validate_handle(obj_handle);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 09/19] ACPICA: Update initialization codes.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (4 preceding siblings ...)
  2012-12-19  5:37   ` [PATCH v2 07/19] ACPICA: Fix broken call depth tracing logic Lv Zheng
@ 2012-12-19  5:37   ` Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 10/19] ACPICA: Fix possible memory leak Lv Zheng
                     ` (12 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:37 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This patch decreases 18 lines of 20121018 divergence.diff.

This patch updates initialization codes as they are already been updated in
ACPICA. This can also help to reduce source code differences between Linux
and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Divergences fixing result:
  Before applying: 1982 Lines, 70.5 Kbytes
  After applying: 1964 Lines, 70.0 Kbytes
---
 drivers/acpi/acpica/utglobal.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index c083611..7b4dd21 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -293,11 +293,11 @@ acpi_status acpi_ut_init_globals(void)
 
 	/* GPE support */
 
+	acpi_gbl_all_gpes_initialized = FALSE;
 	acpi_gbl_gpe_xrupt_list_head = NULL;
 	acpi_gbl_gpe_fadt_blocks[0] = NULL;
 	acpi_gbl_gpe_fadt_blocks[1] = NULL;
 	acpi_current_gpe_count = 0;
-	acpi_gbl_all_gpes_initialized = FALSE;
 
 	acpi_gbl_global_event_handler = NULL;
 
@@ -367,6 +367,7 @@ acpi_status acpi_ut_init_globals(void)
 
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 	acpi_gbl_display_final_mem_stats = FALSE;
+	acpi_gbl_disable_mem_tracking = FALSE;
 #endif
 
 	return_ACPI_STATUS(AE_OK);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 10/19] ACPICA: Fix possible memory leak.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (5 preceding siblings ...)
  2012-12-19  5:37   ` [PATCH v2 09/19] ACPICA: Update initialization codes Lv Zheng
@ 2012-12-19  5:37   ` Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 11/19] ACPICA: Performance enhancement for ACPI package objects Lv Zheng
                     ` (11 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:37 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Jesper Juhl, Bob Moore, Lv Zheng

From: Jesper Juhl <jj@chaosbits.net>

Ensure cleanup after a memory allocation failure in dsmethod.c.
Original Linux change from Jesper Juhl.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/dsmethod.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 735c059..54c968a 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -378,7 +378,8 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 	 */
 	info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
 	if (!info) {
-		return_ACPI_STATUS(AE_NO_MEMORY);
+		status = AE_NO_MEMORY;
+		goto cleanup;
 	}
 
 	info->parameters = &this_walk_state->operands[0];
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 11/19] ACPICA: Performance enhancement for ACPI package objects.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (6 preceding siblings ...)
  2012-12-19  5:37   ` [PATCH v2 10/19] ACPICA: Fix possible memory leak Lv Zheng
@ 2012-12-19  5:37   ` Lv Zheng
  2012-12-19  5:37   ` [PATCH v2 12/19] ACPICA: Performance: Remove function tracing from critical allocation functions Lv Zheng
                     ` (10 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:37 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Chao Guan, Bob Moore, Lv Zheng

From: Chao Guan <chao.guan@intel.com>

This change greatly increases the performance of package objects
within the interpreter. It changes the processing of reference
counts for packages by optimizing for the most common case where
the package subobjects are either integers, strings, or buffers.
Increases the performance of the ASLTS test suite by 1.5X.
Chao Guan. ACPICA BZ 943.
https://www.acpica.org/bugzilla/show_bug.cgi?id=943

Signed-off-by: Chao Guan <chao.guan@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/utdelete.c |   42 +++++++++++++++++++++++++++++++---------
 1 file changed, 33 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index 7981054..e806fb0 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -530,18 +530,42 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 			 */
 			for (i = 0; i < object->package.count; i++) {
 				/*
-				 * Push each element onto the stack for later processing.
-				 * Note: There can be null elements within the package,
-				 * these are simply ignored
+				 * Null package elements are legal and can be simply
+				 * ignored.
 				 */
-				status =
-				    acpi_ut_create_update_state_and_push
-				    (object->package.elements[i], action,
-				     &state_list);
-				if (ACPI_FAILURE(status)) {
-					goto error_exit;
+				next_object = object->package.elements[i];
+				if (!next_object) {
+					continue;
+				}
+
+				switch (next_object->common.type) {
+				case ACPI_TYPE_INTEGER:
+				case ACPI_TYPE_STRING:
+				case ACPI_TYPE_BUFFER:
+					/*
+					 * For these very simple sub-objects, we can just
+					 * update the reference count here and continue.
+					 * Greatly increases performance of this operation.
+					 */
+					acpi_ut_update_ref_count(next_object,
+								 action);
+					break;
+
+				default:
+					/*
+					 * For complex sub-objects, push them onto the stack
+					 * for later processing (this eliminates recursion.)
+					 */
+					status =
+					    acpi_ut_create_update_state_and_push
+					    (next_object, action, &state_list);
+					if (ACPI_FAILURE(status)) {
+						goto error_exit;
+					}
+					break;
 				}
 			}
+			next_object = NULL;
 			break;
 
 		case ACPI_TYPE_BUFFER_FIELD:
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 12/19] ACPICA: Performance: Remove function tracing from critical allocation functions.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (7 preceding siblings ...)
  2012-12-19  5:37   ` [PATCH v2 11/19] ACPICA: Performance enhancement for ACPI package objects Lv Zheng
@ 2012-12-19  5:37   ` Lv Zheng
  2012-12-19  5:38   ` [PATCH v2 13/19] ACPICA: Debugger: Major update for the Disassemble<method> command Lv Zheng
                     ` (9 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:37 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

Tracing is no longer needed for many of the low-level function.
Removing the trace mechanism from these functions improves
performance a small amount, also simplifies the debug trace output.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/nsutils.c  |    8 ++++----
 drivers/acpi/acpica/utdelete.c |   26 +++++++++++++-------------
 drivers/acpi/acpica/utstate.c  |   40 ++++++++++++++++++----------------------
 drivers/acpi/acpica/uttrack.c  |   16 ++++++++--------
 4 files changed, 43 insertions(+), 47 deletions(-)

diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 7e8bd2a..4479654 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -663,17 +663,17 @@ void acpi_ns_terminate(void)
 
 u32 acpi_ns_opens_scope(acpi_object_type type)
 {
-	ACPI_FUNCTION_TRACE_STR(ns_opens_scope, acpi_ut_get_type_name(type));
+	ACPI_FUNCTION_ENTRY();
 
-	if (!acpi_ut_valid_object_type(type)) {
+	if (type > ACPI_TYPE_LOCAL_MAX) {
 
 		/* type code out of range  */
 
 		ACPI_WARNING((AE_INFO, "Invalid Object Type 0x%X", type));
-		return_UINT32(ACPI_NS_NORMAL);
+		return (ACPI_NS_NORMAL);
 	}
 
-	return_UINT32(((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
+	return (((u32)acpi_gbl_ns_properties[type]) & ACPI_NS_NEWSCOPE);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index e806fb0..53e6af8 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -340,7 +340,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list)
 {
 	union acpi_operand_object **internal_obj;
 
-	ACPI_FUNCTION_TRACE(ut_delete_internal_object_list);
+	ACPI_FUNCTION_NAME(ut_delete_internal_object_list);
 
 	/* Walk the null-terminated internal list */
 
@@ -351,7 +351,7 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list)
 	/* Free the combined parameter pointer list and object array */
 
 	ACPI_FREE(obj_list);
-	return_VOID;
+	return;
 }
 
 /*******************************************************************************
@@ -484,7 +484,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 	union acpi_generic_state *state;
 	u32 i;
 
-	ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object);
+	ACPI_FUNCTION_NAME(ut_update_object_reference);
 
 	while (object) {
 
@@ -493,7 +493,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 		if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) {
 			ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
 					  "Object %p is NS handle\n", object));
-			return_ACPI_STATUS(AE_OK);
+			return (AE_OK);
 		}
 
 		/*
@@ -643,7 +643,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 		}
 	}
 
-	return_ACPI_STATUS(AE_OK);
+	return (AE_OK);
 
       error_exit:
 
@@ -657,7 +657,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 		acpi_ut_delete_generic_state(state);
 	}
 
-	return_ACPI_STATUS(status);
+	return (status);
 }
 
 /*******************************************************************************
@@ -676,12 +676,12 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 void acpi_ut_add_reference(union acpi_operand_object *object)
 {
 
-	ACPI_FUNCTION_TRACE_PTR(ut_add_reference, object);
+	ACPI_FUNCTION_NAME(ut_add_reference);
 
 	/* Ensure that we have a valid object */
 
 	if (!acpi_ut_valid_internal_object(object)) {
-		return_VOID;
+		return;
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
@@ -691,7 +691,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object)
 	/* Increment the reference count */
 
 	(void)acpi_ut_update_object_reference(object, REF_INCREMENT);
-	return_VOID;
+	return;
 }
 
 /*******************************************************************************
@@ -709,7 +709,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object)
 void acpi_ut_remove_reference(union acpi_operand_object *object)
 {
 
-	ACPI_FUNCTION_TRACE_PTR(ut_remove_reference, object);
+	ACPI_FUNCTION_NAME(ut_remove_reference);
 
 	/*
 	 * Allow a NULL pointer to be passed in, just ignore it. This saves
@@ -718,13 +718,13 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
 	 */
 	if (!object ||
 	    (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED)) {
-		return_VOID;
+		return;
 	}
 
 	/* Ensure that we have a valid object */
 
 	if (!acpi_ut_valid_internal_object(object)) {
-		return_VOID;
+		return;
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
@@ -737,5 +737,5 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
 	 * of all subobjects!)
 	 */
 	(void)acpi_ut_update_object_reference(object, REF_DECREMENT);
-	return_VOID;
+	return;
 }
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c
index cee0473..26a0c23 100644
--- a/drivers/acpi/acpica/utstate.c
+++ b/drivers/acpi/acpica/utstate.c
@@ -97,14 +97,13 @@ void
 acpi_ut_push_generic_state(union acpi_generic_state **list_head,
 			   union acpi_generic_state *state)
 {
-	ACPI_FUNCTION_TRACE(ut_push_generic_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Push the state object onto the front of the list (stack) */
 
 	state->common.next = *list_head;
 	*list_head = state;
-
-	return_VOID;
+	return;
 }
 
 /*******************************************************************************
@@ -124,7 +123,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE(ut_pop_generic_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Remove the state object at the head of the list (stack) */
 
@@ -136,7 +135,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
 		*list_head = state->common.next;
 	}
 
-	return_PTR(state);
+	return (state);
 }
 
 /*******************************************************************************
@@ -186,13 +185,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE(ut_create_thread_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Create the generic state object */
 
 	state = acpi_ut_create_generic_state();
 	if (!state) {
-		return_PTR(NULL);
+		return (NULL);
 	}
 
 	/* Init fields specific to the update struct */
@@ -207,7 +206,7 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
 		state->thread.thread_id = (acpi_thread_id) 1;
 	}
 
-	return_PTR((struct acpi_thread_state *)state);
+	return ((struct acpi_thread_state *)state);
 }
 
 /*******************************************************************************
@@ -230,13 +229,13 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE_PTR(ut_create_update_state, object);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Create the generic state object */
 
 	state = acpi_ut_create_generic_state();
 	if (!state) {
-		return_PTR(NULL);
+		return (NULL);
 	}
 
 	/* Init fields specific to the update struct */
@@ -244,8 +243,7 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
 	state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE;
 	state->update.object = object;
 	state->update.value = action;
-
-	return_PTR(state);
+	return (state);
 }
 
 /*******************************************************************************
@@ -267,13 +265,13 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE_PTR(ut_create_pkg_state, internal_object);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Create the generic state object */
 
 	state = acpi_ut_create_generic_state();
 	if (!state) {
-		return_PTR(NULL);
+		return (NULL);
 	}
 
 	/* Init fields specific to the update struct */
@@ -283,8 +281,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
 	state->pkg.dest_object = external_object;
 	state->pkg.index = index;
 	state->pkg.num_packages = 1;
-
-	return_PTR(state);
+	return (state);
 }
 
 /*******************************************************************************
@@ -304,21 +301,20 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
 {
 	union acpi_generic_state *state;
 
-	ACPI_FUNCTION_TRACE(ut_create_control_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Create the generic state object */
 
 	state = acpi_ut_create_generic_state();
 	if (!state) {
-		return_PTR(NULL);
+		return (NULL);
 	}
 
 	/* Init fields specific to the control struct */
 
 	state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
 	state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
-
-	return_PTR(state);
+	return (state);
 }
 
 /*******************************************************************************
@@ -336,12 +332,12 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
 
 void acpi_ut_delete_generic_state(union acpi_generic_state *state)
 {
-	ACPI_FUNCTION_TRACE(ut_delete_generic_state);
+	ACPI_FUNCTION_ENTRY();
 
 	/* Ignore null state */
 
 	if (state) {
 		(void)acpi_os_release_object(acpi_gbl_state_cache, state);
 	}
-	return_VOID;
+	return;
 }
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index a424a9e..866f96e 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -436,10 +436,10 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
 	struct acpi_memory_list *mem_list;
 	acpi_status status;
 
-	ACPI_FUNCTION_TRACE(ut_remove_allocation);
+	ACPI_FUNCTION_NAME(ut_remove_allocation);
 
 	if (acpi_gbl_disable_mem_tracking) {
-		return_ACPI_STATUS(AE_OK);
+		return (AE_OK);
 	}
 
 	mem_list = acpi_gbl_global_list;
@@ -450,12 +450,12 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
 		ACPI_ERROR((module, line,
 			    "Empty allocation list, nothing to free!"));
 
-		return_ACPI_STATUS(AE_OK);
+		return (AE_OK);
 	}
 
 	status = acpi_ut_acquire_mutex(ACPI_MTX_MEMORY);
 	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
+		return (status);
 	}
 
 	/* Unlink */
@@ -470,15 +470,15 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
 		(allocation->next)->previous = allocation->previous;
 	}
 
+	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing %p, size 0%X\n",
+			  &allocation->user_space, allocation->size));
+
 	/* Mark the segment as deleted */
 
 	ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size);
 
-	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
-			  allocation->size));
-
 	status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
-	return_ACPI_STATUS(status);
+	return (status);
 }
 
 /*******************************************************************************
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 13/19] ACPICA: Debugger: Major update for the Disassemble<method> command.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (8 preceding siblings ...)
  2012-12-19  5:37   ` [PATCH v2 12/19] ACPICA: Performance: Remove function tracing from critical allocation functions Lv Zheng
@ 2012-12-19  5:38   ` Lv Zheng
  2012-12-19  5:38   ` [PATCH v2 14/19] ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags Lv Zheng
                     ` (8 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:38 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

This command was downreved and did not properly disassemble control
methods with any reasonable complexity. This fix brings the command
up to the same level as the rest of the disassembler.  Adds one
new file, dmdeferred.c, which is existing code that is now common
with the main disassembler and the debugger disassembl command.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acutils.h  |    7 ++--
 drivers/acpi/acpica/rscalc.c   |    4 ++-
 drivers/acpi/acpica/rscreate.c |    4 +--
 drivers/acpi/acpica/rslist.c   |    7 ++--
 drivers/acpi/acpica/utresrc.c  |   74 +++++++++++++++++++++-------------------
 5 files changed, 52 insertions(+), 44 deletions(-)

diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index b0f5f92..6e51d193 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -535,12 +535,15 @@ acpi_ut_display_init_pathname(u8 type,
  * utresrc
  */
 acpi_status
-acpi_ut_walk_aml_resources(u8 *aml,
+acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
+			   u8 *aml,
 			   acpi_size aml_length,
 			   acpi_walk_aml_callback user_function,
 			   void **context);
 
-acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index);
+acpi_status
+acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
+			  void *aml, u8 *return_index);
 
 u32 acpi_ut_get_descriptor_length(void *aml);
 
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index 4f39bd6..da178b4 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -407,7 +407,9 @@ acpi_rs_get_list_length(u8 * aml_buffer,
 
 		/* Validate the Resource Type and Resource Length */
 
-		status = acpi_ut_validate_resource(aml_buffer, &resource_index);
+		status =
+		    acpi_ut_validate_resource(NULL, aml_buffer,
+					      &resource_index);
 		if (ACPI_FAILURE(status)) {
 			/*
 			 * Exit on failure. Cannot continue because the descriptor length
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index 8133326..55e0908 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -98,7 +98,7 @@ acpi_buffer_to_resource(u8 *aml_buffer,
 
 	/* Perform the AML-to-Resource conversion */
 
-	status = acpi_ut_walk_aml_resources(aml_buffer, aml_buffer_length,
+	status = acpi_ut_walk_aml_resources(NULL, aml_buffer, aml_buffer_length,
 					    acpi_rs_convert_aml_to_resources,
 					    &current_resource_ptr);
 	if (status == AE_AML_NO_RESOURCE_END_TAG) {
@@ -174,7 +174,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
 	/* Do the conversion */
 
 	resource = output_buffer->pointer;
-	status = acpi_ut_walk_aml_resources(aml_start, aml_buffer_length,
+	status = acpi_ut_walk_aml_resources(NULL, aml_start, aml_buffer_length,
 					    acpi_rs_convert_aml_to_resources,
 					    &resource);
 	if (ACPI_FAILURE(status)) {
diff --git a/drivers/acpi/acpica/rslist.c b/drivers/acpi/acpica/rslist.c
index 8b64db9..83e6158 100644
--- a/drivers/acpi/acpica/rslist.c
+++ b/drivers/acpi/acpica/rslist.c
@@ -217,9 +217,10 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
 
 		/* Perform final sanity check on the new AML resource descriptor */
 
-		status =
-		    acpi_ut_validate_resource(ACPI_CAST_PTR
-					      (union aml_resource, aml), NULL);
+		status = acpi_ut_validate_resource(NULL,
+						   ACPI_CAST_PTR(union
+								 aml_resource,
+								 aml), NULL);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index 7d0a1b5..546ea73 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -383,26 +383,16 @@ static const u8 acpi_gbl_resource_types[] = {
 	ACPI_VARIABLE_LENGTH	/* 0E *serial_bus */
 };
 
-/*
- * For the iASL compiler/disassembler, we don't want any error messages
- * because the disassembler uses the resource validation code to determine
- * if Buffer objects are actually Resource Templates.
- */
-#ifdef ACPI_ASL_COMPILER
-#define ACPI_RESOURCE_ERROR(plist)
-#else
-#define ACPI_RESOURCE_ERROR(plist)  ACPI_ERROR(plist)
-#endif
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_walk_aml_resources
  *
- * PARAMETERS:  aml             - Pointer to the raw AML resource template
- *              aml_length      - Length of the entire template
- *              user_function   - Called once for each descriptor found. If
- *                                NULL, a pointer to the end_tag is returned
- *              context         - Passed to user_function
+ * PARAMETERS:  walk_state          - Current walk info
+ * PARAMETERS:  aml                 - Pointer to the raw AML resource template
+ *              aml_length          - Length of the entire template
+ *              user_function       - Called once for each descriptor found. If
+ *                                    NULL, a pointer to the end_tag is returned
+ *              context             - Passed to user_function
  *
  * RETURN:      Status
  *
@@ -412,7 +402,8 @@ static const u8 acpi_gbl_resource_types[] = {
  ******************************************************************************/
 
 acpi_status
-acpi_ut_walk_aml_resources(u8 *aml,
+acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
+			   u8 *aml,
 			   acpi_size aml_length,
 			   acpi_walk_aml_callback user_function, void **context)
 {
@@ -441,7 +432,8 @@ acpi_ut_walk_aml_resources(u8 *aml,
 
 		/* Validate the Resource Type and Resource Length */
 
-		status = acpi_ut_validate_resource(aml, &resource_index);
+		status =
+		    acpi_ut_validate_resource(walk_state, aml, &resource_index);
 		if (ACPI_FAILURE(status)) {
 			/*
 			 * Exit on failure. Cannot continue because the descriptor length
@@ -498,7 +490,8 @@ acpi_ut_walk_aml_resources(u8 *aml,
 
 		/* Insert an end_tag anyway. acpi_rs_get_list_length always leaves room */
 
-		(void)acpi_ut_validate_resource(end_tag, &resource_index);
+		(void)acpi_ut_validate_resource(walk_state, end_tag,
+						&resource_index);
 		status =
 		    user_function(end_tag, 2, offset, resource_index, context);
 		if (ACPI_FAILURE(status)) {
@@ -513,9 +506,10 @@ acpi_ut_walk_aml_resources(u8 *aml,
  *
  * FUNCTION:    acpi_ut_validate_resource
  *
- * PARAMETERS:  aml             - Pointer to the raw AML resource descriptor
- *              return_index    - Where the resource index is returned. NULL
- *                                if the index is not required.
+ * PARAMETERS:  walk_state          - Current walk info
+ *              aml                 - Pointer to the raw AML resource descriptor
+ *              return_index        - Where the resource index is returned. NULL
+ *                                    if the index is not required.
  *
  * RETURN:      Status, and optionally the Index into the global resource tables
  *
@@ -525,7 +519,9 @@ acpi_ut_walk_aml_resources(u8 *aml,
  *
  ******************************************************************************/
 
-acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index)
+acpi_status
+acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
+			  void *aml, u8 *return_index)
 {
 	union aml_resource *aml_resource;
 	u8 resource_type;
@@ -627,10 +623,12 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index)
 		if ((aml_resource->common_serial_bus.type == 0) ||
 		    (aml_resource->common_serial_bus.type >
 		     AML_RESOURCE_MAX_SERIALBUSTYPE)) {
-			ACPI_RESOURCE_ERROR((AE_INFO,
-					     "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
-					     aml_resource->common_serial_bus.
-					     type));
+			if (walk_state) {
+				ACPI_ERROR((AE_INFO,
+					    "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
+					    aml_resource->common_serial_bus.
+					    type));
+			}
 			return (AE_AML_INVALID_RESOURCE_TYPE);
 		}
 	}
@@ -645,18 +643,22 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 *return_index)
 
       invalid_resource:
 
-	ACPI_RESOURCE_ERROR((AE_INFO,
-			     "Invalid/unsupported resource descriptor: Type 0x%2.2X",
-			     resource_type));
+	if (walk_state) {
+		ACPI_ERROR((AE_INFO,
+			    "Invalid/unsupported resource descriptor: Type 0x%2.2X",
+			    resource_type));
+	}
 	return (AE_AML_INVALID_RESOURCE_TYPE);
 
       bad_resource_length:
 
-	ACPI_RESOURCE_ERROR((AE_INFO,
-			     "Invalid resource descriptor length: Type "
-			     "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
-			     resource_type, resource_length,
-			     minimum_resource_length));
+	if (walk_state) {
+		ACPI_ERROR((AE_INFO,
+			    "Invalid resource descriptor length: Type "
+			    "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
+			    resource_type, resource_length,
+			    minimum_resource_length));
+	}
 	return (AE_AML_BAD_RESOURCE_LENGTH);
 }
 
@@ -815,7 +817,7 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, u8 **end_tag)
 
 	/* Validate the template and get a pointer to the end_tag */
 
-	status = acpi_ut_walk_aml_resources(obj_desc->buffer.pointer,
+	status = acpi_ut_walk_aml_resources(NULL, obj_desc->buffer.pointer,
 					    obj_desc->buffer.length, NULL,
 					    (void **)end_tag);
 
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 14/19] ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (9 preceding siblings ...)
  2012-12-19  5:38   ` [PATCH v2 13/19] ACPICA: Debugger: Major update for the Disassemble<method> command Lv Zheng
@ 2012-12-19  5:38   ` Lv Zheng
  2012-12-19  5:38   ` [PATCH v2 15/19] ACPICA: Add macros to extract flag bits from resource descriptors Lv Zheng
                     ` (7 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:38 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

This changes adds the ShareAndWake and ExclusiveAndWake flags which
were added to the Irq, Interrupt, and Gpio resource descriptors
in ACPI 5.0.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/rsdump.c  |    6 +++---
 drivers/acpi/acpica/utresrc.c |    4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index 276e52f..0b7381f 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -98,7 +98,7 @@ struct acpi_rsdump_info acpi_rs_dump_irq[7] = {
 	 acpi_gbl_he_decode},
 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity",
 	 acpi_gbl_ll_decode},
-	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing",
+	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing",
 	 acpi_gbl_shr_decode},
 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count),
 	 "Interrupt Count", NULL},
@@ -287,7 +287,7 @@ struct acpi_rsdump_info acpi_rs_dump_ext_irq[8] = {
 	 "Triggering", acpi_gbl_he_decode},
 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity",
 	 acpi_gbl_ll_decode},
-	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.sharable), "Sharing",
+	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(extended_irq.sharable), "Sharing",
 	 acpi_gbl_shr_decode},
 	{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL,
 	 NULL},
@@ -320,7 +320,7 @@ struct acpi_rsdump_info acpi_rs_dump_gpio[16] = {
 	 "ProducerConsumer", acpi_gbl_consume_decode},
 	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig",
 	 acpi_gbl_ppc_decode},
-	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharable",
+	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharing",
 	 acpi_gbl_shr_decode},
 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction),
 	 "IoRestriction", acpi_gbl_ior_decode},
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index 546ea73..8f8eab9 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -127,7 +127,9 @@ const char *acpi_gbl_rw_decode[] = {
 
 const char *acpi_gbl_shr_decode[] = {
 	"Exclusive",
-	"Shared"
+	"Shared",
+	"ExclusiveAndWake",	/* ACPI 5.0 */
+	"SharedAndWake"		/* ACPI 5.0 */
 };
 
 const char *acpi_gbl_siz_decode[] = {
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 15/19] ACPICA: Add macros to extract flag bits from resource descriptors.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (10 preceding siblings ...)
  2012-12-19  5:38   ` [PATCH v2 14/19] ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags Lv Zheng
@ 2012-12-19  5:38   ` Lv Zheng
  2012-12-19  5:38   ` [PATCH v2 16/19] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros Lv Zheng
                     ` (6 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:38 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

Improves readability and maintainability of the code.  Fixes a
problem with the UART serial bus descriptor for the number of
data bits flags (was incorrectly 2 bits, should be 3).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acmacros.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 5efad99..1fa91f1 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -293,6 +293,20 @@
 #define ACPI_16BIT_MASK     0x0000FFFF
 #define ACPI_24BIT_MASK     0x00FFFFFF
 
+/* Macros to extract flag bits from position zero */
+
+#define ACPI_GET_1BIT_FLAG(value)                   ((value) & ACPI_1BIT_MASK)
+#define ACPI_GET_2BIT_FLAG(value)                   ((value) & ACPI_2BIT_MASK)
+#define ACPI_GET_3BIT_FLAG(value)                   ((value) & ACPI_3BIT_MASK)
+#define ACPI_GET_4BIT_FLAG(value)                   ((value) & ACPI_4BIT_MASK)
+
+/* Macros to extract flag bits from position one and above */
+
+#define ACPI_EXTRACT_1BIT_FLAG(field, position)     (ACPI_GET_1BIT_FLAG ((field) >> position))
+#define ACPI_EXTRACT_2BIT_FLAG(field, position)     (ACPI_GET_2BIT_FLAG ((field) >> position))
+#define ACPI_EXTRACT_3BIT_FLAG(field, position)     (ACPI_GET_3BIT_FLAG ((field) >> position))
+#define ACPI_EXTRACT_4BIT_FLAG(field, position)     (ACPI_GET_4BIT_FLAG ((field) >> position))
+
 /*
  * An object of type struct acpi_namespace_node can appear in some contexts
  * where a pointer to an object of type union acpi_operand_object can also
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 16/19] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (11 preceding siblings ...)
  2012-12-19  5:38   ` [PATCH v2 15/19] ACPICA: Add macros to extract flag bits from resource descriptors Lv Zheng
@ 2012-12-19  5:38   ` Lv Zheng
  2012-12-19  5:38   ` [PATCH v2 17/19] ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE Lv Zheng
                     ` (5 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:38 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng, Bob Moore

Improve the implementation of the macros.  Change the SETx macros
to the style of (destination, source).  Also add ACPI_CASTx
companion macros.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acmacros.h |   20 ++++++-----
 drivers/acpi/acpica/exregion.c |    8 ++---
 drivers/acpi/acpica/rsmisc.c   |   71 +++++++++++++++++++++-------------------
 3 files changed, 54 insertions(+), 45 deletions(-)

diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 1fa91f1..3ba11d2 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -49,14 +49,18 @@
  * get into potential aligment issues -- see the STORE macros below.
  * Use with care.
  */
-#define ACPI_GET8(ptr)                  *ACPI_CAST_PTR (u8, ptr)
-#define ACPI_GET16(ptr)                 *ACPI_CAST_PTR (u16, ptr)
-#define ACPI_GET32(ptr)                 *ACPI_CAST_PTR (u32, ptr)
-#define ACPI_GET64(ptr)                 *ACPI_CAST_PTR (u64, ptr)
-#define ACPI_SET8(ptr)                  *ACPI_CAST_PTR (u8, ptr)
-#define ACPI_SET16(ptr)                 *ACPI_CAST_PTR (u16, ptr)
-#define ACPI_SET32(ptr)                 *ACPI_CAST_PTR (u32, ptr)
-#define ACPI_SET64(ptr)                 *ACPI_CAST_PTR (u64, ptr)
+#define ACPI_CAST8(ptr)                 ACPI_CAST_PTR (u8, (ptr))
+#define ACPI_CAST16(ptr)                ACPI_CAST_PTR (u16, (ptr))
+#define ACPI_CAST32(ptr)                ACPI_CAST_PTR (u32, (ptr))
+#define ACPI_CAST64(ptr)                ACPI_CAST_PTR (u64, (ptr))
+#define ACPI_GET8(ptr)                  (*ACPI_CAST8 (ptr))
+#define ACPI_GET16(ptr)                 (*ACPI_CAST16 (ptr))
+#define ACPI_GET32(ptr)                 (*ACPI_CAST32 (ptr))
+#define ACPI_GET64(ptr)                 (*ACPI_CAST64 (ptr))
+#define ACPI_SET8(ptr, val)             (*ACPI_CAST8 (ptr) = (u8) (val))
+#define ACPI_SET16(ptr, val)            (*ACPI_CAST16 (ptr) = (u16) (val))
+#define ACPI_SET32(ptr, val)            (*ACPI_CAST32 (ptr) = (u32) (val))
+#define ACPI_SET64(ptr, val)            (*ACPI_CAST64 (ptr) = (u64) (val))
 
 /*
  * printf() format helpers
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 06a4924..28d3cd9 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -239,19 +239,19 @@ acpi_ex_system_memory_space_handler(u32 function,
 
 		switch (bit_width) {
 		case 8:
-			ACPI_SET8(logical_addr_ptr) = (u8)*value;
+			ACPI_SET8(logical_addr_ptr, *value);
 			break;
 
 		case 16:
-			ACPI_SET16(logical_addr_ptr) = (u16)*value;
+			ACPI_SET16(logical_addr_ptr, *value);
 			break;
 
 		case 32:
-			ACPI_SET32(logical_addr_ptr) = (u32)*value;
+			ACPI_SET32(logical_addr_ptr, *value);
 			break;
 
 		case 64:
-			ACPI_SET64(logical_addr_ptr) = (u64)*value;
+			ACPI_SET64(logical_addr_ptr, *value);
 			break;
 
 		default:
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index 3d0e15c..7b094eb 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -136,30 +136,30 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			/*
 			 * Mask and shift the flag bit
 			 */
-			ACPI_SET8(destination) = (u8)
-			    ((ACPI_GET8(source) >> info->value) & 0x01);
+			ACPI_SET8(destination,
+				  ((ACPI_GET8(source) >> info->value) & 0x01));
 			break;
 
 		case ACPI_RSC_2BITFLAG:
 			/*
 			 * Mask and shift the flag bits
 			 */
-			ACPI_SET8(destination) = (u8)
-			    ((ACPI_GET8(source) >> info->value) & 0x03);
+			ACPI_SET8(destination,
+				  ((ACPI_GET8(source) >> info->value) & 0x03));
 			break;
 
 		case ACPI_RSC_3BITFLAG:
 			/*
 			 * Mask and shift the flag bits
 			 */
-			ACPI_SET8(destination) = (u8)
-			    ((ACPI_GET8(source) >> info->value) & 0x07);
+			ACPI_SET8(destination,
+				  ((ACPI_GET8(source) >> info->value) & 0x07));
 			break;
 
 		case ACPI_RSC_COUNT:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8)item_count;
+			ACPI_SET8(destination, item_count);
 
 			resource->length = resource->length +
 			    (info->value * (item_count - 1));
@@ -168,7 +168,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT16:
 
 			item_count = aml_resource_length;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 
 			resource->length = resource->length +
 			    (info->value * (item_count - 1));
@@ -181,13 +181,13 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 
 			resource->length = resource->length + item_count;
 			item_count = item_count / 2;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 			break;
 
 		case ACPI_RSC_COUNT_GPIO_VEN:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8)item_count;
+			ACPI_SET8(destination, item_count);
 
 			resource->length = resource->length +
 			    (info->value * item_count);
@@ -216,7 +216,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			resource->length = resource->length + item_count;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 			break;
 
 		case ACPI_RSC_COUNT_SERIAL_VEN:
@@ -224,7 +224,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			item_count = ACPI_GET16(source) - info->value;
 
 			resource->length = resource->length + item_count;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 			break;
 
 		case ACPI_RSC_COUNT_SERIAL_RES:
@@ -234,7 +234,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			    - ACPI_GET16(source) - info->value;
 
 			resource->length = resource->length + item_count;
-			ACPI_SET16(destination) = item_count;
+			ACPI_SET16(destination, item_count);
 			break;
 
 		case ACPI_RSC_LENGTH:
@@ -385,7 +385,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			target = ACPI_ADD_PTR(char, resource, info->value);
-			ACPI_SET8(target) = (u8)item_count;
+			ACPI_SET8(target, item_count);
 			break;
 
 		case ACPI_RSC_BITMASK16:
@@ -401,7 +401,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			}
 
 			target = ACPI_ADD_PTR(char, resource, info->value);
-			ACPI_SET8(target) = (u8)item_count;
+			ACPI_SET8(target, item_count);
 			break;
 
 		case ACPI_RSC_EXIT_NE:
@@ -514,37 +514,40 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/*
 			 * Clear the flag byte
 			 */
-			ACPI_SET8(destination) = 0;
+			ACPI_SET8(destination, 0);
 			break;
 
 		case ACPI_RSC_1BITFLAG:
 			/*
 			 * Mask and shift the flag bit
 			 */
-			ACPI_SET8(destination) |= (u8)
-			    ((ACPI_GET8(source) & 0x01) << info->value);
+			ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
+				     ((ACPI_GET8(source) & 0x01) << info->
+				      value));
 			break;
 
 		case ACPI_RSC_2BITFLAG:
 			/*
 			 * Mask and shift the flag bits
 			 */
-			ACPI_SET8(destination) |= (u8)
-			    ((ACPI_GET8(source) & 0x03) << info->value);
+			ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
+				     ((ACPI_GET8(source) & 0x03) << info->
+				      value));
 			break;
 
 		case ACPI_RSC_3BITFLAG:
 			/*
 			 * Mask and shift the flag bits
 			 */
-			ACPI_SET8(destination) |= (u8)
-			    ((ACPI_GET8(source) & 0x07) << info->value);
+			ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
+				     ((ACPI_GET8(source) & 0x07) << info->
+				      value));
 			break;
 
 		case ACPI_RSC_COUNT:
 
 			item_count = ACPI_GET8(source);
-			ACPI_SET8(destination) = (u8)item_count;
+			ACPI_SET8(destination, item_count);
 
 			aml_length =
 			    (u16) (aml_length +
@@ -561,18 +564,18 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT_GPIO_PIN:
 
 			item_count = ACPI_GET16(source);
-			ACPI_SET16(destination) = (u16)aml_length;
+			ACPI_SET16(destination, aml_length);
 
 			aml_length = (u16)(aml_length + item_count * 2);
 			target = ACPI_ADD_PTR(void, aml, info->value);
-			ACPI_SET16(target) = (u16)aml_length;
+			ACPI_SET16(target, aml_length);
 			acpi_rs_set_resource_length(aml_length, aml);
 			break;
 
 		case ACPI_RSC_COUNT_GPIO_VEN:
 
 			item_count = ACPI_GET16(source);
-			ACPI_SET16(destination) = (u16)item_count;
+			ACPI_SET16(destination, item_count);
 
 			aml_length =
 			    (u16)(aml_length + (info->value * item_count));
@@ -584,7 +587,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/* Set resource source string length */
 
 			item_count = ACPI_GET16(source);
-			ACPI_SET16(destination) = (u16)aml_length;
+			ACPI_SET16(destination, aml_length);
 
 			/* Compute offset for the Vendor Data */
 
@@ -594,7 +597,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/* Set vendor offset only if there is vendor data */
 
 			if (resource->data.gpio.vendor_length) {
-				ACPI_SET16(target) = (u16)aml_length;
+				ACPI_SET16(target, aml_length);
 			}
 
 			acpi_rs_set_resource_length(aml_length, aml);
@@ -603,7 +606,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 		case ACPI_RSC_COUNT_SERIAL_VEN:
 
 			item_count = ACPI_GET16(source);
-			ACPI_SET16(destination) = item_count + info->value;
+			ACPI_SET16(destination, item_count + info->value);
 			aml_length = (u16)(aml_length + item_count);
 			acpi_rs_set_resource_length(aml_length, aml);
 			break;
@@ -707,10 +710,12 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/*
 			 * 8-bit encoded bitmask (DMA macro)
 			 */
-			ACPI_SET8(destination) = (u8)
-			    acpi_rs_encode_bitmask(source,
-						   *ACPI_ADD_PTR(u8, resource,
-								 info->value));
+			ACPI_SET8(destination,
+				  acpi_rs_encode_bitmask(source,
+							 *ACPI_ADD_PTR(u8,
+								       resource,
+								       info->
+								       value)));
 			break;
 
 		case ACPI_RSC_BITMASK16:
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 17/19] ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (12 preceding siblings ...)
  2012-12-19  5:38   ` [PATCH v2 16/19] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros Lv Zheng
@ 2012-12-19  5:38   ` Lv Zheng
  2012-12-19  5:38   ` [PATCH v2 18/19] ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure Lv Zheng
                     ` (4 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:38 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng, Bob Moore

Cleanup the ACPI_NEXT_RESOURCE macro.  Update AcpiWalkResources
to use ACPI_NEXT_RESOURCE.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/rsxface.c |    4 +---
 include/acpi/acrestyp.h       |    5 ++++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c
index 5aad744..3a5ace7 100644
--- a/drivers/acpi/acpica/rsxface.c
+++ b/drivers/acpi/acpica/rsxface.c
@@ -606,9 +606,7 @@ acpi_walk_resources(acpi_handle device_handle,
 
 		/* Get the next resource descriptor */
 
-		resource =
-		    ACPI_ADD_PTR(struct acpi_resource, resource,
-				 resource->length);
+		resource = ACPI_NEXT_RESOURCE(resource);
 	}
 
 	ACPI_FREE(buffer.pointer);
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index 40349ae..17f2d05 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -591,7 +591,10 @@ struct acpi_resource {
 #define ACPI_RS_SIZE_MIN                    (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
 #define ACPI_RS_SIZE(type)                  (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
 
-#define ACPI_NEXT_RESOURCE(res)             (struct acpi_resource *)((u8 *) res + res->length)
+/* Macro for walking resource templates with multiple descriptors */
+
+#define ACPI_NEXT_RESOURCE(res) \
+	ACPI_ADD_PTR (struct acpi_resource, (res), (res)->length)
 
 struct acpi_pci_routing_table {
 	u32 length;
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [PATCH v2 18/19] ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (13 preceding siblings ...)
  2012-12-19  5:38   ` [PATCH v2 17/19] ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE Lv Zheng
@ 2012-12-19  5:38   ` Lv Zheng
  2012-12-20  1:07   ` [RESEND PATCH v2 02/19] ACPICA: Update compilation environment settings Lv Zheng
                     ` (3 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-19  5:38 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

No need for a goto to the bottom of the function, simply return
the status code immediately.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/nsxfname.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 520bab4..a8deae8 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -290,7 +290,7 @@ acpi_get_object_info(acpi_handle handle,
 
 	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
 	if (ACPI_FAILURE(status)) {
-		goto cleanup;
+		return (status);
 	}
 
 	node = acpi_ns_validate_handle(handle);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [RESEND PATCH v2 00/19] ACPICA 20121114 Release
  2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
                   ` (15 preceding siblings ...)
  2012-11-22  0:15 ` [PATCH 00/15] ACPICA 20121114 Release Rafael J. Wysocki
@ 2012-12-20  1:06 ` Lv Zheng
  2012-12-19  5:36   ` [PATCH v2 01/19] ACPICA: Cleanup updated comments Lv Zheng
                     ` (18 more replies)
  16 siblings, 19 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-20  1:06 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

Resend [PATCH v2 02, 04, 08, 19] along with this cover letter as they are
not appearing in the community due to MDA issues.

The 20121114 ACPICA linuxized patches are based on the pm/linux-next branch.

The patch 10-19 are 20121114 ACPICA release patches while the 01-09 are
patches to reduce the source code differences between Linux and ACPICA so
that the release process can be easier with less human intervention and
the known bugs can also be prevented.
A QA process is executed to compare resulting binary files. Those patches
which were not expected to change any text section indeed, changed no text.
Sometimes line numbers changed due to line deletions and insertions, but
that is expected.
The source code differences between Linux and ACPICA can be summarized as
follows:
1. 3978 Lines (138.4 Kbytes) before applying the patch set;
2. 1964 Lines (70.0 Kbytes) after applying the patch set.

Please review.

Bob Moore (6):
  ACPICA: Performance: Remove function tracing from critical allocation
    functions.
  ACPICA: Debugger: Major update for the Disassemble<method> command.
  ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags.
  ACPICA: Add macros to extract flag bits from resource descriptors.
  ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure.
  ACPICA: Update version to 20121114.

Chao Guan (1):
  ACPICA: Performance enhancement for ACPI package objects.

Jesper Juhl (1):
  ACPICA: Fix possible memory leak.

Lv Zheng (11):
  ACPICA: Cleanup updated comments.
  ACPICA: Update compilation environment settings.
  ACPICA: Update codes under disabled build options.
  ACPICA: Cleanup source to reduce differences between Linux and
    ACPICA.
  ACPICA: Cleanup indentation to reduce differences between Linux and
    ACPICA.
  ACPICA: Cleanup coding style to reduce differences between Linux and
    ACPICA.
  ACPICA: Fix broken call depth tracing logic.
  ACPICA: Enhance error messages.
  ACPICA: Update initialization codes.
  ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros.
  ACPICA: Resource Manager: update template walking with
    ACPI_NEXT_RESOURCE.

 arch/ia64/include/asm/acpi.h    |    4 -
 arch/x86/include/asm/acpi.h     |    4 -
 drivers/acpi/acpica/accommon.h  |    1 +
 drivers/acpi/acpica/acglobal.h  |   35 +++--
 drivers/acpi/acpica/aclocal.h   |   45 ++++--
 drivers/acpi/acpica/acmacros.h  |   34 ++++-
 drivers/acpi/acpica/acobject.h  |    2 +-
 drivers/acpi/acpica/acpredef.h  |   14 +-
 drivers/acpi/acpica/acutils.h   |    7 +-
 drivers/acpi/acpica/amlresrc.h  |    6 +
 drivers/acpi/acpica/dsmethod.c  |    5 +-
 drivers/acpi/acpica/dsobject.c  |    2 +-
 drivers/acpi/acpica/dsopcode.c  |   14 +-
 drivers/acpi/acpica/dswload.c   |    5 +-
 drivers/acpi/acpica/evgpe.c     |    6 +-
 drivers/acpi/acpica/evxface.c   |   34 ++---
 drivers/acpi/acpica/evxfevnt.c  |    5 +-
 drivers/acpi/acpica/evxfgpe.c   |    9 +-
 drivers/acpi/acpica/exconfig.c  |   13 +-
 drivers/acpi/acpica/exfldio.c   |    1 -
 drivers/acpi/acpica/exmutex.c   |    3 +-
 drivers/acpi/acpica/exoparg1.c  |    8 +-
 drivers/acpi/acpica/exregion.c  |   23 +--
 drivers/acpi/acpica/hwacpi.c    |    3 +-
 drivers/acpi/acpica/hwesleep.c  |    1 -
 drivers/acpi/acpica/hwgpe.c     |    6 +-
 drivers/acpi/acpica/hwregs.c    |    6 +-
 drivers/acpi/acpica/hwsleep.c   |    4 +-
 drivers/acpi/acpica/hwvalid.c   |   18 +--
 drivers/acpi/acpica/hwxface.c   |   10 +-
 drivers/acpi/acpica/hwxfsleep.c |    9 +-
 drivers/acpi/acpica/nsdump.c    |    4 +-
 drivers/acpi/acpica/nsdumpdv.c  |    1 -
 drivers/acpi/acpica/nsinit.c    |    6 -
 drivers/acpi/acpica/nsnames.c   |    3 +-
 drivers/acpi/acpica/nspredef.c  |    3 +-
 drivers/acpi/acpica/nsrepair2.c |    3 +-
 drivers/acpi/acpica/nssearch.c  |    5 +
 drivers/acpi/acpica/nsutils.c   |   13 +-
 drivers/acpi/acpica/nswalk.c    |    4 +-
 drivers/acpi/acpica/nsxfeval.c  |   15 +-
 drivers/acpi/acpica/nsxfname.c  |   16 +-
 drivers/acpi/acpica/psutils.c   |    2 +-
 drivers/acpi/acpica/rscalc.c    |    6 +-
 drivers/acpi/acpica/rscreate.c  |    7 +-
 drivers/acpi/acpica/rsdump.c    |    9 +-
 drivers/acpi/acpica/rsirq.c     |    6 +-
 drivers/acpi/acpica/rslist.c    |    7 +-
 drivers/acpi/acpica/rsmemory.c  |    6 +-
 drivers/acpi/acpica/rsmisc.c    |   74 ++++-----
 drivers/acpi/acpica/rsutils.c   |    8 +-
 drivers/acpi/acpica/rsxface.c   |    4 +-
 drivers/acpi/acpica/tbfadt.c    |    5 +-
 drivers/acpi/acpica/tbutils.c   |    2 +-
 drivers/acpi/acpica/tbxface.c   |    1 -
 drivers/acpi/acpica/utcopy.c    |    4 +-
 drivers/acpi/acpica/utdelete.c  |   68 ++++++---
 drivers/acpi/acpica/uteval.c    |    2 +-
 drivers/acpi/acpica/utglobal.c  |    9 +-
 drivers/acpi/acpica/utlock.c    |   14 +-
 drivers/acpi/acpica/utmisc.c    |    8 +-
 drivers/acpi/acpica/utobject.c  |    2 +-
 drivers/acpi/acpica/utresrc.c   |   81 +++++-----
 drivers/acpi/acpica/utstate.c   |   40 +++--
 drivers/acpi/acpica/uttrack.c   |   16 +-
 drivers/acpi/acpica/utxface.c   |    4 -
 drivers/acpi/acpica/utxferror.c |    4 +-
 include/acpi/acconfig.h         |   24 +--
 include/acpi/acoutput.h         |    1 +
 include/acpi/acpiosxf.h         |   11 +-
 include/acpi/acpixf.h           |   57 +++----
 include/acpi/acrestyp.h         |    5 +-
 include/acpi/actbl.h            |    7 +-
 include/acpi/actbl1.h           |    6 +-
 include/acpi/actypes.h          |    9 +-
 include/acpi/platform/acenv.h   |  317 ++++++++++++++++++++-------------------
 include/acpi/platform/acgcc.h   |    4 -
 include/acpi/platform/aclinux.h |    1 -
 78 files changed, 664 insertions(+), 577 deletions(-)

-- 
1.7.10


^ permalink raw reply	[flat|nested] 53+ messages in thread

* [RESEND PATCH v2 02/19] ACPICA: Update compilation environment settings.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (14 preceding siblings ...)
  2012-12-19  5:38   ` [PATCH v2 18/19] ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure Lv Zheng
@ 2012-12-20  1:07   ` Lv Zheng
  2012-12-20  1:07   ` [RESEND PATCH v2 04/19] ACPICA: Cleanup source to reduce differences between Linux and ACPICA Lv Zheng
                     ` (2 subsequent siblings)
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-20  1:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This patch does not affect the generation of the Linux binary.
This patch decreases 300 lines of 20121018 divergence.diff.

This patch updates architecture specific environment settings for compiling
ACPICA as such enhancement already has been done in ACPICA.

Note that the appended compiler default settings in the
<acpi/platform/acenv.h> will deprecate some of the macros defined in the
architecture specific <asm/acpi.h>. Thus two of the <asm/acpi.h> headers
have been cleaned up in this patch accordingly.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Binary comparision result:
  No changes can be found.
---
Divergences fixing result:
  Before applying: 3420 Lines, 115.8 Kbytes
  After applying: 3120 Lines, 107.7 Kbytes
---
 arch/ia64/include/asm/acpi.h  |    4 -
 arch/x86/include/asm/acpi.h   |    4 -
 include/acpi/platform/acenv.h |  217 +++++++++++++++++++----------------------
 include/acpi/platform/acgcc.h |    4 -
 4 files changed, 102 insertions(+), 127 deletions(-)

diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
index 301609c..cd0746c 100644
--- a/arch/ia64/include/asm/acpi.h
+++ b/arch/ia64/include/asm/acpi.h
@@ -52,10 +52,6 @@
 
 /* Asm macros */
 
-#define ACPI_ASM_MACROS
-#define BREAKPOINT3
-#define ACPI_DISABLE_IRQS() local_irq_disable()
-#define ACPI_ENABLE_IRQS()  local_irq_enable()
 #define ACPI_FLUSH_CPU_CACHE()
 
 static inline int
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 0c44630..b31bf97 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -49,10 +49,6 @@
 
 /* Asm macros */
 
-#define ACPI_ASM_MACROS
-#define BREAKPOINT3
-#define ACPI_DISABLE_IRQS() local_irq_disable()
-#define ACPI_ENABLE_IRQS()  local_irq_enable()
 #define ACPI_FLUSH_CPU_CACHE()	wbinvd()
 
 int __acpi_acquire_global_lock(unsigned int *lock);
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index e3409b6..68a58a1 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -44,6 +44,11 @@
 #ifndef __ACENV_H__
 #define __ACENV_H__
 
+/*
+ * Environment configuration. The purpose of this file is to interface ACPICA
+ * to the local environment. This includes compiler-specific, OS-specific,
+ * and machine-specific configuration.
+ */
 /* Types for ACPI_MUTEX_TYPE */
 
 #define ACPI_BINARY_SEMAPHORE       0
@@ -99,99 +104,101 @@
 #define ACPI_DISASSEMBLER
 #endif
 
-/*
- * Environment configuration.  The purpose of this file is to interface to the
- * local generation environment.
- *
- * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
- *      Otherwise, local versions of string/memory functions will be used.
- * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
- *      the standard header files may be used.
- *
- * The ACPI subsystem only uses low level C library functions that do not call
- * operating system services and may therefore be inlined in the code.
- *
- * It may be necessary to tailor these include files to the target
- * generation environment.
- *
- *
- * Functions and constants used from each header:
- *
- * string.h:    memcpy
- *              memset
- *              strcat
- *              strcmp
- *              strcpy
- *              strlen
- *              strncmp
- *              strncat
- *              strncpy
- *
- * stdlib.h:    strtoul
- *
- * stdarg.h:    va_list
- *              va_arg
- *              va_start
- *              va_end
- *
- */
 
 /*! [Begin] no source code translation */
 
+/******************************************************************************
+ *
+ * Host configuration files. The compiler configuration files are included
+ * by the host files.
+ *
+ *****************************************************************************/
 #if defined(_LINUX) || defined(__linux__)
 #include <acpi/platform/aclinux.h>
 
-#elif defined(_AED_EFI)
-#include "acefi.h"
-
-#elif defined(WIN32)
-#include "acwin.h"
-
-#elif defined(WIN64)
-#include "acwin64.h"
-
-#elif defined(MSDOS)		/* Must appear after WIN32 and WIN64 check */
-#include "acdos16.h"
-
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include "acfreebsd.h"
 
 #elif defined(__NetBSD__)
 #include "acnetbsd.h"
 
+#elif defined(__sun)
+#include "acsolaris.h"
+
 #elif defined(MODESTO)
 #include "acmodesto.h"
 
 #elif defined(NETWARE)
 #include "acnetware.h"
 
-#elif defined(__sun)
-#include "acsolaris.h"
+#elif defined(_CYGWIN)
+#include "accygwin.h"
 
-#else
+#elif defined(WIN32)
+#include "acwin.h"
+
+#elif defined(WIN64)
+#include "acwin64.h"
 
-/* All other environments */
+#elif defined(_WRS_LIB_BUILD)
+#include "acvxworks.h"
 
-#define ACPI_USE_STANDARD_HEADERS
+#elif defined(__OS2__)
+#include "acos2.h"
 
-#define COMPILER_DEPENDENT_INT64   long long
-#define COMPILER_DEPENDENT_UINT64  unsigned long long
+#elif defined(_AED_EFI)
+#include "acefi.h"
+
+#elif defined(__HAIKU__)
+#include "achaiku.h"
+
+#else
+
+/* Unknown environment */
 
+#error Unknown target environment
 #endif
 
 /*! [End] no source code translation !*/
 
 /******************************************************************************
  *
- * Miscellaneous configuration
+ * Setup defaults for the required symbols that were not defined in one of
+ * the host/compiler files above.
  *
  *****************************************************************************/
 
+/* 64-bit data types */
+
+#ifndef COMPILER_DEPENDENT_INT64
+#define COMPILER_DEPENDENT_INT64   long long
+#endif
+
+#ifndef COMPILER_DEPENDENT_UINT64
+#define COMPILER_DEPENDENT_UINT64  unsigned long long
+#endif
+
 /* Type of mutex supported by host. Default is binary semaphores. */
 #ifndef ACPI_MUTEX_TYPE
 #define ACPI_MUTEX_TYPE             ACPI_BINARY_SEMAPHORE
 #endif
 
+/* Global Lock acquire/release */
+
+#ifndef ACPI_ACQUIRE_GLOBAL_LOCK
+#define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1
+#endif
+
+#ifndef ACPI_RELEASE_GLOBAL_LOCK
+#define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0
+#endif
+
+/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
+
+#ifndef ACPI_FLUSH_CPU_CACHE
+#define ACPI_FLUSH_CPU_CACHE()
+#endif
+
 /* "inline" keywords - configurable since inline is not standardized */
 
 #ifndef ACPI_INLINE
@@ -199,6 +206,30 @@
 #endif
 
 /*
+ * Configurable calling conventions:
+ *
+ * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
+ * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
+ * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
+ * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
+ */
+#ifndef ACPI_SYSTEM_XFACE
+#define ACPI_SYSTEM_XFACE
+#endif
+
+#ifndef ACPI_EXTERNAL_XFACE
+#define ACPI_EXTERNAL_XFACE
+#endif
+
+#ifndef ACPI_INTERNAL_XFACE
+#define ACPI_INTERNAL_XFACE
+#endif
+
+#ifndef ACPI_INTERNAL_VAR_XFACE
+#define ACPI_INTERNAL_VAR_XFACE
+#endif
+
+/*
  * Debugger threading model
  * Use single threaded if the entire subsystem is contained in an application
  * Use multiple threaded when the subsystem is running in the kernel.
@@ -223,11 +254,22 @@
 
 #define ACPI_IS_ASCII(c)  ((c) < 0x80)
 
-#ifdef ACPI_USE_SYSTEM_CLIBRARY
 /*
- * Use the standard C library headers.
- * We want to keep these to a minimum.
+ * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
+ *      Otherwise, local versions of string/memory functions will be used.
+ * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
+ *      the standard header files may be used.
+ *
+ * The ACPICA subsystem only uses low level C library functions that do not call
+ * operating system services and may therefore be inlined in the code.
+ *
+ * It may be necessary to tailor these include files to the target
+ * generation environment.
  */
+#ifdef ACPI_USE_SYSTEM_CLIBRARY
+
+/* Use the standard C library headers. We want to keep these to a minimum. */
+
 #ifdef ACPI_USE_STANDARD_HEADERS
 /* Use the standard headers from the standard locations */
 #include <stdarg.h>
@@ -290,7 +332,7 @@ typedef char *va_list;
 /* Variable argument list macro definitions */
 #define _bnd(X, bnd)            (((sizeof (X)) + (bnd)) & (~(bnd)))
 #define va_arg(ap, T)           (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
-#define va_end(ap)              (void) 0
+#define va_end(ap)              (ap = (va_list) NULL)
 #define va_start(ap, A)         (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND))))
 
 #endif				/* va_arg */
@@ -314,59 +356,4 @@ typedef char *va_list;
 
 #endif				/* ACPI_USE_SYSTEM_CLIBRARY */
 
-/******************************************************************************
- *
- * Assembly code macros
- *
- *****************************************************************************/
-
-/*
- * Handle platform- and compiler-specific assembly language differences.
- * These should already have been defined by the platform includes above.
- *
- * Notes:
- * 1) Interrupt 3 is used to break into a debugger
- * 2) Interrupts are turned off during ACPI register setup
- */
-
-/* Unrecognized compiler, use defaults */
-
-#ifndef ACPI_ASM_MACROS
-
-/*
- * Calling conventions:
- *
- * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
- * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
- * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
- * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
- */
-#define ACPI_SYSTEM_XFACE
-#define ACPI_EXTERNAL_XFACE
-#define ACPI_INTERNAL_XFACE
-#define ACPI_INTERNAL_VAR_XFACE
-
-#define ACPI_ASM_MACROS
-#define BREAKPOINT3
-#define ACPI_DISABLE_IRQS()
-#define ACPI_ENABLE_IRQS()
-#define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq)
-#define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq)
-
-#endif				/* ACPI_ASM_MACROS */
-
-#ifdef ACPI_APPLICATION
-
-/* Don't want software interrupts within a ring3 application */
-
-#undef BREAKPOINT3
-#define BREAKPOINT3
-#endif
-
-/******************************************************************************
- *
- * Compiler-specific information is contained in the compiler-specific
- * headers.
- *
- *****************************************************************************/
 #endif				/* __ACENV_H__ */
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 72553b0..7433ad1 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -64,8 +64,4 @@
  */
 #define ACPI_UNUSED_VAR __attribute__ ((unused))
 
-#ifdef _ANSI
-#define inline
-#endif
-
 #endif				/* __ACGCC_H__ */
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [RESEND PATCH v2 04/19] ACPICA: Cleanup source to reduce differences between Linux and ACPICA.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (15 preceding siblings ...)
  2012-12-20  1:07   ` [RESEND PATCH v2 02/19] ACPICA: Update compilation environment settings Lv Zheng
@ 2012-12-20  1:07   ` Lv Zheng
  2012-12-20  1:09   ` [RESEND PATCH v2 08/19] ACPICA: Enhance error messages Lv Zheng
  2012-12-20  1:09   ` [RESEND PATCH v2 19/19] ACPICA: Update version to 20121114 Lv Zheng
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-20  1:07 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 389 lines of 20121018 divergence.diff.

This patch reduces source code diff caused by the simple code maintenance
work:
1. Deletion of the unused include files.
2. Deletion of the deprecated codes blocks.
3. Repositioning of the code blocks.
4. Replacing the values with the well defined macros.
5. Replacing the types with the equivalent types.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Binary comparision result:
  Changes can be found are caused by the line folding:
  -    c109:	6a 6d                	push   $0x6d
  +    c109:	6a 6c                	push   $0x6c
  hwregs.c(108-1): acpi_hw_validate_register
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    c13c:	6a 78                	push   $0x78
  +    c13c:	6a 77                	push   $0x77
  hwregs.c(119-2): acpi_hw_validate_register
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    c15d:	68 81 00 00 00       	push   $0x81
  +    c15d:	68 80 00 00 00       	push   $0x80
  hwregs.c(128-2): acpi_hw_validate_register
  ACPI_WARNING -> AE_INFO -> __LINE__
  -    c28f:	68 37 01 00 00       	push   $0x137
  +    c28f:	68 36 01 00 00       	push   $0x136
  hwregs.c(310-1): acpi_hw_get_bit_register_info
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    c35b:	68 a8 01 00 00       	push   $0x1a8
  +    c35b:	68 a7 01 00 00       	push   $0x1a7
  hwregs.c(423): acpi_hw_register_read
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    c440:	68 30 02 00 00       	push   $0x230
  +    c440:	68 2f 02 00 00       	push   $0x22f
  hwregs.c(559): acpi_hw_register_write
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    d962:	68 5d 01 00 00       	push   $0x15d
  +    d962:	68 5c 01 00 00       	push   $0x15c
  nsinit.c(348-3): acpi_ns_init_one_object
  ACPI_EXCEPTION -> AE_INFO -> __LINE__
  -    da02:	6a 66                	push   $0x66
  +    da02:	6a 65                	push   $0x65
  nsinit.c(101): acpi_ns_initialize_objects
  ACPI_EXCEPTION -> AE_INFO -> __LINE__
  -    db03:	68 da 00 00 00       	push   $0xda
  +    db03:	68 d9 00 00 00       	push   $0xd9
  nsinit.c(217): acpi_ns_initialize_devices
  ACPI_EXCEPTION -> AE_INFO -> __LINE__
  -    f151:	68 99 00 00 00       	push   $0x99
  +    f151:	68 98 00 00 00       	push   $0x98
  nsutils.c(152): acpi_ns_get_type
  ACPI_WARNING -> AE_INFO -> __LINE__
  -    f17d:	68 b5 00 00 00       	push   $0xb5
  +    f17d:	68 b4 00 00 00       	push   $0xb4
  nsutils.c(180): acpi_ns_local
  ACPI_WARNING -> AE_INFO -> __LINE__
  -    f3f8:	68 19 02 00 00       	push   $0x219
  +    f3f8:	68 18 02 00 00       	push   $0x218
  nsutils.c(536): acpi_ns_externalize_name
  ACPI_ERROR -> AE_INFO -> __LINE__
  -    f532:	68 a1 02 00 00       	push   $0x2a1
  +    f532:	68 a0 02 00 00       	push   $0x2a0
  nsutils.c(672): acpi_ns_opens_scope
  ACPI_WARNING -> AE_INFO -> __LINE__
  -   178f6:	6a 4c                	push   $0x4c
  +   178f6:	6a 48                	push   $0x48
  utxface.c(72): acpi_terminate
  ACPI_ERROR -> AE_INFO -> __LINE__
---
Divergences fixing result:
  Before applying: 2950 Lines, 103.0 Kbytes
  After applying: 2561 Lines, 90.4 Kbytes
---
 drivers/acpi/acpica/accommon.h  |    1 +
 drivers/acpi/acpica/acglobal.h  |   33 +++++++++++++++---------------
 drivers/acpi/acpica/aclocal.h   |    5 -----
 drivers/acpi/acpica/amlresrc.h  |    6 ++++++
 drivers/acpi/acpica/dsobject.c  |    2 +-
 drivers/acpi/acpica/exregion.c  |    2 +-
 drivers/acpi/acpica/hwregs.c    |    1 -
 drivers/acpi/acpica/hwsleep.c   |    4 ++--
 drivers/acpi/acpica/hwxfsleep.c |    2 +-
 drivers/acpi/acpica/nsdumpdv.c  |    1 -
 drivers/acpi/acpica/nsinit.c    |    1 -
 drivers/acpi/acpica/nsutils.c   |    1 -
 drivers/acpi/acpica/nsxfeval.c  |    8 +++++---
 drivers/acpi/acpica/tbxface.c   |    1 -
 drivers/acpi/acpica/utxface.c   |    4 ----
 include/acpi/acconfig.h         |   22 --------------------
 include/acpi/acpiosxf.h         |    7 +++++--
 include/acpi/acpixf.h           |   43 ++++++++++++++++++---------------------
 include/acpi/actbl.h            |    6 ++++--
 include/acpi/actypes.h          |    5 +++++
 include/acpi/platform/acenv.h   |    2 --
 21 files changed, 68 insertions(+), 89 deletions(-)

diff --git a/drivers/acpi/acpica/accommon.h b/drivers/acpi/acpica/accommon.h
index 8a7d51b..8632d71 100644
--- a/drivers/acpi/acpica/accommon.h
+++ b/drivers/acpi/acpica/accommon.h
@@ -51,6 +51,7 @@
  *
  * Note: The order of these include files is important.
  */
+#include <acpi/acconfig.h>	/* Global configuration constants */
 #include "acmacros.h"		/* C macros */
 #include "aclocal.h"		/* Internal data types */
 #include "acobject.h"		/* ACPI internal object */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 1ef7ca4..864806e 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -192,14 +192,6 @@ ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
 ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
 ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
 
-/* Mutex for _OSI support */
-
-ACPI_EXTERN acpi_mutex acpi_gbl_osi_mutex;
-
-/* Reader/Writer lock is used for namespace walk and dynamic table unload */
-
-ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;
-
 /*****************************************************************************
  *
  * Mutual exclusion within ACPICA subsystem
@@ -233,6 +225,14 @@ ACPI_EXTERN u8 acpi_gbl_global_lock_pending;
 ACPI_EXTERN acpi_spinlock acpi_gbl_gpe_lock;	/* For GPE data structs and registers */
 ACPI_EXTERN acpi_spinlock acpi_gbl_hardware_lock;	/* For ACPI H/W except GPE registers */
 
+/* Mutex for _OSI support */
+
+ACPI_EXTERN acpi_mutex acpi_gbl_osi_mutex;
+
+/* Reader/Writer lock is used for namespace walk and dynamic table unload */
+
+ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;
+
 /*****************************************************************************
  *
  * Miscellaneous globals
@@ -304,6 +304,7 @@ extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
 ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
 ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
 ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
+ACPI_EXTERN u8 acpi_gbl_disable_mem_tracking;
 #endif
 
 /*****************************************************************************
@@ -365,19 +366,18 @@ ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
  *
  ****************************************************************************/
 
-extern struct acpi_fixed_event_info
-    acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
-ACPI_EXTERN struct acpi_fixed_event_handler
-    acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
-ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
-ACPI_EXTERN struct acpi_gpe_block_info
-*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
-
 #if (!ACPI_REDUCED_HARDWARE)
 
 ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized;
+ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
+ACPI_EXTERN struct acpi_gpe_block_info
+    *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
 ACPI_EXTERN acpi_gbl_event_handler acpi_gbl_global_event_handler;
 ACPI_EXTERN void *acpi_gbl_global_event_handler_context;
+ACPI_EXTERN struct acpi_fixed_event_handler
+    acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
+extern struct acpi_fixed_event_info
+    acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
 
 #endif				/* !ACPI_REDUCED_HARDWARE */
 
@@ -428,6 +428,7 @@ extern u8 acpi_gbl_db_terminate_threads;
 ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
 ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
 ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
+ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;
 
 ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
 ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 50f8b97..421b048 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -410,11 +410,6 @@ struct acpi_gpe_notify_info {
 	struct acpi_gpe_notify_info *next;
 };
 
-struct acpi_gpe_notify_object {
-	struct acpi_namespace_node *node;
-	struct acpi_gpe_notify_object *next;
-};
-
 /*
  * GPE dispatch info. At any time, the GPE can have at most one type
  * of dispatch - Method, Handler, or Implicit Notify.
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h
index 9684496..bdbb7d0 100644
--- a/drivers/acpi/acpica/amlresrc.h
+++ b/drivers/acpi/acpica/amlresrc.h
@@ -199,6 +199,12 @@ struct aml_resource_fixed_dma {
 struct aml_resource_large_header {
 AML_RESOURCE_LARGE_HEADER_COMMON};
 
+/* General Flags for address space resource descriptors */
+
+#define ACPI_RESOURCE_FLAG_DEC      2
+#define ACPI_RESOURCE_FLAG_MIF      4
+#define ACPI_RESOURCE_FLAG_MAF      8
+
 struct aml_resource_memory24 {
 	AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
 	u16 minimum;
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index c9f15d3..13844a1 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -388,7 +388,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 	union acpi_parse_object *parent;
 	union acpi_operand_object *obj_desc = NULL;
 	acpi_status status = AE_OK;
-	unsigned i;
+	u32 i;
 	u16 index;
 	u16 reference_count;
 
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 0a01e19..044d441 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -163,7 +163,7 @@ acpi_ex_system_memory_space_handler(u32 function,
 		page_boundary_map_length =
 		    ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;
 
-		if (!page_boundary_map_length) {
+		if (page_boundary_map_length == 0) {
 			page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
 		}
 
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 165395f..e782b5a 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -44,7 +44,6 @@
 
 #include <acpi/acpi.h>
 #include "accommon.h"
-#include "acnamesp.h"
 #include "acevents.h"
 
 #define _COMPONENT          ACPI_HARDWARE
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index 3fddde0..691a5fb 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -45,7 +45,6 @@
 #include <acpi/acpi.h>
 #include <linux/acpi.h>
 #include "accommon.h"
-#include <linux/module.h>
 
 #define _COMPONENT          ACPI_HARDWARE
 ACPI_MODULE_NAME("hwsleep")
@@ -323,7 +322,8 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
 	 * and use it to determine whether the system is rebooting or
 	 * resuming. Clear WAK_STS for compatibility.
 	 */
-	acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, 1);
+	(void)acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS,
+				      ACPI_CLEAR_STATUS);
 	acpi_gbl_system_awake_and_running = TRUE;
 
 	/* Enable power button */
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index 2898011..6fcee00 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -41,9 +41,9 @@
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
+#include <linux/export.h>
 #include <acpi/acpi.h>
 #include "accommon.h"
-#include <linux/module.h>
 
 #define _COMPONENT          ACPI_HARDWARE
 ACPI_MODULE_NAME("hwxfsleep")
diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c
index 944d4c8..4ae9360 100644
--- a/drivers/acpi/acpica/nsdumpdv.c
+++ b/drivers/acpi/acpica/nsdumpdv.c
@@ -42,7 +42,6 @@
  */
 
 #include <acpi/acpi.h>
-#include "accommon.h"
 
 /* TBD: This entire module is apparently obsolete and should be removed */
 
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index bb6888f..94c1500 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -46,7 +46,6 @@
 #include "acnamesp.h"
 #include "acdispat.h"
 #include "acinterp.h"
-#include <linux/nmi.h>
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsinit")
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index b5b4cb7..479aad0 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -46,7 +46,6 @@
 #include "accommon.h"
 #include "acnamesp.h"
 #include "amlcode.h"
-#include "actables.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsutils")
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index 70bbc1f..5c05ba3 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -602,18 +602,20 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 
 			/* Walk the CID list */
 
-			found = 0;
+			found = FALSE;
 			for (i = 0; i < cid->count; i++) {
 				if (ACPI_STRCMP(cid->ids[i].string, info->hid)
 				    == 0) {
 					/* Found a matching CID */
-					found = 1;
+					found = TRUE;
 					break;
 				}
 			}
+
 			ACPI_FREE(cid);
-			if (!found)
+			if (!found) {
 				return (AE_OK);
+			}
 		}
 	}
 
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index f563278..d102fe7 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -44,7 +44,6 @@
 #include <linux/export.h>
 #include <acpi/acpi.h>
 #include "accommon.h"
-#include "acnamesp.h"
 #include "actables.h"
 
 #define _COMPONENT          ACPI_TABLES
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 390db0c..cb85a7b 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -44,11 +44,7 @@
 #include <linux/export.h>
 #include <acpi/acpi.h>
 #include "accommon.h"
-#include "acevents.h"
-#include "acnamesp.h"
 #include "acdebug.h"
-#include "actables.h"
-#include "acinterp.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utxface")
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 358258a..12a5996 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -150,11 +150,6 @@
  *
  *****************************************************************************/
 
-/* Number of distinct GPE register blocks and register width */
-
-#define ACPI_MAX_GPE_BLOCKS             2
-#define ACPI_GPE_REGISTER_WIDTH         8
-
 /* Method info (in WALK_STATE), containing local variables and argumetns */
 
 #define ACPI_METHOD_NUM_LOCALS          8
@@ -163,12 +158,6 @@
 #define ACPI_METHOD_NUM_ARGS            7
 #define ACPI_METHOD_MAX_ARG             6
 
-/* Length of _HID, _UID, _CID, and UUID values */
-
-#define ACPI_DEVICE_ID_LENGTH           0x09
-#define ACPI_MAX_CID_LENGTH             48
-#define ACPI_UUID_LENGTH                16
-
 /*
  * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
  */
@@ -186,17 +175,6 @@
  */
 #define ACPI_RESULTS_OBJ_NUM_MAX        255
 
-/* Names within the namespace are 4 bytes long */
-
-#define ACPI_NAME_SIZE                  4
-#define ACPI_PATH_SEGMENT_LENGTH        5	/* 4 chars for name + 1 char for separator */
-#define ACPI_PATH_SEPARATOR             '.'
-
-/* Sizes for ACPI table headers */
-
-#define ACPI_OEM_ID_SIZE                6
-#define ACPI_OEM_TABLE_ID_SIZE          8
-
 /* Constants used in searching for the RSDP in low memory */
 
 #define ACPI_EBDA_PTR_LOCATION          0x0000040E	/* Physical Address */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 4315274..33a3e17 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -148,6 +148,8 @@ void acpi_os_release_mutex(acpi_mutex handle);
  */
 void *acpi_os_allocate(acpi_size size);
 
+void acpi_os_free(void *memory);
+
 void __iomem *acpi_os_map_memory(acpi_physical_address where,
 				acpi_size length);
 
@@ -180,12 +182,13 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object);
  * Interrupt handlers
  */
 acpi_status
-acpi_os_install_interrupt_handler(u32 gsi,
+acpi_os_install_interrupt_handler(u32 interrupt_number,
 				  acpi_osd_handler service_routine,
 				  void *context);
 
 acpi_status
-acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine);
+acpi_os_remove_interrupt_handler(u32 interrupt_number,
+				 acpi_osd_handler service_routine);
 
 void acpi_os_gpe_count(u32 gpe_number);
 void acpi_os_fixed_event_count(u32 fixed_event_number);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index defbcaa..b409406 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -58,6 +58,10 @@ extern u8 acpi_gbl_permanent_mmap;
 /*
  * Globals that are publically available
  */
+extern u32 acpi_current_gpe_count;
+extern struct acpi_table_fadt acpi_gbl_FADT;
+extern u8 acpi_gbl_system_awake_and_running;
+extern u8 acpi_gbl_reduced_hardware;	/* ACPI 5.0 */
 /* Runtime configuration of debug print levels */
 extern u32 acpi_dbg_level;
 extern u32 acpi_dbg_layer;
@@ -100,11 +104,6 @@ extern u8 acpi_gbl_disable_auto_repair;
 
 #endif				/* !ACPI_REDUCED_HARDWARE */
 
-extern u32 acpi_current_gpe_count;
-extern struct acpi_table_fadt acpi_gbl_FADT;
-extern u8 acpi_gbl_system_awake_and_running;
-extern u8 acpi_gbl_reduced_hardware;	/* ACPI 5.0 */
-
 extern u32 acpi_rsdt_forced;
 /*
  * Initialization
@@ -121,15 +120,14 @@ acpi_status acpi_initialize_objects(u32 flags);
 
 acpi_status acpi_terminate(void);
 
-#ifdef ACPI_FUTURE_USAGE
-acpi_status acpi_subsystem_status(void);
-#endif
-
 /*
  * Miscellaneous global interfaces
  */
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
+#ifdef ACPI_FUTURE_USAGE
+acpi_status acpi_subsystem_status(void);
+#endif
 
 #ifdef ACPI_FUTURE_USAGE
 acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
@@ -466,6 +464,10 @@ acpi_buffer_to_resource(u8 *aml_buffer,
  */
 acpi_status acpi_reset(void);
 
+acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg);
+
+acpi_status acpi_write(u64 value, struct acpi_generic_address *reg);
+
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				acpi_read_bit_register(u32 register_id,
 						       u32 *return_value))
@@ -474,20 +476,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				acpi_write_bit_register(u32 register_id,
 							u32 value))
 
-ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
-				acpi_set_firmware_waking_vector(u32
-								physical_address))
-
-#if ACPI_MACHINE_WIDTH == 64
-ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
-				acpi_set_firmware_waking_vector64(u64
-								  physical_address))
-#endif
-
-acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg);
-
-acpi_status acpi_write(u64 value, struct acpi_generic_address *reg);
-
 /*
  * Sleep/Wake interfaces
  */
@@ -504,6 +492,15 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
 
 acpi_status acpi_leave_sleep_state(u8 sleep_state);
 
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				acpi_set_firmware_waking_vector(u32
+								physical_address))
+
+#if ACPI_MACHINE_WIDTH == 64
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				acpi_set_firmware_waking_vector64(u64
+								  physical_address))
+#endif
 /*
  * ACPI Timer interfaces
  */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 4f94b1d..c0e6c32 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -326,8 +326,6 @@ enum acpi_preferred_pm_profiles {
 
 #pragma pack()
 
-#define ACPI_FADT_OFFSET(f)             (u16) ACPI_OFFSET (struct acpi_table_fadt, f)
-
 /*
  * Internal table-related structures
  */
@@ -364,6 +362,10 @@ struct acpi_table_desc {
 #include <acpi/actbl2.h>
 #include <acpi/actbl3.h>
 
+/* Macros used to generate offsets to specific table fields */
+
+#define ACPI_FADT_OFFSET(f)             (u16) ACPI_OFFSET (struct acpi_table_fadt, f)
+
 /*
  * Sizes of the various flavors of FADT. We need to look closely
  * at the FADT length because the version number essentially tells
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 35d4dea0..6882227 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -474,6 +474,7 @@ typedef u64 acpi_integer;
  */
 #define ACPI_FULL_INITIALIZATION        0x00
 #define ACPI_NO_ADDRESS_SPACE_INIT      0x01
+#define ACPI_NO_HARDWARE_INIT           0x02
 #define ACPI_NO_EVENT_INIT              0x04
 #define ACPI_NO_HANDLER_INIT            0x08
 #define ACPI_NO_ACPI_ENABLE             0x10
@@ -970,6 +971,10 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status,
 typedef
 acpi_status(*acpi_tbl_handler) (u32 event, void *table, void *context);
 
+#define ACPI_TABLE_LOAD             0x0
+#define ACPI_TABLE_UNLOAD           0x1
+#define ACPI_NUM_TABLE_EVENTS       2
+
 /* Address Spaces (For Operation Regions) */
 
 typedef
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 13ac538..cec6cd3 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -277,8 +277,6 @@
  *
  *****************************************************************************/
 
-#define ACPI_IS_ASCII(c)  ((c) < 0x80)
-
 /*
  * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
  *      Otherwise, local versions of string/memory functions will be used.
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [RESEND PATCH v2 08/19] ACPICA: Enhance error messages.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (16 preceding siblings ...)
  2012-12-20  1:07   ` [RESEND PATCH v2 04/19] ACPICA: Cleanup source to reduce differences between Linux and ACPICA Lv Zheng
@ 2012-12-20  1:09   ` Lv Zheng
  2012-12-20  1:09   ` [RESEND PATCH v2 19/19] ACPICA: Update version to 20121114 Lv Zheng
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-20  1:09 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Lv Zheng

This patch decreases 29 lines of 20121018 divergence.diff.

This patch updates error messages that already have been enhanced in
ACPICA. This patch can also help to reduce the source code differences
between Linux and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
Divergences fixing result:
  Before applying: 2011 Lines, 71.6 Kbytes
  After applying: 1982 Lines, 70.5 Kbytes
---
 drivers/acpi/acpica/evgpe.c  |    2 +-
 drivers/acpi/acpica/utmisc.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index a137ce81..4cbb600 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -765,7 +765,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
 					 gpe_event_info);
 		if (ACPI_FAILURE(status)) {
 			ACPI_EXCEPTION((AE_INFO, status,
-					"Unable to queue handler for GPE%2X - event disabled",
+					"Unable to queue handler for GPE%02X - event disabled",
 					gpe_number));
 		}
 		break;
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
index 9286a69..2881992 100644
--- a/drivers/acpi/acpica/utmisc.c
+++ b/drivers/acpi/acpica/utmisc.c
@@ -748,12 +748,12 @@ void acpi_ut_repair_name(char *name)
 
 		if (!acpi_gbl_enable_interpreter_slack) {
 			ACPI_WARNING((AE_INFO,
-				      "Found bad character(s) in name, repaired: [%4.4s]\n",
-				      name));
+				      "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
+					  original_name, name));
 		} else {
 			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-					  "Found bad character(s) in name, repaired: [%4.4s]\n",
-					  name));
+					  "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
+					  original_name, name));
 		}
 	}
 }
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

* [RESEND PATCH v2 19/19] ACPICA: Update version to 20121114.
  2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
                     ` (17 preceding siblings ...)
  2012-12-20  1:09   ` [RESEND PATCH v2 08/19] ACPICA: Enhance error messages Lv Zheng
@ 2012-12-20  1:09   ` Lv Zheng
  18 siblings, 0 replies; 53+ messages in thread
From: Lv Zheng @ 2012-12-20  1:09 UTC (permalink / raw)
  To: Len Brown, Rafael J Wysocki; +Cc: linux-acpi, Bob Moore, Lv Zheng

From: Bob Moore <robert.moore@intel.com>

Version 20121114.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 include/acpi/acpixf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index b77ee00..3c9c783 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20121018
+#define ACPI_CA_VERSION                 0x20121114
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2012-12-20  1:10 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21 10:06 [PATCH 00/15] ACPICA 20121114 Release Lv Zheng
2012-11-21 10:06 ` [PATCH 01/15] ACPICA: Fixes unmerged (dis)assember divergences Lv Zheng
2012-11-27  2:58   ` Brown, Len
2012-11-27  5:41     ` Zheng, Lv
2012-12-10  8:23     ` Zheng, Lv
2012-12-10  8:54       ` Zheng, Lv
2012-12-10 13:04         ` Rafael J. Wysocki
2012-12-11  0:15           ` Zheng, Lv
2012-11-21 10:07 ` [PATCH 02/15] ACPICA: Fixes comments caused divergences Lv Zheng
2012-11-27  3:32   ` Brown, Len
2012-11-27  5:35     ` Zheng, Lv
2012-11-21 10:07 ` [PATCH 03/15] ACPICA: Fixes indent " Lv Zheng
2012-11-21 10:07 ` [PATCH 04/15] ACPICA: Fixes code maintenance divergences Lv Zheng
2012-11-27  3:46   ` Brown, Len
2012-11-27  5:33     ` Zheng, Lv
2012-11-27 11:46       ` Rafael J. Wysocki
2012-11-21 10:07 ` [PATCH 05/15] ACPICA: Fixes call depth check caused divergences Lv Zheng
2012-11-27  3:52   ` Brown, Len
2012-11-27  5:30     ` Zheng, Lv
2012-11-21 10:07 ` [PATCH 06/15] ACPICA: Fix possible memory leak Lv Zheng
2012-11-21 10:07 ` [PATCH 07/15] ACPICA: Performance enhancement for ACPI package objects Lv Zheng
2012-11-21 10:07 ` [PATCH 08/15] ACPICA: Performance: Remove function tracing from critical allocation functions Lv Zheng
2012-11-21 10:08 ` [PATCH 09/15] ACPICA: Debugger: Major update for the Disassemble<method> command Lv Zheng
2012-11-27  3:58   ` Brown, Len
2012-11-21 10:08 ` [PATCH 10/15] ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags Lv Zheng
2012-11-21 10:08 ` [PATCH 11/15] ACPICA: Add macros to extract flag bits from resource descriptors Lv Zheng
2012-11-21 10:08 ` [PATCH 12/15] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros Lv Zheng
2012-11-27  4:04   ` Brown, Len
2012-11-27  5:37     ` Zheng, Lv
2012-11-21 10:08 ` [PATCH 13/15] ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE Lv Zheng
2012-11-21 10:08 ` [PATCH 14/15] ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure Lv Zheng
2012-11-21 10:08 ` [PATCH 15/15] ACPICA: Update version to 20121114 Lv Zheng
2012-11-22  0:15 ` [PATCH 00/15] ACPICA 20121114 Release Rafael J. Wysocki
2012-12-20  1:06 ` [RESEND PATCH v2 00/19] " Lv Zheng
2012-12-19  5:36   ` [PATCH v2 01/19] ACPICA: Cleanup updated comments Lv Zheng
2012-12-19  5:37   ` [PATCH v2 03/19] ACPICA: Update codes under disabled build options Lv Zheng
2012-12-19  5:37   ` [PATCH v2 05/19] ACPICA: Cleanup indentation to reduce differences between Linux and ACPICA Lv Zheng
2012-12-19  5:37   ` [PATCH v2 06/19] ACPICA: Cleanup coding style " Lv Zheng
2012-12-19  5:37   ` [PATCH v2 07/19] ACPICA: Fix broken call depth tracing logic Lv Zheng
2012-12-19  5:37   ` [PATCH v2 09/19] ACPICA: Update initialization codes Lv Zheng
2012-12-19  5:37   ` [PATCH v2 10/19] ACPICA: Fix possible memory leak Lv Zheng
2012-12-19  5:37   ` [PATCH v2 11/19] ACPICA: Performance enhancement for ACPI package objects Lv Zheng
2012-12-19  5:37   ` [PATCH v2 12/19] ACPICA: Performance: Remove function tracing from critical allocation functions Lv Zheng
2012-12-19  5:38   ` [PATCH v2 13/19] ACPICA: Debugger: Major update for the Disassemble<method> command Lv Zheng
2012-12-19  5:38   ` [PATCH v2 14/19] ACPICA: Disassembler: Add new ACPI 5 interrupt sharing flags Lv Zheng
2012-12-19  5:38   ` [PATCH v2 15/19] ACPICA: Add macros to extract flag bits from resource descriptors Lv Zheng
2012-12-19  5:38   ` [PATCH v2 16/19] ACPICA: Enhance the ACPI_GETx and ACPI_SETx macros Lv Zheng
2012-12-19  5:38   ` [PATCH v2 17/19] ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE Lv Zheng
2012-12-19  5:38   ` [PATCH v2 18/19] ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure Lv Zheng
2012-12-20  1:07   ` [RESEND PATCH v2 02/19] ACPICA: Update compilation environment settings Lv Zheng
2012-12-20  1:07   ` [RESEND PATCH v2 04/19] ACPICA: Cleanup source to reduce differences between Linux and ACPICA Lv Zheng
2012-12-20  1:09   ` [RESEND PATCH v2 08/19] ACPICA: Enhance error messages Lv Zheng
2012-12-20  1:09   ` [RESEND PATCH v2 19/19] ACPICA: Update version to 20121114 Lv Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.