diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2013-10-11 11:28:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-11 16:40:26 -0700 |
commit | 91a99b5e78849db90dc2f5e8dfa034af43bdb760 (patch) | |
tree | 27af7c91347333591d6e47e043072400ea55f74b /drivers/usb/host/ehci-sched.c | |
parent | 27c4a31d6739095d613c6e72fb44867bc28c699f (diff) | |
download | linux-stable-91a99b5e78849db90dc2f5e8dfa034af43bdb760.tar.gz linux-stable-91a99b5e78849db90dc2f5e8dfa034af43bdb760.tar.bz2 linux-stable-91a99b5e78849db90dc2f5e8dfa034af43bdb760.zip |
USB: EHCI: use consistent NO_FRAME value
ehci-hcd is inconsistent in the sentinel values it uses to indicate
that no frame number has been assigned for a periodic transfer. Some
places it uses NO_FRAME (defined as 65535), other places it uses -1,
and elsewhere it uses 9999.
This patch defines a value for NO_FRAME which can fit in a 16-bit
signed integer, and changes the code to use it everywhere.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-sched.c')
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 1fc2befc4fdc..37e97a70894a 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c @@ -813,7 +813,7 @@ static int qh_schedule(struct ehci_hcd *ehci, struct ehci_qh *qh) frame = qh->start; /* reuse the previous schedule slots, if we can */ - if (frame < qh->period) { + if (frame != NO_FRAME) { uframe = ffs(hc32_to_cpup(ehci, &hw->hw_info2) & QH_SMASK); status = check_intr_schedule (ehci, frame, --uframe, qh, &c_mask); @@ -969,7 +969,7 @@ iso_stream_alloc (gfp_t mem_flags) if (likely (stream != NULL)) { INIT_LIST_HEAD(&stream->td_list); INIT_LIST_HEAD(&stream->free_list); - stream->next_uframe = -1; + stream->next_uframe = NO_FRAME; } return stream; } @@ -1236,7 +1236,7 @@ itd_urb_transaction ( memset (itd, 0, sizeof *itd); itd->itd_dma = itd_dma; - itd->frame = 9999; /* an invalid value */ + itd->frame = NO_FRAME; list_add (&itd->itd_list, &sched->td_list); } spin_unlock_irqrestore (&ehci->lock, flags); @@ -1967,7 +1967,7 @@ sitd_urb_transaction ( memset (sitd, 0, sizeof *sitd); sitd->sitd_dma = sitd_dma; - sitd->frame = 9999; /* an invalid value */ + sitd->frame = NO_FRAME; list_add (&sitd->sitd_list, &iso_sched->td_list); } |