[PATCH] acpiphp: Resend - Match the variable types 'sun'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The variable "sun" defined in acpiphp_glue.c as "unsigned long".  But the struct acpiphp_slot defines the sun as u32 in acpiphp.h.  The types are mismatched on ia64.  In addition, the _SUN could return 64-bit value, the u32 will not be long enough.

The following patch change the sun in acpiphp.h to u64 and matches the type in other places.

Singed-off-by: Justin Chen <justin.chen@xxxxxx>

=========================================================================
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 */
 };

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux