All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC v2 09/29] serial: sh-sci: Use sg_init_one() helper instead of open coding
@ 2015-07-16 18:21 Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2015-07-16 18:21 UTC (permalink / raw
  To: linux-sh

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Note: There's another sg_init_table()/sg_set_page() combo in
      sci_request_dma() that looks eligible for conversion to
      sg_init_one().
      However, that one operates on memory allocated by
      dma_alloc_coherent(), which triggers the

	  BUG_ON(!virt_addr_valid(buf));

      in sg_set_buf() if CONFIG_DEBUG_SG=y. Sigh...
---
 drivers/tty/serial/sh-sci.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index d6ee645de1d40794..36a1d1735dd562cd 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1713,12 +1713,9 @@ static void sci_request_dma(struct uart_port *port)
 	dev_dbg(port->dev, "%s: TX: got channel %p\n", __func__, chan);
 	if (chan) {
 		s->chan_tx = chan;
-		sg_init_table(&s->sg_tx, 1);
 		/* UART circular tx buffer is an aligned page. */
 		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,
-			    offset_in_page(port->state->xmit.buf));
+		sg_init_one(&s->sg_tx, port->state->xmit.buf, UART_XMIT_SIZE);
 		nent = dma_map_sg(chan->device->dev, &s->sg_tx, 1,
 				  DMA_TO_DEVICE);
 		if (!nent)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-16 18:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16 18:21 [PATCH/RFC v2 09/29] serial: sh-sci: Use sg_init_one() helper instead of open coding Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.