linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: host: ehci-sched: add comment about find_tt() not returning error
@ 2020-10-11 20:50 Sudip Mukherjee
  2020-10-12  0:27 ` Alan Stern
  2020-10-12 14:11 ` [linux-safety] " Lukas Bulwahn
  0 siblings, 2 replies; 21+ messages in thread
From: Sudip Mukherjee @ 2020-10-11 20:50 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman
  Cc: linux-kernel, linux-safety, linux-usb, Sudip Mukherjee

Add a comment explaining why find_tt() will not return error even though
find_tt() is checking for NULL and other errors.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 drivers/usb/host/ehci-sched.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 6dfb242f9a4b..0f85aa9b2fb1 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -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);
@@ -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);
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-10-13  8:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-11 20:50 [PATCH] usb: host: ehci-sched: add comment about find_tt() not returning error Sudip Mukherjee
2020-10-12  0:27 ` Alan Stern
2020-10-12 14:11 ` [linux-safety] " Lukas Bulwahn
2020-10-12 14:57   ` Alan Stern
2020-10-12 15:10     ` Lukas Bulwahn
2020-10-12 15:18       ` Greg Kroah-Hartman
2020-10-12 18:25         ` Lukas Bulwahn
2020-10-13  5:23           ` Greg Kroah-Hartman
2020-10-13  5:37             ` Lukas Bulwahn
2020-10-13  6:36               ` Greg Kroah-Hartman
2020-10-13  7:16                 ` Lukas Bulwahn
2020-10-13  7:35                   ` Greg Kroah-Hartman
2020-10-13  8:02                     ` Lukas Bulwahn
2020-10-13  8:24               ` Sudip Mukherjee
2020-10-13  8:36                 ` Lukas Bulwahn
2020-10-12 16:00       ` Alan Stern
2020-10-12 18:17         ` Lukas Bulwahn
2020-10-13  5:21           ` Greg Kroah-Hartman
2020-10-13  5:41             ` Lukas Bulwahn
2020-10-12 15:24   ` Sudip Mukherjee
2020-10-12 18:49     ` Lukas Bulwahn

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).