stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@linux.intel.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>, linux@roeck-us.net
Cc: linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first
Date: Thu, 24 Nov 2016 13:03:49 +0200	[thread overview]
Message-ID: <87wpftp2ay.fsf@linux.intel.com> (raw)
In-Reply-To: <5836B995.5010609@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 775 bytes --]


Hi,

Mathias Nyman <mathias.nyman@linux.intel.com> writes:
>>> +			/* are any devices using this tt_info? */
>>> +			for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
>>
>> off-by-one here ? Why is i starting from 1?
>>
>>> +				vdev = xhci->devs[i];
>
> slit_id 0 is reserved and xhci->devs[0] is not used, so ne need to
> check it.

hmm... it's reserved for the HW, sure. Do you need to over allocate the
array by 1 just to keep this first member unused? Couldn't you handle
the +1/-1 (depending on the case) in xhci driver itself? Saves a bit of
memory there.

> All other places that check xhci->devs[0] are avtually buggy

fair enough, sounds like an accessor guaranteeing the 'rules of
engagement' for this would be useful.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2016-11-24 11:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <582DC88C.5040308@linux.intel.com>
2016-11-23 12:24 ` [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first Mathias Nyman
2016-11-23 13:32   ` Guenter Roeck
2016-11-23 14:44     ` Mathias Nyman
2016-11-24  9:02   ` Felipe Balbi
2016-11-24  9:57     ` Mathias Nyman
2016-11-24 11:03       ` Felipe Balbi [this message]
2016-11-24 12:07         ` Mathias Nyman
2016-11-24 19:58   ` Guenter Roeck
2016-11-28 20:24   ` Guenter Roeck
2016-11-30 11:41     ` Mathias Nyman
2016-12-09 21:28       ` Guenter Roeck
2016-12-12 13:50         ` Mathias Nyman

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=87wpftp2ay.fsf@linux.intel.com \
    --to=felipe.balbi@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mathias.nyman@linux.intel.com \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).