Avoiding arithmetic on void * need not be NetBSD-specific.

This commit is contained in:
riastradh 2014-04-23 21:34:17 +00:00
parent e97ebf330d
commit ff9a7f6db9
1 changed files with 0 additions and 20 deletions

View File

@ -551,43 +551,23 @@ int intel_opregion_setup(struct drm_device *dev)
goto err_out;
}
opregion->header = base;
#ifdef __NetBSD__
opregion->vbt = (char *)base + OPREGION_VBT_OFFSET;
#else
opregion->vbt = base + OPREGION_VBT_OFFSET;
#endif
#ifdef __NetBSD__
opregion->lid_state = (void *)((char *)base + ACPI_CLID);
#else
opregion->lid_state = base + ACPI_CLID;
#endif
mboxes = ioread32(&opregion->header->mboxes);
if (mboxes & MBOX_ACPI) {
DRM_DEBUG_DRIVER("Public ACPI methods supported\n");
#ifdef __NetBSD__
opregion->acpi = (void *)((char *)base + OPREGION_ACPI_OFFSET);
#else
opregion->acpi = base + OPREGION_ACPI_OFFSET;
#endif
}
if (mboxes & MBOX_SWSCI) {
DRM_DEBUG_DRIVER("SWSCI supported\n");
#ifdef __NetBSD__
opregion->swsci = (void *)((char *)base + OPREGION_SWSCI_OFFSET);
#else
opregion->swsci = base + OPREGION_SWSCI_OFFSET;
#endif
}
if (mboxes & MBOX_ASLE) {
DRM_DEBUG_DRIVER("ASLE supported\n");
#ifdef __NetBSD__
opregion->asle = (void *)((char *)base + OPREGION_ASLE_OFFSET);
#else
opregion->asle = base + OPREGION_ASLE_OFFSET;
#endif
}
return 0;