mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>
Cc: Geliang Tang <geliangtang@gmail.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] serial: pch_uart: use offset_in_page() macro
Date: Sat, 22 Apr 2017 09:21:11 +0800	[thread overview]
Message-ID: <dd629376828f23645aff2d8ba663ed1340ec33e9.1492759587.git.geliangtang@gmail.com> (raw)
In-Reply-To: <4dbc77ccaaed98b183cf4dba58a4fa325fd65048.1492758503.git.geliangtang@gmail.com>

Use offset_in_page() macro instead of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 drivers/tty/serial/pch_uart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 42caccb..d3796dc 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -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;
 
-- 
2.9.3

  parent reply	other threads:[~2017-04-22  1:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-22  1:21 [PATCH] fs/ocfs2/cluster: " 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 ` Geliang Tang [this message]
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
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=dd629376828f23645aff2d8ba663ed1340ec33e9.1492759587.git.geliangtang@gmail.com \
    --to=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

all inboxes | Powered by JetHome®