Thread (12 messages) 12 messages, 3 authors, 2016-12-12

Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first

From: Mathias Nyman <hidden>
Date: 2016-11-24 12:07:33

On 24.11.2016 13:03, Felipe Balbi wrote:
Hi,

Mathias Nyman [off-list ref] writes:
quoted
quoted
quoted
+			/* 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?
quoted
+				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.
There are many things that needs fixing in this area, but not in this patch

-Mathias
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help