- 11 May, 2004 8 commits
-
-
Rolf Eike Beer authored
Am Donnerstag, 6. Mai 2004 02:48 schrieb Sy, Dely L: > On Fri, 30 Apr 2004 12:31:18 +0200, Rolf Eike Beer wrote: >> - >> -static int cleanup_slots (struct controller * ctrl) >> +static void cleanup_slots(const struct controller *ctrl) >> { >> - struct slot *old_slot, *next_slot; >> + struct slot *old_slot; >> >> old_slot = ctrl->slot; >> ctrl->slot = NULL; >> >> while (old_slot) { >> - next_slot = old_slot->next; >> - pci_hp_deregister (old_slot->hotplug_slot); >> - kfree(old_slot->hotplug_slot->info); >> - kfree(old_slot->hotplug_slot->name); >> - kfree(old_slot->hotplug_slot); >> - kfree(old_slot); >> - old_slot = next_slot; >> + pci_hp_deregister(old_slot->hotplug_slot); >> + old_slot = old_slot->next; >> } > > The variable next_slot and its assignment should be kept, for once > pci_hp_deregister() is called and the release callback function, which > you added, may come in and clean up old_slot structure before the next > ptr is saved. The code should be: > > static void cleanup_slots(const struct controller *ctrl) > { > struct slot *old_slot, *next_slot; > > old_slot = ctrl->slot; > ctrl->slot = NULL; > > while (old_slot) { > next_slot = old_slot->next; > pci_hp_deregister (old_slot->hotplug_slot); > old_slot = next_slot; > } > } Yes, good point. Greg, this patch makes does it. Please apply on top of the other stuff.
-
Rolf Eike Beer authored
-
Rolf Eike Beer authored
This 2 get_* functions do the same the hotplug core does if this functions would not be there. Kill Bil^H^H^Hem! Eike
-
Rolf Eike Beer authored
slot_paranoia_check is only another kind of checking everything for NULL. Removing this leads to function get_slot is reduced to a simple cast, so this function can be killed also. Eike
-
Rolf Eike Beer authored
If the "struct hotplug_slot *" parameter is ever NULL then something bogus is going on, we should not hide this bug by catching it. Also the name used in debug messages is fixed. Eike
-
Rolf Eike Beer authored
Convert cpci_hotplug_core.c::cpci_hp_register_bus to use goto for error handling. Eike
-
Rolf Eike Beer authored
This two checks are useless: cpci_hp_register_bus is only called from two places, one has constant arguments, the other one passes the module parameters which are checked for this condition on module load. And the bus argument of cpci_hp_unregister_bus can never be NULL, all functions calling this function use fields of the bus struct before so they will oops if it would ever be NULL. Eike
-
Rolf Eike Beer authored
This one removes useless code and fixes the issue that the return code of set_attention_status for cpcihp is always 0 even if cpci_set_attention_status returns an error. Eike
-
- 05 May, 2004 3 commits
-
-
Matt Domsch authored
On Wed, May 05, 2004 at 03:31:02PM -0700, Greg KH wrote: > On Thu, Apr 29, 2004 at 02:53:01PM -0500, Matt Domsch wrote: > > a) need this be a warning, wouldn't KERN_DEBUG suffice, if a message > > is needed at all? This is printed in pci_generic_prep_mwi(). > > Yes, we should make that KERN_DEBUG. I don't have a problem with that. > Care to make a patch?
-
Linda Xie authored
Attached is a revised version of rpaphp.patch. It has the following fixes: - Set up slot->name - Kill some dbgs - Eike's fixes - New fixes for incorrect "goto" in rpaphp_slot.c.
-
Greg Kroah-Hartman authored
-
- 01 May, 2004 1 commit
-
-
Andrew Morton authored
This fixes allyesconfig
-
- 30 Apr, 2004 28 commits
-
-
Greg Kroah-Hartman authored
-
Rolf Eike Beer authored
Remove a useless cast: pci_add_new_bus returns a struct pci_bus*, so no need to cast.
-
Rolf Eike Beer authored
A big bunch of coding style fixes for shpchp_ctrl.c and shpchp_pci.c Eike
-
Rolf Eike Beer authored
-
Rolf Eike Beer authored
Some small coding style fixes for shpchp_core.c.
-
Rolf Eike Beer authored
Convert shpchp_core.c::init_slots to use goto for error handling.
-
Rolf Eike Beer authored
shpchp is the only driver which does not use a release function for the slot struct. This adds one and does some minor coding style fixes. Also no one cares about the return value of cleanup_slots (which is always 0 anyway) so we can make the function void.
-
Rolf Eike Beer authored
shpchp_core.c::hardware_test is empty. If we remove it we tell the user that hardware tests are not supported at all.
-
Rolf Eike Beer authored
Convert shpchp_core.c to use new style of module handling. Eike
-
Rolf Eike Beer authored
Some coding style fixes for rpaphp_pci.c.
-
Rolf Eike Beer authored
Convert rpaphp_slot.c::alloc_slot_struct to use goto for error handling. Also some small coding style fixes.
-
Rolf Eike Beer authored
Remove two useless NULL checks from rpaphp_core.c
-
Rolf Eike Beer authored
rpaphp_core.c::init_slots is not more than a for loop and is called only from one place, this inlines the important 3 lines. Als add some __init and __exit.
-
Rolf Eike Beer authored
Some coding style fixes for rpaphp_core.c: -s/return(foo)/return foo/ -some whitespace fixes -document function in proper way Eike
-
Rolf Eike Beer authored
The get_cur_bus_speed function of rpaphp does nothing that the PCI Hotplug Core would not do by itself if this function does not exist, so just kill it.
-
Rolf Eike Beer authored
The debug parameter of rpaphp is only used as a boolean so we can scan the commandline of it like a boolean parameter.
-
Rolf Eike Beer authored
This is a bunch of coding style fixes (wrap long lines, whitspacing etc.) for pciehp_pci.c
-
Rolf Eike Beer authored
This patch does two things: -remove casts of pointers which are void* or already the correct type for the target -if we dereferenced a struct member and copied this to it's own variable use this and don't dereference the member again
-
Rolf Eike Beer authored
Don't know why, but it looks like a good idea to mark this global variables static.
-
Rolf Eike Beer authored
Some coding style fixes and small cleanups for pciehp_core.c: -wrap long lines -kill spaces before opening braces of functions -remove code duplication where both parts of an if statement do exactly the same -kill some useless comments -kill an unneeded initialisation
-
Rolf Eike Beer authored
The result of kmalloc does not need to be casted to any other pointer type. Also use kmalloc(*foo) instead of kmalloc(type_of_foo) and wrap some long lines.
-
Rolf Eike Beer authored
Some small coding style fixes and a typo fix for pciehp.h
-
Rolf Eike Beer authored
This changes pciehp_core.c::init_slots to use goto for error hanling. Also a missing magic missed by previous patches is killed.
-
Rolf Eike Beer authored
Remove useless NULL checks from cpqphp_ctrl.c. Under normal circumstances there is no chance for any of this functions to get called with a NULL argument. If we are in such trouble that we get a NULL pointer don't hide it, just oops.
-
Rolf Eike Beer authored
The hardware_test function of the PCI Express Hotplug driver is empty. It's better to completely kill this to tell the user hardware tests are not supported by this driver.
-
Rolf Eike Beer authored
This patch removes the cast of kmalloc's results to the target pointer type. Also it fixes kmalloc to use sizeof(*foo) instead of sizeof(type_of_foo) as suggested by Matthew Wilcox. Also removes a few useless checks if a pointer is NULL before calling kfree: kfree checks this itself.
-
Rolf Eike Beer authored
Remove useless NULL checks and magic numbers from rpaphp. If one of these ever becomes invalid we are in serious trouble anyway.
-
Rolf Eike Beer authored
Remove useless NULL checks and magic numbers from PCI Express Hotplug, also some minimal coding style fixes.
-