On Monday 18 February 2008, Karsten Wiese wrote:
>
> stream->free_list is either empty or contains ITD(s).
> Spare an "if (!itd)" and only do another after dma_pool_alloc().
>
> Signed-off-by: Karsten Wiese <[EMAIL PROTECTED]>
Can you update this to do the same for sitd_urb_transaction()?
> ---
> drivers/usb/host/ehci-sched.c | 15 ++++++---------
> 1 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
> index e3e85ab..d009d3c 100644
> --- a/drivers/usb/host/ehci-sched.c
> +++ b/drivers/usb/host/ehci-sched.c
> @@ -1182,21 +1182,18 @@ itd_urb_transaction (
> struct ehci_itd, itd_list);
> list_del (&itd->itd_list);
> itd_dma = itd->itd_dma;
> - } else
> - itd = NULL;
> -
> - if (!itd) {
> + } else {
> spin_unlock_irqrestore (&ehci->lock, flags);
> itd = dma_pool_alloc (ehci->itd_pool, mem_flags,
> &itd_dma);
> spin_lock_irqsave (&ehci->lock, flags);
> + if (unlikely(!itd)) {
> + iso_sched_free(stream, sched);
> + spin_unlock_irqrestore(&ehci->lock, flags);
> + return -ENOMEM;
> + }
> }
>
> - if (unlikely (NULL == itd)) {
> - iso_sched_free (stream, sched);
> - spin_unlock_irqrestore (&ehci->lock, flags);
> - return -ENOMEM;
> - }
> memset (itd, 0, sizeof *itd);
> itd->itd_dma = itd_dma;
> list_add (&itd->itd_list, &sched->td_list);
> --
> 1.5.3.8
>
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html