Linux USB
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: dean@sensoray.com
Cc: linux-dev@sensoray.com, balbi@kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb/gadget: function fs req_match endpoint address fix
Date: Tue, 10 Oct 2023 07:57:44 +0200	[thread overview]
Message-ID: <2023101029-granny-defy-c4ac@gregkh> (raw)
In-Reply-To: <b08c24f9021b5c2fe1917cac18d65422@sensoray.com>

On Mon, Oct 09, 2023 at 04:29:48PM -0500, dean@sensoray.com wrote:
> > >  static int ffs_func_revmap_ep(struct ffs_function *func, u8 num)
> > >  {
> > > -	num = func->eps_revmap[num & USB_ENDPOINT_NUMBER_MASK];
> > > +	u8 addr = ((num & USB_ENDPOINT_DIR_MASK) >> 3)
> > > +		| (num & USB_ENDPOINT_NUMBER_MASK);
> > > +	num = func->eps_revmap[addr];
> > 
> > That's messy, again, 2 arrays would make this much simpler I think?
> 
> It's similar to the approach in composite.c. v6.6-rc4, line 1013, but yes 2
> arrays would be simpler.
> 
> BTW, should composite.c at least get rid of the magic numbers?
> 
> composite.c commit 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa
> line: 1013
> 
> addr = ((ep->bEndpointAddress & 0x80) >> 3)
>      |  (ep->bEndpointAddress & 0x0f);

Yes, it should.

thanks,

greg k-h

      reply	other threads:[~2023-10-10  5:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 22:11 [PATCH] usb/gadget: function fs req_match endpoint address fix linux-dev
2023-10-05  7:20 ` Greg KH
2023-10-09 21:29   ` dean
2023-10-10  5:57     ` 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=2023101029-granny-defy-c4ac@gregkh \
    --to=greg@kroah.com \
    --cc=balbi@kernel.org \
    --cc=dean@sensoray.com \
    --cc=linux-dev@sensoray.com \
    --cc=linux-usb@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox