]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: xhci: rework xhci_free_segments_for_ring()
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Wed, 6 Nov 2024 10:14:39 +0000 (12:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Nov 2024 12:26:15 +0000 (13:26 +0100)
commit0049d49317755e906f23448dad0ddc4c0587e86a
tree441237f5d56ce7dcea9c2d642d5e38d53a90e64c
parent401406a4c709621aedce049460eb640b58d7c47d
usb: xhci: rework xhci_free_segments_for_ring()

The segment list is only relevant within the context of the ring.
Thus, it is more logical to pass the ring itself when freeing all segments
from a ring, rather than passing the ring list.

Rename the function to "xhci_ring_segments_free" to align with the naming
convention of xhci_segment_free().

To make the freeing process more intuitive, free segments sequentially
from start to end (i.e., 0, 1, 2, 3, ...) instead of freeing the first
segment last (i.e., 1, 2, 3, ... 0).

Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20241106101459.775897-14-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c