Convert magic to a uintptr_t. This should get rid of some warnings on
gcc4.
This commit is contained in:
parent
595bf788f6
commit
70fa7bc0ac
@ -868,7 +868,7 @@ acpi_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
|
||||
*(ACPI_HANDLE *)result = ad->ad_handle;
|
||||
break;
|
||||
case ACPI_IVAR_MAGIC:
|
||||
*(int *)result = ad->ad_magic;
|
||||
*(uintptr_t *)result = ad->ad_magic;
|
||||
break;
|
||||
case ACPI_IVAR_PRIVATE:
|
||||
*(void **)result = ad->ad_private;
|
||||
@ -906,7 +906,7 @@ acpi_write_ivar(device_t dev, device_t child, int index, uintptr_t value)
|
||||
ad->ad_handle = (ACPI_HANDLE)value;
|
||||
break;
|
||||
case ACPI_IVAR_MAGIC:
|
||||
ad->ad_magic = (int)value;
|
||||
ad->ad_magic = (uintptr_t)value;
|
||||
break;
|
||||
case ACPI_IVAR_PRIVATE:
|
||||
ad->ad_private = (void *)value;
|
||||
|
@ -237,7 +237,7 @@ struct acpi_ec_params {
|
||||
};
|
||||
|
||||
/* Indicate that this device has already been probed via ECDT. */
|
||||
#define DEV_ECDT(x) (acpi_get_magic(x) == (int)&acpi_ec_devclass)
|
||||
#define DEV_ECDT(x) (acpi_get_magic(x) == (uintptr_t)&acpi_ec_devclass)
|
||||
|
||||
/*
|
||||
* Driver softc.
|
||||
@ -446,7 +446,7 @@ acpi_ec_ecdt_probe(device_t parent)
|
||||
params->uid = ecdt->Uid;
|
||||
acpi_GetInteger(h, "_GLK", ¶ms->glk);
|
||||
acpi_set_private(child, params);
|
||||
acpi_set_magic(child, (int)&acpi_ec_devclass);
|
||||
acpi_set_magic(child, (uintptr_t)&acpi_ec_devclass);
|
||||
|
||||
/* Finish the attach process. */
|
||||
if (device_probe_and_attach(child) != 0)
|
||||
|
@ -64,7 +64,7 @@ static char *hpet_ids[] = { "PNP0103", NULL };
|
||||
#define HPET_OFFSET_ENABLE 0x10 /* Location of enable word */
|
||||
#define HPET_OFFSET_VALUE 0xf0 /* Location of actual timer value */
|
||||
|
||||
#define DEV_HPET(x) (acpi_get_magic(x) == (int)&acpi_hpet_devclass)
|
||||
#define DEV_HPET(x) (acpi_get_magic(x) == (uintptr_t)&acpi_hpet_devclass)
|
||||
|
||||
struct timecounter hpet_timecounter = {
|
||||
.tc_get_timecount = hpet_get_timecount,
|
||||
@ -112,7 +112,7 @@ acpi_hpet_table_probe(device_t parent)
|
||||
}
|
||||
|
||||
/* Record a magic value so we can detect this device later. */
|
||||
acpi_set_magic(child, (int)&acpi_hpet_devclass);
|
||||
acpi_set_magic(child, (uintptr_t)&acpi_hpet_devclass);
|
||||
bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address,
|
||||
HPET_MEM_WIDTH);
|
||||
if (device_probe_and_attach(child) != 0)
|
||||
|
@ -81,7 +81,7 @@ struct acpi_softc {
|
||||
struct acpi_device {
|
||||
/* ACPI ivars */
|
||||
ACPI_HANDLE ad_handle;
|
||||
int ad_magic;
|
||||
uintptr_t ad_magic;
|
||||
void *ad_private;
|
||||
int ad_flags;
|
||||
|
||||
@ -227,7 +227,7 @@ static __inline void varp ## _set_ ## var(device_t dev, type t) \
|
||||
}
|
||||
|
||||
__ACPI_BUS_ACCESSOR(acpi, handle, ACPI, HANDLE, ACPI_HANDLE)
|
||||
__ACPI_BUS_ACCESSOR(acpi, magic, ACPI, MAGIC, int)
|
||||
__ACPI_BUS_ACCESSOR(acpi, magic, ACPI, MAGIC, uintptr_t)
|
||||
__ACPI_BUS_ACCESSOR(acpi, private, ACPI, PRIVATE, void *)
|
||||
__ACPI_BUS_ACCESSOR(acpi, flags, ACPI, FLAGS, int)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user