11 Sep 05:24
RE: [PATCH] acpiphp: Match the variable types for ia64
Chen, Justin <justin.chen <at> hp.com>
2008-09-11 03:24:22 GMT
2008-09-11 03:24:22 GMT
>-----Original Message-----
>> > The ACPI 3.0 spec is mute on how large the 'integer' returned from
>> > _SUN is -- presumably it can be 64 bit. But if we're going to
>> > permit _SUN to return 64-bit, we should make it u64
>everywhere, not
>> > just 64-bit for 64-bit machines.
>>
>> Yeah, that's a better idea, let's just turn the type into a u64.
>
>Sounds good. Justin can you generate a patch for this?
>
Here it goes. The following patch changes (against 2.6.26) the type of sun into a u64.
Singed-off-by: Justin Chen <justin.chen <at> hp.com>
=========================================================================
diff -Nru a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
--- a/drivers/pci/hotplug/acpiphp_core.c 2008-07-13 14:51:29.000000000 -0700
+++ b/drivers/pci/hotplug/acpiphp_core.c 2008-09-10 19:25:19.118880324 -0700
@@ -355,7 +355,8 @@
slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;
acpiphp_slot->slot = slot;
- snprintf(slot->name, sizeof(slot->name), "%u", slot->acpi_slot->sun);
+ snprintf(slot->name, sizeof(slot->name), "%lu",
+ (unsigned long) slot->acpi_slot->sun);
retval = pci_hp_register(slot->hotplug_slot);
if (retval) {
diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
--- a/drivers/pci/hotplug/acpiphp_glue.c 2008-07-13 14:51:29.000000000 -0700
+++ b/drivers/pci/hotplug/acpiphp_glue.c 2008-09-10 19:19:51.743884334 -0700
@@ -244,7 +244,7 @@
slot->bridge = bridge;
slot->device = device;
- slot->sun = sun;
+ slot->sun = (u64) sun;
INIT_LIST_HEAD(&slot->funcs);
mutex_init(&slot->crit_sect);
@@ -253,8 +253,9 @@
bridge->nr_slots++;
- dbg("found ACPI PCI Hotplug slot %d at PCI %04x:%02x:%02x\n",
- slot->sun, pci_domain_nr(bridge->pci_bus),
+ dbg("found ACPI PCI Hotplug slot %lu at PCI %04x:%02x:%02x\n",
+ (unsigned long) slot->sun,
+ pci_domain_nr(bridge->pci_bus),
bridge->pci_bus->number, slot->device);
retval = acpiphp_register_hotplug_slot(slot);
if (retval) {
diff -Nru a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
--- a/drivers/pci/hotplug/acpiphp.h 2008-07-13 14:51:29.000000000 -0700
+++ b/drivers/pci/hotplug/acpiphp.h 2008-09-10 18:43:42.947035902 -0700
@@ -112,7 +112,7 @@
u8 device; /* pci device# */
- u32 sun; /* ACPI _SUN (slot unique number) */
+ u64 sun; /* ACPI _SUN (slot unique number) */
u32 flags; /* see below */
};
RSS Feed