From: Greg KH <gregkh@linuxfoundation.org>
To: Sandhya Bankar <bankarsandhya512@gmail.com>
Cc: outreachy-kernel@googlegroups.com, abbotti@mev.co.uk,
hsweeten@visionengravers.com
Subject: Re: [PATCH] Staging: comedi: Use USB_ENDPOINT_DIR_MASK instead of USB_DIR_IN
Date: Tue, 20 Sep 2016 08:46:05 +0200 [thread overview]
Message-ID: <20160920064605.GA8527@kroah.com> (raw)
In-Reply-To: <20160919190019.GA9583@sandhya>
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
prev parent reply other threads:[~2016-09-20 6:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160920064605.GA8527@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=abbotti@mev.co.uk \
--cc=bankarsandhya512@gmail.com \
--cc=hsweeten@visionengravers.com \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.