summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp.h
diff options
context:
space:
mode:
authorRolf Eike Beer <eike-hotplug@sf-tec.de>2006-11-13 15:12:45 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-01 14:36:59 -0800
commitac9e98918776d8fa6dc38bfa6d298a7dbcbac2cb (patch)
tree13f80151fffb5845e8dfc13d9f6d54a81f48daa2 /drivers/pci/hotplug/acpiphp.h
parentadbc2a102252994c36102008293b52760613d6c3 (diff)
downloadblackbird-op-linux-ac9e98918776d8fa6dc38bfa6d298a7dbcbac2cb.tar.gz
blackbird-op-linux-ac9e98918776d8fa6dc38bfa6d298a7dbcbac2cb.zip
PCI: Change memory allocation for acpiphp slots
Change memory allocation for acpiphp slots Change the "struct slot" that acpiphp uses for managing it's slots to directly contain the memory for the needed struct hotplug_slot_info and the slot's name. This way we need only two memory allocations per slot instead of four. While we are at it: make_slot_name() is just a wrapper around snprintf() knowing the right arguments to call it. Since the function makes just one function call and is only called from one place I inlined it by hand. Finally this fixes a possible bug waiting for someone to hit it. There were two unused local variables in acpiphp_register_hotplug_slot(). gcc did not find them because they were used in memory allocations with sizeof(*var). They had the same types as the target of the allocation, but nevertheless this was just weird. Signed-off-by: Rolf Eike Beer <eike-hotplug@sf-tec.de> Acked-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/acpiphp.h')
-rw-r--r--drivers/pci/hotplug/acpiphp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index 59c5b242d86d..ddbadd95387e 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -62,10 +62,10 @@ struct acpiphp_slot;
struct slot {
struct hotplug_slot *hotplug_slot;
struct acpiphp_slot *acpi_slot;
+ struct hotplug_slot_info info;
+ char name[SLOT_NAME_SIZE];
};
-
-
/**
* struct acpiphp_bridge - PCI bridge information
*
OpenPOWER on IntegriCloud