Skip to content

Commit

Permalink
ACPICA: Deploy ACPI_MOVE_NAME across ACPICA source base
Browse files Browse the repository at this point in the history
Replaces instances of strncpy(...,4) for ACPI_NAMEs.
ACPI_MOVE_NAME optimizes these to a single 32-bit copy on machines
that support misaligned transfers.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Bob Moore authored and Rafael J. Wysocki committed Nov 14, 2012
1 parent 2d2dd50 commit eed9525
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/nsxfname.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer)

/* Just copy the ACPI name from the Node and zero terminate it */

ACPI_STRNCPY(buffer->pointer, acpi_ut_get_node_name(node),
ACPI_NAME_SIZE);
ACPI_MOVE_NAME(buffer->pointer, acpi_ut_get_node_name(node));
((char *)buffer->pointer)[ACPI_NAME_SIZE] = 0;
status = AE_OK;

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/tbfind.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ acpi_tb_find_table(char *signature,
/* Normalize the input strings */

ACPI_MEMSET(&header, 0, sizeof(struct acpi_table_header));
ACPI_STRNCPY(header.signature, signature, ACPI_NAME_SIZE);
ACPI_MOVE_NAME(header.signature, signature);
ACPI_STRNCPY(header.oem_id, oem_id, ACPI_OEM_ID_SIZE);
ACPI_STRNCPY(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE);

Expand Down

0 comments on commit eed9525

Please sign in to comment.