public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Genoud <richard.genoud@gmail.com>
To: Geliang Tang <geliangtang@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] tty/serial: atmel: use offset_in_page() macro
Date: Tue, 2 May 2017 10:47:51 +0200	[thread overview]
Message-ID: <54d4b9f3-7aca-ff76-9424-25856e923704@gmail.com> (raw)
In-Reply-To: <4467961523eb25226f3dc7b570c98208f31a9750.1493187215.git.geliangtang@gmail.com>

On 29/04/2017 03:39, Geliang Tang wrote:
> Use offset_in_page() macro instead of open-coding.
> 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Acked-by: Richard Genoud <richard.genoud@gmail.com>

> ---
> Changes in v2:
>  - include mm.h
> ---
>  drivers/tty/serial/atmel_serial.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index c355ac9..d25f044 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -46,6 +46,7 @@
>  #include <linux/err.h>
>  #include <linux/irq.h>
>  #include <linux/suspend.h>
> +#include <linux/mm.h>
>  
>  #include <asm/io.h>
>  #include <asm/ioctls.h>
> @@ -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,
> 

Thanks !

  reply	other threads:[~2017-05-02  8:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-22  1:21 [PATCH] fs/ocfs2/cluster: use offset_in_page() macro Geliang Tang
2017-04-22  1:21 ` [PATCH] gdth: " Geliang Tang
2017-04-22  1:21 ` [PATCH] net: atheros: atl1: " Geliang Tang
2017-04-24 17:58   ` David Miller
2017-04-22  1:21 ` [PATCH] serial: pch_uart: " Geliang Tang
2017-04-22  1:21 ` [PATCH] tty/serial: atmel: " Geliang Tang
2017-04-24  7:12   ` Richard Genoud
2017-04-29  1:39     ` [PATCH v2] " Geliang Tang
2017-05-02  8:47       ` Richard Genoud [this message]
2017-04-22  1:21 ` [PATCH] xen/scsifront: " Geliang Tang
2017-04-24  5:05   ` Juergen Gross
2017-04-24 22:15     ` Martin K. Petersen
2017-04-25  5:07       ` Juergen Gross
2017-04-25  6:58   ` Juergen Gross
2017-04-22  1:21 ` [PATCH] xprtrdma: " Geliang Tang
2017-04-22  3:37   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54d4b9f3-7aca-ff76-9424-25856e923704@gmail.com \
    --to=richard.genoud@gmail.com \
    --cc=geliangtang@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox