aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-02-06 03:19:15 -0500
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:17:08 -0400
commit37730eccf214ec343b7b0e6cce31400f56ca09ff (patch)
tree1eb62faacf7ba724bf06199bcf0a696ee417c304 /drivers/usb/musb/musb_gadget.c
parentcc5060366b3c8cc20f0f4020a15fa5d39f4dc936 (diff)
usb: musb: gadget: fix compile warning
Fix the following compile warning: drivers/usb/musb/musb_gadget.c: In function ‘rxstate’: drivers/usb/musb/musb_gadget.c:714:22: warning: comparison of distinct pointer types lacks a cast [enabled by default] Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_gadget.c')
-rw-r--r--drivers/usb/musb/musb_gadget.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index b47f66d32b40..d35a375c6070 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -627,7 +627,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
627 struct dma_controller *c; 627 struct dma_controller *c;
628 struct dma_channel *channel; 628 struct dma_channel *channel;
629 int use_dma = 0; 629 int use_dma = 0;
630 int transfer_size; 630 unsigned int transfer_size;
631 631
632 c = musb->dma_controller; 632 c = musb->dma_controller;
633 channel = musb_ep->dma; 633 channel = musb_ep->dma;
@@ -669,10 +669,11 @@ static void rxstate(struct musb *musb, struct musb_request *req)
669 csr | MUSB_RXCSR_DMAMODE); 669 csr | MUSB_RXCSR_DMAMODE);
670 musb_writew(epio, MUSB_RXCSR, csr); 670 musb_writew(epio, MUSB_RXCSR, csr);
671 671
672 transfer_size = min(request->length - request->actual, 672 transfer_size = min_t(unsigned int,
673 request->length -
674 request->actual,
673 channel->max_len); 675 channel->max_len);
674 musb_ep->dma->desired_mode = 1; 676 musb_ep->dma->desired_mode = 1;
675
676 } else { 677 } else {
677 if (!musb_ep->hb_mult && 678 if (!musb_ep->hb_mult &&
678 musb_ep->hw_ep->rx_double_buffered) 679 musb_ep->hw_ep->rx_double_buffered)
@@ -702,7 +703,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
702 703
703 struct dma_controller *c; 704 struct dma_controller *c;
704 struct dma_channel *channel; 705 struct dma_channel *channel;
705 int transfer_size = 0; 706 unsigned int transfer_size = 0;
706 707
707 c = musb->dma_controller; 708 c = musb->dma_controller;
708 channel = musb_ep->dma; 709 channel = musb_ep->dma;
@@ -711,11 +712,13 @@ static void rxstate(struct musb *musb, struct musb_request *req)
711 if (fifo_count < musb_ep->packet_sz) 712 if (fifo_count < musb_ep->packet_sz)
712 transfer_size = fifo_count; 713 transfer_size = fifo_count;
713 else if (request->short_not_ok) 714 else if (request->short_not_ok)
714 transfer_size = min(request->length - 715 transfer_size = min_t(unsigned int,
716 request->length -
715 request->actual, 717 request->actual,
716 channel->max_len); 718 channel->max_len);
717 else 719 else
718 transfer_size = min(request->length - 720 transfer_size = min_t(unsigned int,
721 request->length -
719 request->actual, 722 request->actual,
720 (unsigned)fifo_count); 723 (unsigned)fifo_count);
721 724