diff options
| author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-12-11 07:40:31 -0500 |
|---|---|---|
| committer | Simon Horman <horms+renesas@verge.net.au> | 2013-12-12 08:14:49 -0500 |
| commit | e2afca6988c335d2ec7b66f2fadcd63286570bf8 (patch) | |
| tree | ded4a896a5c13a2cedd26f9c745288aa48b67bcd | |
| parent | 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff) | |
serial: sh-sci: Fix warnings due to improper casts and printk formats
Use the %zu and %pad printk specifiers to print size_t and dma_addr_t
variables, and cast pointers to uintptr_t instead of unsigned int where
applicable. This fixes warnings on platforms where pointers and/or
dma_addr_t have a different size than int.
Cc: linux-serial@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
| -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 | ||
