diff options
author | Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> | 2011-02-22 20:03:14 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-22 20:22:03 -0500 |
commit | 1822076cf324dde1eb9678ae2174dc8b4662417c (patch) | |
tree | b06622c7bb06a5e307cec38a659f1214d00b3b59 /drivers | |
parent | 7e4613296576c843643ceb97091d98da1e8caab8 (diff) |
pch_uart : Reduce memcpy
Reduce memcpy for performance improvement.
Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index 9e1b8652de7f..0e171b8f0700 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c | |||
@@ -390,7 +390,7 @@ static u8 pch_uart_hal_get_modem(struct eg20t_port *priv) | |||
390 | return get_msr(priv, priv->membase); | 390 | return get_msr(priv, priv->membase); |
391 | } | 391 | } |
392 | 392 | ||
393 | static int pch_uart_hal_write(struct eg20t_port *priv, | 393 | static void pch_uart_hal_write(struct eg20t_port *priv, |
394 | const unsigned char *buf, int tx_size) | 394 | const unsigned char *buf, int tx_size) |
395 | { | 395 | { |
396 | int i; | 396 | int i; |
@@ -400,7 +400,6 @@ static int pch_uart_hal_write(struct eg20t_port *priv, | |||
400 | thr = buf[i++]; | 400 | thr = buf[i++]; |
401 | iowrite8(thr, priv->membase + PCH_UART_THR); | 401 | iowrite8(thr, priv->membase + PCH_UART_THR); |
402 | } | 402 | } |
403 | return i; | ||
404 | } | 403 | } |
405 | 404 | ||
406 | static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf, | 405 | static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf, |
@@ -634,7 +633,7 @@ static void pch_dma_tx_complete(void *arg) | |||
634 | pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT); | 633 | pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_TX_INT); |
635 | } | 634 | } |
636 | 635 | ||
637 | static int pop_tx(struct eg20t_port *priv, unsigned char *buf, int size) | 636 | static int pop_tx(struct eg20t_port *priv, int size) |
638 | { | 637 | { |
639 | int count = 0; | 638 | int count = 0; |
640 | struct uart_port *port = &priv->port; | 639 | struct uart_port *port = &priv->port; |
@@ -647,7 +646,7 @@ static int pop_tx(struct eg20t_port *priv, unsigned char *buf, int size) | |||
647 | int cnt_to_end = | 646 | int cnt_to_end = |
648 | CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); | 647 | CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); |
649 | int sz = min(size - count, cnt_to_end); | 648 | int sz = min(size - count, cnt_to_end); |
650 | memcpy(&buf[count], &xmit->buf[xmit->tail], sz); | 649 | pch_uart_hal_write(priv, &xmit->buf[xmit->tail], sz); |
651 | xmit->tail = (xmit->tail + sz) & (UART_XMIT_SIZE - 1); | 650 | xmit->tail = (xmit->tail + sz) & (UART_XMIT_SIZE - 1); |
652 | count += sz; | 651 | count += sz; |
653 | } while (!uart_circ_empty(xmit) && count < size); | 652 | } while (!uart_circ_empty(xmit) && count < size); |
@@ -723,7 +722,6 @@ static unsigned int handle_tx(struct eg20t_port *priv) | |||
723 | { | 722 | { |
724 | struct uart_port *port = &priv->port; | 723 | struct uart_port *port = &priv->port; |
725 | struct circ_buf *xmit = &port->state->xmit; | 724 | struct circ_buf *xmit = &port->state->xmit; |
726 | int ret; | ||
727 | int fifo_size; | 725 | int fifo_size; |
728 | int tx_size; | 726 | int tx_size; |
729 | int size; | 727 | int size; |
@@ -748,10 +746,9 @@ static unsigned int handle_tx(struct eg20t_port *priv) | |||
748 | if (size < 0) | 746 | if (size < 0) |
749 | size = fifo_size; | 747 | size = fifo_size; |
750 | 748 | ||
751 | tx_size = pop_tx(priv, xmit->buf, size); | 749 | tx_size = pop_tx(priv, size); |
752 | if (tx_size > 0) { | 750 | if (tx_size > 0) { |
753 | ret = pch_uart_hal_write(priv, xmit->buf, tx_size); | 751 | port->icount.tx += tx_size; |
754 | port->icount.tx += ret; | ||
755 | tx_empty = 0; | 752 | tx_empty = 0; |
756 | } | 753 | } |
757 | 754 | ||