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/prism2usb.c | |
parent | 6c37e1f957be5f67b520e004e196b0e6a9ec2950 (diff) |
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/prism2usb.c')
-rw-r--r-- | drivers/staging/wlan-ng/prism2usb.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c index 8abf3f87a2d5..194f67e0fc06 100644 --- a/drivers/staging/wlan-ng/prism2usb.c +++ b/drivers/staging/wlan-ng/prism2usb.c @@ -139,8 +139,7 @@ static void prism2sta_disconnect_usb(struct usb_interface *interface) wlandev = (wlandevice_t *)usb_get_intfdata(interface); if (wlandev != NULL) { LIST_HEAD(cleanlist); - struct list_head *entry; - struct list_head *temp; + hfa384x_usbctlx_t *ctlx, *temp; unsigned long flags; hfa384x_t *hw = wlandev->priv; @@ -184,12 +183,8 @@ static void prism2sta_disconnect_usb(struct usb_interface *interface) * and tell everyone who is waiting for their * responses that we have shut down. */ - list_for_each(entry, &cleanlist) { - hfa384x_usbctlx_t *ctlx; - - ctlx = list_entry(entry, hfa384x_usbctlx_t, list); + list_for_each_entry(ctlx, &cleanlist, list) complete(&ctlx->done); - } /* Give any outstanding synchronous commands * a chance to complete. All they need to do @@ -199,12 +194,8 @@ static void prism2sta_disconnect_usb(struct usb_interface *interface) msleep(100); /* Now delete the CTLXs, because no-one else can now. */ - list_for_each_safe(entry, temp, &cleanlist) { - hfa384x_usbctlx_t *ctlx; - - ctlx = list_entry(entry, hfa384x_usbctlx_t, list); + list_for_each_entry_safe(ctlx, temp, &cleanlist, list) kfree(ctlx); - } /* Unhook the wlandev */ unregister_wlandev(wlandev); |