提交 2b5cf14b 编写于 作者: G Geliang Tang 提交者: Greg Kroah-Hartman

tty/serial: atmel: use offset_in_page() macro

Use offset_in_page() macro instead of open-coding.
Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
Acked-by: NRichard Genoud <richard.genoud@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 228a9ff8
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/mm.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/ioctls.h> #include <asm/ioctls.h>
...@@ -959,7 +960,7 @@ static int atmel_prepare_tx_dma(struct uart_port *port) ...@@ -959,7 +960,7 @@ static int atmel_prepare_tx_dma(struct uart_port *port)
sg_set_page(&atmel_port->sg_tx, sg_set_page(&atmel_port->sg_tx,
virt_to_page(port->state->xmit.buf), virt_to_page(port->state->xmit.buf),
UART_XMIT_SIZE, UART_XMIT_SIZE,
(unsigned long)port->state->xmit.buf & ~PAGE_MASK); offset_in_page(port->state->xmit.buf));
nent = dma_map_sg(port->dev, nent = dma_map_sg(port->dev,
&atmel_port->sg_tx, &atmel_port->sg_tx,
1, 1,
...@@ -1141,7 +1142,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port) ...@@ -1141,7 +1142,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
sg_set_page(&atmel_port->sg_rx, sg_set_page(&atmel_port->sg_rx,
virt_to_page(ring->buf), virt_to_page(ring->buf),
sizeof(struct atmel_uart_char) * ATMEL_SERIAL_RINGSIZE, sizeof(struct atmel_uart_char) * ATMEL_SERIAL_RINGSIZE,
(unsigned long)ring->buf & ~PAGE_MASK); offset_in_page(ring->buf));
nent = dma_map_sg(port->dev, nent = dma_map_sg(port->dev,
&atmel_port->sg_rx, &atmel_port->sg_rx,
1, 1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册