From: Geliang Tang Date: Sat, 29 Apr 2017 01:39:00 +0000 (+0800) Subject: tty/serial: atmel: use offset_in_page() macro X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b5cf14bd0c82164eb3689dd4cfb67a78a23302c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git tty/serial: atmel: use offset_in_page() macro Use offset_in_page() macro instead of open-coding. Signed-off-by: Geliang Tang Acked-by: Richard Genoud Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index c355ac9abafc..d25f044158ff 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -959,7 +960,7 @@ static int atmel_prepare_tx_dma(struct uart_port *port) sg_set_page(&atmel_port->sg_tx, virt_to_page(port->state->xmit.buf), UART_XMIT_SIZE, - (unsigned long)port->state->xmit.buf & ~PAGE_MASK); + offset_in_page(port->state->xmit.buf)); nent = dma_map_sg(port->dev, &atmel_port->sg_tx, 1, @@ -1141,7 +1142,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port) sg_set_page(&atmel_port->sg_rx, virt_to_page(ring->buf), 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, &atmel_port->sg_rx, 1,