Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce71b0ffd01b0917a74c03562aaa110a71a0ee29
Commit:     ce71b0ffd01b0917a74c03562aaa110a71a0ee29
Parent:     2c7fea992104b5ca2b510d585a27b3ba018b795f
Author:     Jiri Slaby <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:36:53 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:25 2007 -0700

    Char: 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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to