Skip to content
Commit ac9e9891 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Greg Kroah-Hartman
Browse files

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: default avatarRolf Eike Beer <eike-hotplug@sf-tec.de>
Acked-by: default avatarMatthew Wilcox <matthew@wil.cx>
Signed-off-by: default avatarKristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent adbc2a10
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment