Prarit Bhargava wrote: > Prarit Bhargava wrote: > > Prarit Bhargava wrote: > >>> D_B_S alone should be a unique identifier, so please don't use > >>> anything more if you don't need it to make the slot name unique. > >> > >> On Altix, since the system can be cabled in a number of ways a pointer > >> to the rack ID is definately useful and helps to uniquely identify the > >> slot. I'm going to use a 2 digit rack id, followed by the DDDD:BB:SS > >> value. > > > > Err .. uh .. unless there are any strenous objections of course ; > New patch after comments from Eike and Greg. Something I missed in the previous patch: +static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot, + struct pci_bus *pci_bus, int device) +{ + struct pcibus_info *pcibus_info; + struct slot *slot; + + pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus); + + bss_hotplug_slot->private = kcalloc(1, sizeof(struct slot), + GFP_KERNEL); + if (!bss_hotplug_slot->private) + return -ENOMEM; + slot = bss_hotplug_slot->private; + Better do it this way: slot = kcalloc(1, sizeof(*slot), GFP_KERNEL); bss_hotplug_slot->private = slot; This way the size of the memory area is always the correct one (which is the preferred way of operating *g*). I think it's really time for something like kmalloc0() or whatever to stop this type of kcalloc() abuse. Eike