All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 13/21] Char: cyclades, fix blockmove
Date: Sun, 29 Apr 2007 23:01:52 +0200 (CEST)	[thread overview]
Message-ID: <181033173971179592@wsc.cz> (raw)
In-Reply-To: <1726067771982725064@wsc.cz>

cyclades, fix blockmove

tty has no longer flip buffers accessible externally. Fix it by moving the
code to the tty_*flip* helpers.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit 147542c38691d4e5049b916b083dc93bc3bf8c3b
tree 8986e0764afc717d7d283326b87aa5e3dff8b052
parent 300e8efee2151f3bd26ed824f932fba53a7313f4
author Jiri Slaby <jirislaby@gmail.com> Fri, 27 Apr 2007 15:48:28 +0200
committer Jiri Slaby <jirislaby@gmail.com> Sat, 28 Apr 2007 23:48:17 +0200

 drivers/char/cyclades.c |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index c236e9f..9160953 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -1560,7 +1560,7 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
 	int char_count;
 	int len;
 #ifdef BLOCKMOVE
-	int small_count;
+	unsigned char *buf;
 #else
 	char data;
 #endif
@@ -1596,25 +1596,23 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
 		/* we'd like to use memcpy(t, f, n) and memset(s, c, count)
 		   for performance, but because of buffer boundaries, there
 		   may be several steps to the operation */
-			while (0 < (small_count = min_t(unsigned int,
-					rx_bufsize - new_rx_get,
-					min_t(unsigned int, TTY_FLIPBUF_SIZE -
-						tty->flip.count, char_count)))){
-				memcpy_fromio(tty->flip.char_buf_ptr,
-					(char *)(cinfo->base_addr + rx_bufaddr +
-						new_rx_get),
-					small_count);
+			while (1) {
+				len = tty_prepare_flip_string(tty, &buf,
+						char_count);
+				if (!len)
+					break;
 
-				tty->flip.char_buf_ptr += small_count;
-				memset(tty->flip.flag_buf_ptr, TTY_NORMAL,
-					small_count);
-				tty->flip.flag_buf_ptr += small_count;
-				new_rx_get = (new_rx_get + small_count) &
+				len = min_t(unsigned int, min(len, char_count),
+						rx_bufsize - new_rx_get);
+
+				memcpy_fromio(buf, cinfo->base_addr +
+						rx_bufaddr + new_rx_get, len);
+
+				new_rx_get = (new_rx_get + len) &
 						(rx_bufsize - 1);
-				char_count -= small_count;
-				info->icount.rx += small_count;
-				info->idle_stats.recv_bytes += small_count;
-				tty->flip.count += small_count;
+				char_count -= len;
+				info->icount.rx += len;
+				info->idle_stats.recv_bytes += len;
 			}
 #else
 			len = tty_buffer_request_room(tty, char_count);

  parent reply	other threads:[~2007-04-29 21:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-29 20:53 [PATCH 1/21] Char: cyclades, use IS_CYC_Z macro Jiri Slaby
2007-04-29 20:54 ` [PATCH 2/21] Char: cyclades, switch to pci probing Jiri Slaby
2007-04-29 20:54 ` [PATCH 3/21] Char: cyclades, depends on PCI or ISA Jiri Slaby
2007-04-29 20:55 ` [PATCH 4/21] Char: cyclades, unexport struct cyclades_card Jiri Slaby
2007-04-29 20:56 ` [PATCH 5/21] Char: cyclades, remove useless fileds from cyclades_card Jiri Slaby
2007-04-29 20:57 ` [PATCH 6/21] Char: cyclades, irq is int Jiri Slaby
2007-04-29 20:57 ` [PATCH 7/21] Char: cyclades, printk cleanups Jiri Slaby
2007-04-29 20:58 ` [PATCH 8/21] Char: cyclades, mark cyy_init_card as __devinit, not __init Jiri Slaby
2007-04-29 20:59 ` [PATCH 9/21] Char: cyclades, simplify variables initialization Jiri Slaby
2007-04-29 20:59 ` [PATCH 10/21] Char: cyclades, get rid of phys addresses Jiri Slaby
2007-04-29 21:00 ` [PATCH 11/21] Char: cyclades, make info->card a pointer Jiri Slaby
2007-04-29 21:01 ` [PATCH 12/21] Char: cyclades, remove sleep_on Jiri Slaby
2007-04-29 21:01 ` Jiri Slaby [this message]
2007-04-29 21:02 ` [PATCH 14/21] Char: cyclades, timers cleanup Jiri Slaby
2007-04-29 21:03 ` [PATCH 15/21] Char: cyclades, remove unused timestamps Jiri Slaby
2007-04-29 21:03 ` [PATCH 16/21] Char: cyclades, remove locking macros Jiri Slaby
2007-04-29 21:04 ` [PATCH 17/21] Char: cyclades, conditions cleanup Jiri Slaby
2007-04-29 21:05 ` [PATCH 18/21] Char: cyclades, fix tty device unregister Jiri Slaby
2007-04-29 21:06 ` [PATCH 19/21] Char: cyclades, dynamic ports Jiri Slaby
2007-04-29 21:06 ` [PATCH 20/21] Char: cyclades, probe cleanup Jiri Slaby
2007-04-29 21:07 ` [PATCH 21/21] Char: cyclades, copyright and version changes Jiri Slaby
2007-05-02 15:57 ` [PATCH 1/21] Char: cyclades, use IS_CYC_Z macro Jiri Slaby
2007-05-02 19:47   ` Andrew Morton

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=181033173971179592@wsc.cz \
    --to=jirislaby@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@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 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.