]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: xhci: move debug capabilities from trb_in_td() to handle_tx_event()
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Thu, 6 Mar 2025 14:49:50 +0000 (16:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Mar 2025 15:46:16 +0000 (16:46 +0100)
commit9a7f4bc4c82b4dd8e57b13375d42aff6a52d1812
treed8a9be316d470493520b916ee4d499bc3041705f
parentd71cb7d6e1a261ef25c60056920d91d052144dd8
usb: xhci: move debug capabilities from trb_in_td() to handle_tx_event()

Function trb_in_td() currently includes debug capabilities that are
triggered when its debug argument is set to true. The only consumer of
these debug capabilities is handle_tx_event(), which calls trb_in_td()
twice, once for its primary functionality and a second time solely for
debugging purposes if the first call returns 'NULL'.

This approach is inefficient and can lead to confusion, as trb_in_td()
executes the same code with identical arguments twice, differing only in
the debug output during the second execution.

To enhance clarity and efficiency, move the debug capabilities out of
trb_in_td() and integrates them directly into handle_tx_event().
This change reduces the argument count of trb_in_td() and ensures that
debug steps are executed only when necessary, streamlining the function's
operation.

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/20250306144954.3507700-12-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c