summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-07-02 19:17:27 +0000
committernjl <njl@FreeBSD.org>2004-07-02 19:17:27 +0000
commitf3e20d3d7bb33996ca004c68a869620f1349f117 (patch)
treeaa9aa3cf6849a847fad85796aefdbd29293623ec /sys/dev/acpica
parent1b16b181d12075ffc084f2a593e16fe3dd8f6f6d (diff)
downloadFreeBSD-src-f3e20d3d7bb33996ca004c68a869620f1349f117.zip
FreeBSD-src-f3e20d3d7bb33996ca004c68a869620f1349f117.tar.gz
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.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi_ec.c5
1 files changed, 3 insertions, 2 deletions
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) {
OpenPOWER on IntegriCloud