From patchwork Tue Sep 22 11:45:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 49244 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8MBkC3Q025801 for ; Tue, 22 Sep 2009 11:46:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756177AbZIVLpR (ORCPT ); Tue, 22 Sep 2009 07:45:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756144AbZIVLpQ (ORCPT ); Tue, 22 Sep 2009 07:45:16 -0400 Received: from mgw1.diku.dk ([130.225.96.91]:49016 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755860AbZIVLpO (ORCPT ); Tue, 22 Sep 2009 07:45:14 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id E50F052C3D7; Tue, 22 Sep 2009 13:45:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 39g60pm3T2dy; Tue, 22 Sep 2009 13:45:16 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id 9E3C552C367; Tue, 22 Sep 2009 13:45:16 +0200 (CEST) Received: from pc-004.diku.dk (pc-004.diku.dk [130.225.97.4]) by nhugin.diku.dk (Postfix) with ESMTP id 337EE6DF893; Tue, 22 Sep 2009 13:43:15 +0200 (CEST) Received: by pc-004.diku.dk (Postfix, from userid 3767) id 8426B3842A; Tue, 22 Sep 2009 13:45:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by pc-004.diku.dk (Postfix) with ESMTP id 7EDAC3830C; Tue, 22 Sep 2009 13:45:16 +0200 (CEST) Date: Tue, 22 Sep 2009 13:45:16 +0200 (CEST) From: Julia Lawall To: "John W. Linville" , Ulrich Kunitz , Daniel Drake , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drivers/net/wireless: Use usb_endpoint_dir_out Message-ID: MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Julia Lawall 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/) // @@ struct usb_endpoint_descriptor *endpoint; expression E; @@ - (endpoint->bEndpointAddress & E) == USB_DIR_OUT + usb_endpoint_dir_out(endpoint) // Signed-off-by: Julia Lawall --- drivers/net/wireless/zd1211rw/zd_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -u -p a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c @@ -1070,7 +1070,7 @@ static int eject_installer(struct usb_in /* 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 {