serial: pch_uart: use offset_in_page() macro
authorGeliang Tang <geliangtang@gmail.com>
Sat, 22 Apr 2017 01:21:11 +0000 (09:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 May 2017 14:34:55 +0000 (16:34 +0200)
Use offset_in_page() macro instead of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/pch_uart.c

index 42caccb5e87eeabf732872225ef1527f427acea6..d3796dc26fa9a4e4ffd2deec9ff1053bf7a4a3a3 100644 (file)
@@ -878,8 +878,7 @@ static int dma_handle_rx(struct eg20t_port *priv)
        sg_dma_len(sg) = priv->trigger_level;
 
        sg_set_page(&priv->sg_rx, virt_to_page(priv->rx_buf_virt),
-                    sg_dma_len(sg), (unsigned long)priv->rx_buf_virt &
-                    ~PAGE_MASK);
+                    sg_dma_len(sg), offset_in_page(priv->rx_buf_virt));
 
        sg_dma_address(sg) = priv->rx_buf_dma;