Skip to content

Commit

Permalink
staging: dwc2: add missing shift
Browse files Browse the repository at this point in the history
This line extracted the available queue space without properly shifting
it. Since the code only cared wether it was zero or not, it worked as
expected without the shift, but adding shift makes the code cleaner.

While we're here, store the result in a helper variable that was already
declared to increase readability a bit more.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Matthijs Kooijman authored and Greg Kroah-Hartman committed Aug 30, 2013
1 parent d6ec53e commit acdb904
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/dwc2/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,9 @@ static void dwc2_process_periodic_channels(struct dwc2_hsotg *hsotg)
qh_ptr = hsotg->periodic_sched_assigned.next;
while (qh_ptr != &hsotg->periodic_sched_assigned) {
tx_status = readl(hsotg->regs + HPTXSTS);
if ((tx_status & TXSTS_QSPCAVAIL_MASK) == 0) {
qspcavail = (tx_status & TXSTS_QSPCAVAIL_MASK) >>
TXSTS_QSPCAVAIL_SHIFT;
if (qspcavail == 0) {
no_queue_space = 1;
break;
}
Expand Down

0 comments on commit acdb904

Please sign in to comment.