All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddress & USB_DIR_IN).
@ 2016-09-18 14:47 Sandhya Bankar
  2016-09-18 15:26 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Sandhya Bankar @ 2016-09-18 14:47 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: abbotti, hsweeten, gregkh

Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddress & USB_DIR_IN).

This correction is made using below coccinelle script:

@@
struct usb_endpoint_descriptor *endpoint;
expression E;
@@
(
- endpoint->bEndpointAddress & USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
|
- endpoint->bEndpointAddress == USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
|
- (endpoint->bEndpointAddress & E) == USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
)


Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
 drivers/staging/comedi/drivers/dt9812.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c
index 7ebca86..4007c45 100644
--- a/drivers/staging/comedi/drivers/dt9812.c
+++ b/drivers/staging/comedi/drivers/dt9812.c
@@ -676,7 +676,7 @@ static int dt9812_find_endpoints(struct comedi_device *dev)
 			dir = USB_DIR_IN;
 			break;
 		}
-		if ((ep->bEndpointAddress & USB_DIR_IN) != dir) {
+		if ((usb_endpoint_dir_in(ep)) != dir) {
 			dev_err(dev->class_dev,
 				"Endpoint has wrong direction\n");
 			return -ENODEV;
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-19 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-18 14:47 [PATCH] Staging: comedi: Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddress & USB_DIR_IN) Sandhya Bankar
2016-09-18 15:26 ` [Outreachy kernel] " Julia Lawall
     [not found]   ` <c273ac58-4efb-9abe-4ec8-3c818ed8a17d@mev.co.uk>
2016-09-19 12:04     ` Julia Lawall
2016-09-19 15:27       ` sandhya bankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.