drivers/net/wireless: Use usb_endpoint_dir_out
authorJulia Lawall <julia@diku.dk>
Tue, 22 Sep 2009 11:45:16 +0000 (13:45 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 23 Sep 2009 15:35:54 +0000 (11:35 -0400)
Use the usb_endpoint_dir_out API function.  Note that the use of
USB_TYPE_MASK in the original code is incorrect; it results in a test that
is always false.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
struct usb_endpoint_descriptor *endpoint;
expression E;
@@

- (endpoint->bEndpointAddress & E) == USB_DIR_OUT
+ usb_endpoint_dir_out(endpoint)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/zd1211rw/zd_usb.c

index 3868884..23a6a6d 100644 (file)
@@ -1070,7 +1070,7 @@ static int eject_installer(struct usb_interface *intf)
 
        /* Find bulk out endpoint */
        endpoint = &iface_desc->endpoint[1].desc;
-       if ((endpoint->bEndpointAddress & USB_TYPE_MASK) == USB_DIR_OUT &&
+       if (usb_endpoint_dir_out(endpoint) &&
            usb_endpoint_xfer_bulk(endpoint)) {
                bulk_out_ep = endpoint->bEndpointAddress;
        } else {