From xiphmont@gmail.com Thu Sep 28 00:06:01 2006 Message-ID: <806dafc20609280005p49087f72padd6f6492dfb3ac9@mail.gmail.com> Date: Thu, 28 Sep 2006 03:05:56 -0400 From: "Christopher \"Monty\" Montgomery" To: linux-usb-devel@lists.sourceforge.net Subject: [PATCH 4/15] USB: ehci-hcd: group ehci_iso_sched functions into one place Cc: greg@kroah.com, david-b@pacbell.net, xiphmont@gmail.com Content-Disposition: inline patch 4: moves ehci_iso_sched funtions to one place. Trivial patch that makes no functional difference. Signed-off-by: Christopher "Monty" Montgomery Cc: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-sched.c | 61 ++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 31 deletions(-) --- gregkh-2.6.orig/drivers/usb/host/ehci-sched.c +++ gregkh-2.6/drivers/usb/host/ehci-sched.c @@ -939,6 +939,36 @@ done: } /*-------------------------------------------------------------------------*/ +/* ISO scheduling temporary structure machinery necessitated by lazy + alloc of the iso_stream structure */ + +static struct ehci_iso_sched * +iso_sched_alloc (unsigned packets, gfp_t mem_flags) +{ + struct ehci_iso_sched *iso_sched; + int size = sizeof *iso_sched; + + size += packets * sizeof (struct ehci_iso_packet); + iso_sched = kzalloc(size, mem_flags); + if (likely (iso_sched != NULL)) { + INIT_LIST_HEAD (&iso_sched->td_list); + } + return iso_sched; +} + +static void +iso_sched_free (struct ehci_iso_stream *stream, + struct ehci_iso_sched *iso_sched) +{ + if (!iso_sched){ + return; + } + // caller must hold ehci->lock! + list_splice (&iso_sched->td_list, &stream->free_list); + kfree (iso_sched); +} + +/*-------------------------------------------------------------------------*/ /* ehci_iso_stream ops work with both ITD and SITD */ @@ -1164,24 +1194,6 @@ iso_stream_find (struct ehci_hcd *ehci, return stream; } -/*-------------------------------------------------------------------------*/ - -/* ehci_iso_sched ops can be ITD-only or SITD-only */ - -static struct ehci_iso_sched * -iso_sched_alloc (unsigned packets, gfp_t mem_flags) -{ - struct ehci_iso_sched *iso_sched; - int size = sizeof *iso_sched; - - size += packets * sizeof (struct ehci_iso_packet); - iso_sched = kzalloc(size, mem_flags); - if (likely (iso_sched != NULL)) { - INIT_LIST_HEAD (&iso_sched->td_list); - } - return iso_sched; -} - static inline void itd_sched_init ( struct ehci_iso_sched *iso_sched, @@ -1223,19 +1235,6 @@ itd_sched_init ( } } -static void -iso_sched_free ( - struct ehci_iso_stream *stream, - struct ehci_iso_sched *iso_sched -) -{ - if (!iso_sched) - return; - // caller must hold ehci->lock! - list_splice (&iso_sched->td_list, &stream->free_list); - kfree (iso_sched); -} - static int itd_urb_transaction ( struct ehci_iso_stream *stream,