diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-15 23:29:32 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-07 19:06:36 -0800 |
commit | 57477bf0d9c2d311afe5a4e6b75040aabb3a426e (patch) | |
tree | 4d40c9c8ca3470e9f9b29a13f551f1da0cb38697 /drivers/staging/wlan-ng/hfa384x_usb.c | |
parent | drivers:staging:wlan-ng Fix space preferred around that messages (diff) | |
download | linux-dev-57477bf0d9c2d311afe5a4e6b75040aabb3a426e.tar.xz linux-dev-57477bf0d9c2d311afe5a4e6b75040aabb3a426e.zip |
staging: wlan-ng: use list_for_each_entry*
Use list_for_each_entry*() instead of list_for_each*() to simplify
the code.
Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng/hfa384x_usb.c')
-rw-r--r-- | drivers/staging/wlan-ng/hfa384x_usb.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index a5626df2bebc..682de77e7561 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -2810,8 +2810,7 @@ void hfa384x_tx_timeout(wlandevice_t *wlandev) static void hfa384x_usbctlx_reaper_task(unsigned long data) { hfa384x_t *hw = (hfa384x_t *)data; - struct list_head *entry; - struct list_head *temp; + hfa384x_usbctlx_t *ctlx, *temp; unsigned long flags; spin_lock_irqsave(&hw->ctlxq.lock, flags); @@ -2819,10 +2818,7 @@ static void hfa384x_usbctlx_reaper_task(unsigned long data) /* This list is guaranteed to be empty if someone * has unplugged the adapter. */ - list_for_each_safe(entry, temp, &hw->ctlxq.reapable) { - hfa384x_usbctlx_t *ctlx; - - ctlx = list_entry(entry, hfa384x_usbctlx_t, list); + list_for_each_entry_safe(ctlx, temp, &hw->ctlxq.reapable, list) { list_del(&ctlx->list); kfree(ctlx); } @@ -2847,8 +2843,7 @@ static void hfa384x_usbctlx_reaper_task(unsigned long data) static void hfa384x_usbctlx_completion_task(unsigned long data) { hfa384x_t *hw = (hfa384x_t *)data; - struct list_head *entry; - struct list_head *temp; + hfa384x_usbctlx_t *ctlx, *temp; unsigned long flags; int reap = 0; @@ -2858,11 +2853,7 @@ static void hfa384x_usbctlx_completion_task(unsigned long data) /* This list is guaranteed to be empty if someone * has unplugged the adapter ... */ - list_for_each_safe(entry, temp, &hw->ctlxq.completing) { - hfa384x_usbctlx_t *ctlx; - - ctlx = list_entry(entry, hfa384x_usbctlx_t, list); - + list_for_each_entry_safe(ctlx, temp, &hw->ctlxq.completing, list) { /* Call the completion function that this * command was assigned, assuming it has one. */ |