Avoid arithmetic operations on void pointers

See what I did there?
This commit is contained in:
Fredrik Holmqvist
2018-04-25 21:42:16 +02:00
parent 6d34de21b8
commit 86901205d0
@@ -1117,7 +1117,7 @@ AcpiOsReadable(void *pointer, ACPI_SIZE length)
if (id == B_ERROR) return false;
if (get_area_info(id, &info) != B_OK) return false;
return (info.protection & B_READ_AREA) != 0 &&
pointer + length <= info.address + info.ram_size;
((char *)pointer) + length <= info.address + info.ram_size;
#endif
}
@@ -1150,7 +1150,7 @@ AcpiOsWritable(void *pointer, ACPI_SIZE length)
if (get_area_info(id, &info) != B_OK) return false;
return (info.protection & B_READ_AREA) != 0 &&
(info.protection & B_WRITE_AREA) != 0 &&
pointer + length <= info.address + info.ram_size;
((char *)pointer) + length <= info.address + info.ram_size;
#endif
}