Skip to content

Commit

Permalink
ACPICA: Cleanup updated comments.
Browse files Browse the repository at this point in the history
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
held to a lowest level.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Jan 10, 2013
1 parent 9931fac commit 75c8044
Show file tree
Hide file tree
Showing 29 changed files with 111 additions and 104 deletions.
14 changes: 9 additions & 5 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
14 changes: 8 additions & 6 deletions drivers/acpi/acpica/acpredef.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/******************************************************************************
*
* Name: acpredef - Information table for ACPI predefined methods and objects
* $Revision: 1.1 $
*
*****************************************************************************/

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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}},
Expand Down
14 changes: 7 additions & 7 deletions drivers/acpi/acpica/dsopcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,27 +486,27 @@ 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)) {
return_ACPI_STATUS(status);
}

/*
* 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);
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
21 changes: 10 additions & 11 deletions drivers/acpi/acpica/evxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand All @@ -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();

Expand Down Expand Up @@ -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) {
Expand All @@ -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;
Expand All @@ -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.
*/
Expand All @@ -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);
Expand Down Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/evxfevnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/acpica/evxfgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
ACPI_MODULE_NAME("evxfgpe")

#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: acpi_update_all_gpes
*
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
*
Expand Down
8 changes: 6 additions & 2 deletions drivers/acpi/acpica/exconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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) ||
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exmutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 8 additions & 4 deletions drivers/acpi/acpica/exregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/acpica/hwesleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/hwregs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions drivers/acpi/acpica/hwxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
*
Expand Down
7 changes: 4 additions & 3 deletions drivers/acpi/acpica/hwxfsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
******************************************************************************/
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/nsdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit 75c8044

Please sign in to comment.