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.
This commit is contained in:
Nate Lawson 2004-07-02 19:17:27 +00:00
parent bf0acc273a
commit 99eb9c8b3b

View File

@ -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) {