aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/power/acpi/os_specific/service_layers/oslinuxtbl.c2
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixmap.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
index 92f1fd700344..db15c9d2049e 100644
--- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
+++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
@@ -1156,7 +1156,7 @@ osl_table_name_from_file(char *filename, char *signature, u32 *instance)
1156 /* Extract instance number */ 1156 /* Extract instance number */
1157 1157
1158 if (isdigit((int)filename[ACPI_NAME_SIZE])) { 1158 if (isdigit((int)filename[ACPI_NAME_SIZE])) {
1159 sscanf(&filename[ACPI_NAME_SIZE], "%d", instance); 1159 sscanf(&filename[ACPI_NAME_SIZE], "%u", instance);
1160 } else if (strlen(filename) != ACPI_NAME_SIZE) { 1160 } else if (strlen(filename) != ACPI_NAME_SIZE) {
1161 return (AE_BAD_SIGNATURE); 1161 return (AE_BAD_SIGNATURE);
1162 } else { 1162 } else {
diff --git a/tools/power/acpi/os_specific/service_layers/osunixmap.c b/tools/power/acpi/os_specific/service_layers/osunixmap.c
index 3853a7350440..0b1fa290245a 100644
--- a/tools/power/acpi/os_specific/service_layers/osunixmap.c
+++ b/tools/power/acpi/os_specific/service_layers/osunixmap.c
@@ -146,6 +146,6 @@ void acpi_os_unmap_memory(void *where, acpi_size length)
146 acpi_size page_size; 146 acpi_size page_size;
147 147
148 page_size = acpi_os_get_page_size(); 148 page_size = acpi_os_get_page_size();
149 offset = (acpi_physical_address) where % page_size; 149 offset = ACPI_TO_INTEGER(where) % page_size;
150 munmap((u8 *)where - offset, (length + offset)); 150 munmap((u8 *)where - offset, (length + offset));
151} 151}