summaryrefslogtreecommitdiff
path: root/tools/power/acpi/tools/acpidump/apdump.c
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-07-08 10:07:33 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-08 14:22:27 +0200
commitfbee6b21a3820a55ec36a2aceb138f3973a955ac (patch)
treeff0c7ecf0730d9e408cdd9ac1d1dc5fae620da8b /tools/power/acpi/tools/acpidump/apdump.c
parenta92e95773d8e2cd58124aea147cb833f33f1e196 (diff)
ACPICA: acpidump: Add memory/string OSL usage to improve portability
This patch adds code to use generic OSL for acpidump to improve the portability of this tool. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power/acpi/tools/acpidump/apdump.c')
-rw-r--r--tools/power/acpi/tools/acpidump/apdump.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c
index e8729aa3a60e..ccb6262829d6 100644
--- a/tools/power/acpi/tools/acpidump/apdump.c
+++ b/tools/power/acpi/tools/acpidump/apdump.c
@@ -252,7 +252,7 @@ int ap_dump_all_tables(void)
}
table_status = ap_dump_table_buffer(table, instance, address);
- free(table);
+ ACPI_FREE(table);
if (table_status) {
break;
@@ -303,7 +303,7 @@ int ap_dump_table_by_address(char *ascii_address)
}
table_status = ap_dump_table_buffer(table, 0, address);
- free(table);
+ ACPI_FREE(table);
return (table_status);
}
@@ -329,7 +329,7 @@ int ap_dump_table_by_name(char *signature)
acpi_status status;
int table_status;
- if (strlen(signature) != ACPI_NAME_SIZE) {
+ if (ACPI_STRLEN(signature) != ACPI_NAME_SIZE) {
fprintf(stderr,
"Invalid table signature [%s]: must be exactly 4 characters\n",
signature);
@@ -338,15 +338,15 @@ int ap_dump_table_by_name(char *signature)
/* Table signatures are expected to be uppercase */
- strcpy(local_signature, signature);
+ ACPI_STRCPY(local_signature, signature);
acpi_ut_strupr(local_signature);
/* To be friendly, handle tables whose signatures do not match the name */
if (ACPI_COMPARE_NAME(local_signature, "FADT")) {
- strcpy(local_signature, ACPI_SIG_FADT);
+ ACPI_STRCPY(local_signature, ACPI_SIG_FADT);
} else if (ACPI_COMPARE_NAME(local_signature, "MADT")) {
- strcpy(local_signature, ACPI_SIG_MADT);
+ ACPI_STRCPY(local_signature, ACPI_SIG_MADT);
}
/* Dump all instances of this signature (to handle multiple SSDTs) */
@@ -369,7 +369,7 @@ int ap_dump_table_by_name(char *signature)
}
table_status = ap_dump_table_buffer(table, instance, address);
- free(table);
+ ACPI_FREE(table);
if (table_status) {
break;
@@ -424,6 +424,6 @@ int ap_dump_table_from_file(char *pathname)
table_status = ap_dump_table_buffer(table, 0, 0);
exit:
- free(table);
+ ACPI_FREE(table);
return (table_status);
}