From c48cf125146852424bfe8e02033c6065dd0a4021 Mon Sep 17 00:00:00 2001 From: Ulrich Kunitz Date: Sat, 12 Aug 2006 18:00:17 +0100 Subject: [PATCH] zd1211rw: cleanups Add static to 2 internal functions. Thanks goes to Adrian Bunk, who found that. Also made some modifications to the clear functions: After a discussion on the mailing list, I implemented this code to have on the one hand sufficient test in debug mode, but on the other hand reduce the overhead for structure clearing to a minimum. A new macro ZD_MEMCLEAR is introduced, which produces code if DEBUG is set. Locks are not set anymore for structure clearing, but in debug mode, there is a verification, that the locks have not been set. Finally, removed a misleading comment regarding locking in the disconnect path. Signed-off-by: Ulrich Kunitz Signed-off-by: Daniel Drake Signed-off-by: John W. Linville --- drivers/net/wireless/zd1211rw/zd_usb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/net/wireless/zd1211rw/zd_usb.c') diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index f721ea57e21..47489fe8ab5 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c @@ -664,7 +664,7 @@ resubmit: usb_submit_urb(urb, GFP_ATOMIC); } -struct urb *alloc_urb(struct zd_usb *usb) +static struct urb *alloc_urb(struct zd_usb *usb) { struct usb_device *udev = zd_usb_to_usbdev(usb); struct urb *urb; @@ -688,7 +688,7 @@ struct urb *alloc_urb(struct zd_usb *usb) return urb; } -void free_urb(struct urb *urb) +static void free_urb(struct urb *urb) { if (!urb) return; @@ -908,7 +908,7 @@ void zd_usb_clear(struct zd_usb *usb) { usb_set_intfdata(usb->intf, NULL); usb_put_intf(usb->intf); - memset(usb, 0, sizeof(*usb)); + ZD_MEMCLEAR(usb, sizeof(*usb)); /* FIXME: usb_interrupt, usb_tx, usb_rx? */ } @@ -1099,7 +1099,6 @@ static void disconnect(struct usb_interface *intf) */ usb_reset_device(interface_to_usbdev(intf)); - /* If somebody still waits on this lock now, this is an error. */ zd_netdev_free(netdev); dev_dbg(&intf->dev, "disconnected\n"); } -- cgit v1.2.3