diff options
author | Matthias Kaehlcke <matthias.kaehlcke@gmail.com> | 2007-07-09 15:03:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:34:40 -0400 |
commit | a69228deefea57ca27c17a196e5727b091c6d323 (patch) | |
tree | a8c9545a2ca285021d7070bd258505cbc2a93ba3 /drivers/block | |
parent | acb11c8b8020f1f1b2545152020675ef32d09a58 (diff) |
USB: drivers/block/ub.c: use list_for_each_entry()
Low performance USB storage driver: Use list_for_each_entry() instead
of list_for_each()
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/ub.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 746a118a9b52..18c8b6c0db20 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -1547,10 +1547,8 @@ static void ub_reset_enter(struct ub_dev *sc, int try) | |||
1547 | #endif | 1547 | #endif |
1548 | 1548 | ||
1549 | #if 0 /* We let them stop themselves. */ | 1549 | #if 0 /* We let them stop themselves. */ |
1550 | struct list_head *p; | ||
1551 | struct ub_lun *lun; | 1550 | struct ub_lun *lun; |
1552 | list_for_each(p, &sc->luns) { | 1551 | list_for_each_entry(lun, &sc->luns, link) { |
1553 | lun = list_entry(p, struct ub_lun, link); | ||
1554 | blk_stop_queue(lun->disk->queue); | 1552 | blk_stop_queue(lun->disk->queue); |
1555 | } | 1553 | } |
1556 | #endif | 1554 | #endif |
@@ -1562,7 +1560,6 @@ static void ub_reset_task(struct work_struct *work) | |||
1562 | { | 1560 | { |
1563 | struct ub_dev *sc = container_of(work, struct ub_dev, reset_work); | 1561 | struct ub_dev *sc = container_of(work, struct ub_dev, reset_work); |
1564 | unsigned long flags; | 1562 | unsigned long flags; |
1565 | struct list_head *p; | ||
1566 | struct ub_lun *lun; | 1563 | struct ub_lun *lun; |
1567 | int lkr, rc; | 1564 | int lkr, rc; |
1568 | 1565 | ||
@@ -1608,8 +1605,7 @@ static void ub_reset_task(struct work_struct *work) | |||
1608 | spin_lock_irqsave(sc->lock, flags); | 1605 | spin_lock_irqsave(sc->lock, flags); |
1609 | sc->reset = 0; | 1606 | sc->reset = 0; |
1610 | tasklet_schedule(&sc->tasklet); | 1607 | tasklet_schedule(&sc->tasklet); |
1611 | list_for_each(p, &sc->luns) { | 1608 | list_for_each_entry(lun, &sc->luns, link) { |
1612 | lun = list_entry(p, struct ub_lun, link); | ||
1613 | blk_start_queue(lun->disk->queue); | 1609 | blk_start_queue(lun->disk->queue); |
1614 | } | 1610 | } |
1615 | wake_up(&sc->reset_wait); | 1611 | wake_up(&sc->reset_wait); |
@@ -2348,7 +2344,6 @@ err_alloc: | |||
2348 | static void ub_disconnect(struct usb_interface *intf) | 2344 | static void ub_disconnect(struct usb_interface *intf) |
2349 | { | 2345 | { |
2350 | struct ub_dev *sc = usb_get_intfdata(intf); | 2346 | struct ub_dev *sc = usb_get_intfdata(intf); |
2351 | struct list_head *p; | ||
2352 | struct ub_lun *lun; | 2347 | struct ub_lun *lun; |
2353 | unsigned long flags; | 2348 | unsigned long flags; |
2354 | 2349 | ||
@@ -2403,8 +2398,7 @@ static void ub_disconnect(struct usb_interface *intf) | |||
2403 | /* | 2398 | /* |
2404 | * Unregister the upper layer. | 2399 | * Unregister the upper layer. |
2405 | */ | 2400 | */ |
2406 | list_for_each (p, &sc->luns) { | 2401 | list_for_each_entry(lun, &sc->luns, link) { |
2407 | lun = list_entry(p, struct ub_lun, link); | ||
2408 | del_gendisk(lun->disk); | 2402 | del_gendisk(lun->disk); |
2409 | /* | 2403 | /* |
2410 | * I wish I could do: | 2404 | * I wish I could do: |