From f3e20d3d7bb33996ca004c68a869620f1349f117 Mon Sep 17 00:00:00 2001 From: njl Date: Fri, 2 Jul 2004 19:17:27 +0000 Subject: Get rid of the strict aliasing error by retrieving the ECDT via a table header pointer and then casting it to the ecdt pointer. This fixes the -O2 build. I'm unsure what changed recently to reveal this error since this code has been unchanged for months. --- sys/dev/acpica/acpi_ec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev/acpica') diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index 36ddd09..12159ed 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -367,6 +367,7 @@ void acpi_ec_ecdt_probe(device_t parent) { ACPI_TABLE_ECDT *ecdt; + ACPI_TABLE_HEADER *hdr; ACPI_STATUS status; device_t child; ACPI_HANDLE h; @@ -375,8 +376,8 @@ acpi_ec_ecdt_probe(device_t parent) ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); /* Find and validate the ECDT. */ - status = AcpiGetFirmwareTable("ECDT", 1, ACPI_LOGICAL_ADDRESSING, - (ACPI_TABLE_HEADER **)&ecdt); + status = AcpiGetFirmwareTable("ECDT", 1, ACPI_LOGICAL_ADDRESSING, &hdr); + ecdt = (ACPI_TABLE_ECDT *)hdr; if (ACPI_FAILURE(status) || ecdt->control.RegisterBitWidth != 8 || ecdt->data.RegisterBitWidth != 8) { -- cgit v1.1