From patchwork Wed May 20 18:06:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 6448341 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A3920C0433 for ; Wed, 20 May 2015 18:06:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C88042034F for ; Wed, 20 May 2015 18:06:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D96992038E for ; Wed, 20 May 2015 18:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754008AbbETSGW (ORCPT ); Wed, 20 May 2015 14:06:22 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:54985 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753042AbbETSGU (ORCPT ); Wed, 20 May 2015 14:06:20 -0400 Received: from ayla.of.borg ([84.193.93.87]) by michel.telenet-ops.be with bizsmtp id WJ6H1q0021t5w8s06J6H2M; Wed, 20 May 2015 20:06:17 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1Yv8Nk-0006Ug-Oh; Wed, 20 May 2015 20:06:16 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1Yv8Np-00031A-4L; Wed, 20 May 2015 20:06:21 +0200 From: Geert Uytterhoeven To: Magnus Damm , Laurent Pinchart , Nobuhiro Iwamatsu , Yoshihiro Kaneko , Wolfram Sang , Guennadi Liakhovetski Cc: linux-sh@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 5/8] serial: sh-sci: Use offset_in_page() helper instead of open coding Date: Wed, 20 May 2015 20:06:11 +0200 Message-Id: <1432145174-11534-6-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432145174-11534-1-git-send-email-geert+renesas@glider.be> References: <1432145174-11534-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Geert Uytterhoeven --- drivers/tty/serial/sh-sci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 73f4115159a7fbbc..d2734e13b17bf720 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1715,10 +1715,10 @@ static void sci_request_dma(struct uart_port *port) s->chan_tx = chan; sg_init_table(&s->sg_tx, 1); /* UART circular tx buffer is an aligned page. */ - BUG_ON((uintptr_t)port->state->xmit.buf & ~PAGE_MASK); + BUG_ON(offset_in_page(port->state->xmit.buf)); sg_set_page(&s->sg_tx, virt_to_page(port->state->xmit.buf), UART_XMIT_SIZE, - (uintptr_t)port->state->xmit.buf & ~PAGE_MASK); + offset_in_page(port->state->xmit.buf)); nent = dma_map_sg(chan->device->dev, &s->sg_tx, 1, DMA_TO_DEVICE); if (!nent) @@ -1768,7 +1768,7 @@ static void sci_request_dma(struct uart_port *port) sg_init_table(sg, 1); sg_set_page(sg, virt_to_page(buf[i]), s->buf_len_rx, - (uintptr_t)buf[i] & ~PAGE_MASK); + offset_in_page(buf[i])); sg_dma_address(sg) = dma[i]; }