* [PATCH] Staging: comedi: Use USB_ENDPOINT_DIR_MASK instead of USB_DIR_IN
@ 2016-09-19 19:00 Sandhya Bankar
2016-09-20 6:46 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Sandhya Bankar @ 2016-09-19 19:00 UTC (permalink / raw)
To: outreachy-kernel; +Cc: abbotti, hsweeten, gregkh
USB_ENDPOINT_DIR_MASK and USB_DIR_IN have the same value,
but USB_ENDPOINT_DIR_MASK is more correct for use as a mask.
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..40a7d97 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 ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != dir) {
dev_err(dev->class_dev,
"Endpoint has wrong direction\n");
return -ENODEV;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Staging: comedi: Use USB_ENDPOINT_DIR_MASK instead of USB_DIR_IN
2016-09-19 19:00 [PATCH] Staging: comedi: Use USB_ENDPOINT_DIR_MASK instead of USB_DIR_IN Sandhya Bankar
@ 2016-09-20 6:46 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-09-20 6:46 UTC (permalink / raw)
To: Sandhya Bankar; +Cc: outreachy-kernel, abbotti, hsweeten
On Tue, Sep 20, 2016 at 12:30:19AM +0530, Sandhya Bankar wrote:
> USB_ENDPOINT_DIR_MASK and USB_DIR_IN have the same value,
> but USB_ENDPOINT_DIR_MASK is more correct for use as a mask.
>
> 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..40a7d97 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 ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != dir) {
This is messy, and I don't think that this code will ever "normally" be
triggered. Can you rewrite this loop to properly check for the endpoint
type using the functions you used last time, and not trigger off of the
endpoint number? That would be a much cleaner and saner fix for this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-20 6:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-19 19:00 [PATCH] Staging: comedi: Use USB_ENDPOINT_DIR_MASK instead of USB_DIR_IN Sandhya Bankar
2016-09-20 6:46 ` Greg KH
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.