Skip to content

Commit

Permalink
usb: host: ehci-sched: add comment about find_tt() not returning error
Browse files Browse the repository at this point in the history
Add a comment explaining why find_tt() will not return error even though
find_tt() is checking for NULL and other errors.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lore.kernel.org/r/20201011205008.24369-1-sudipm.mukherjee@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sudip Mukherjee authored and Greg Kroah-Hartman committed Oct 28, 2020
1 parent 3650b22 commit 23eac85
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/usb/host/ehci-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ static void reserve_release_intr_bandwidth(struct ehci_hcd *ehci,

/* FS/LS bus bandwidth */
if (tt_usecs) {
/*
* find_tt() will not return any error here as we have
* already called find_tt() before calling this function
* and checked for any error return. The previous call
* would have created the data structure.
*/
tt = find_tt(qh->ps.udev);
if (sign > 0)
list_add_tail(&qh->ps.ps_list, &tt->ps_list);
Expand Down Expand Up @@ -1337,6 +1343,12 @@ static void reserve_release_iso_bandwidth(struct ehci_hcd *ehci,
}
}

/*
* find_tt() will not return any error here as we have
* already called find_tt() before calling this function
* and checked for any error return. The previous call
* would have created the data structure.
*/
tt = find_tt(stream->ps.udev);
if (sign > 0)
list_add_tail(&stream->ps.ps_list, &tt->ps_list);
Expand Down

0 comments on commit 23eac85

Please sign in to comment.