diff options
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 7d8103cd3e2e..6e5ce628b4eb 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -557,7 +557,7 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
557 | return 1; | 557 | return 1; |
558 | 558 | ||
559 | /* Cast for ARM damage */ | 559 | /* Cast for ARM damage */ |
560 | return !!__raw_readb((void __iomem *)s->cfg->port_reg); | 560 | return !!__raw_readb((void __iomem *)(uintptr_t)s->cfg->port_reg); |
561 | } | 561 | } |
562 | 562 | ||
563 | /* ********************************************************************** * | 563 | /* ********************************************************************** * |
@@ -1309,7 +1309,7 @@ static int sci_dma_rx_push(struct sci_port *s, size_t count) | |||
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | if (room < count) | 1311 | if (room < count) |
1312 | dev_warn(port->dev, "Rx overrun: dropping %u bytes\n", | 1312 | dev_warn(port->dev, "Rx overrun: dropping %zu bytes\n", |
1313 | count - room); | 1313 | count - room); |
1314 | if (!room) | 1314 | if (!room) |
1315 | return room; | 1315 | return room; |
@@ -1442,7 +1442,7 @@ static void work_fn_rx(struct work_struct *work) | |||
1442 | int count; | 1442 | int count; |
1443 | 1443 | ||
1444 | chan->device->device_control(chan, DMA_TERMINATE_ALL, 0); | 1444 | chan->device->device_control(chan, DMA_TERMINATE_ALL, 0); |
1445 | dev_dbg(port->dev, "Read %u bytes with cookie %d\n", | 1445 | dev_dbg(port->dev, "Read %zu bytes with cookie %d\n", |
1446 | sh_desc->partial, sh_desc->cookie); | 1446 | sh_desc->partial, sh_desc->cookie); |
1447 | 1447 | ||
1448 | spin_lock_irqsave(&port->lock, flags); | 1448 | spin_lock_irqsave(&port->lock, flags); |
@@ -1691,16 +1691,17 @@ static void sci_request_dma(struct uart_port *port) | |||
1691 | s->chan_tx = chan; | 1691 | s->chan_tx = chan; |
1692 | sg_init_table(&s->sg_tx, 1); | 1692 | sg_init_table(&s->sg_tx, 1); |
1693 | /* UART circular tx buffer is an aligned page. */ | 1693 | /* UART circular tx buffer is an aligned page. */ |
1694 | BUG_ON((int)port->state->xmit.buf & ~PAGE_MASK); | 1694 | BUG_ON((uintptr_t)port->state->xmit.buf & ~PAGE_MASK); |
1695 | sg_set_page(&s->sg_tx, virt_to_page(port->state->xmit.buf), | 1695 | sg_set_page(&s->sg_tx, virt_to_page(port->state->xmit.buf), |
1696 | UART_XMIT_SIZE, (int)port->state->xmit.buf & ~PAGE_MASK); | 1696 | UART_XMIT_SIZE, |
1697 | (uintptr_t)port->state->xmit.buf & ~PAGE_MASK); | ||
1697 | nent = dma_map_sg(port->dev, &s->sg_tx, 1, DMA_TO_DEVICE); | 1698 | nent = dma_map_sg(port->dev, &s->sg_tx, 1, DMA_TO_DEVICE); |
1698 | if (!nent) | 1699 | if (!nent) |
1699 | sci_tx_dma_release(s, false); | 1700 | sci_tx_dma_release(s, false); |
1700 | else | 1701 | else |
1701 | dev_dbg(port->dev, "%s: mapped %d@%p to %x\n", __func__, | 1702 | dev_dbg(port->dev, "%s: mapped %d@%p to %pad\n", __func__, |
1702 | sg_dma_len(&s->sg_tx), | 1703 | sg_dma_len(&s->sg_tx), port->state->xmit.buf, |
1703 | port->state->xmit.buf, sg_dma_address(&s->sg_tx)); | 1704 | &sg_dma_address(&s->sg_tx)); |
1704 | 1705 | ||
1705 | s->sg_len_tx = nent; | 1706 | s->sg_len_tx = nent; |
1706 | 1707 | ||
@@ -1740,7 +1741,7 @@ static void sci_request_dma(struct uart_port *port) | |||
1740 | 1741 | ||
1741 | sg_init_table(sg, 1); | 1742 | sg_init_table(sg, 1); |
1742 | sg_set_page(sg, virt_to_page(buf[i]), s->buf_len_rx, | 1743 | sg_set_page(sg, virt_to_page(buf[i]), s->buf_len_rx, |
1743 | (int)buf[i] & ~PAGE_MASK); | 1744 | (uintptr_t)buf[i] & ~PAGE_MASK); |
1744 | sg_dma_address(sg) = dma[i]; | 1745 | sg_dma_address(sg) = dma[i]; |
1745 | } | 1746 | } |
1746 | 1747 | ||