On Wed, 13 Apr 2005 21:40:17 +0400 Roman Kagan <[EMAIL PROTECTED]> wrote:
> +++ linux-2.6.12-rc2/drivers/base/bus.c 2005-04-13 08:45:48.000000000
> +0400
> @@ -405,9 +405,8 @@ void device_release_driver(struct device
>
> static void driver_detach(struct device_driver * drv)
> {
> - struct list_head * entry, * next;
> - list_for_each_safe(entry, next, &drv->devices) {
> - struct device * dev = container_of(entry, struct device,
> driver_list);
> + while (!list_empty(&drv->devices)) {
> + struct device * dev = container_of(drv->devices.next, struct
> device, driver_list);
> device_release_driver(dev);
Looks good to me.
The suspect code is also easy to spot: a) uses list_for_each_safe,
b) uses container_of instead of list_entry. That's whole two "newbie
points".
-- Pete
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel