ChangeSet 1.1832.55.25, 2004/09/05 05:04:18+02:00, [EMAIL PROTECTED] [PATCH] list_for_each_entry: drivers-usb-core-devices.c
Make code more readable with list_for_each_entry. Compile tested. Patch incremental on the list_for_each() change. Signed-off-by: Domen Puncer <[EMAIL PROTECTED]> Signed-off-by: Maximilian Attems <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> drivers/usb/core/devices.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff -Nru a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c --- a/drivers/usb/core/devices.c 2004-10-19 08:18:16 -07:00 +++ b/drivers/usb/core/devices.c 2004-10-19 08:18:16 -07:00 @@ -569,7 +569,6 @@ static ssize_t usb_device_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { - struct list_head *buslist; struct usb_bus *bus; ssize_t ret, total_written = 0; loff_t skip_bytes = *ppos; @@ -581,12 +580,9 @@ if (!access_ok(VERIFY_WRITE, buf, nbytes)) return -EFAULT; - /* enumerate busses */ down (&usb_bus_list_lock); - list_for_each(buslist, &usb_bus_list) { - /* print devices for this bus */ - bus = list_entry(buslist, struct usb_bus, bus_list); - + /* print devices for all busses */ + list_for_each_entry(bus, &usb_bus_list, bus_list) { /* recurse through all children of the root hub */ if (!bus->root_hub) continue; ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel