From 877c98b9dc0e0a29caae78b108f7f9d5c5cd0fd4 Mon Sep 17 00:00:00 2001 From: Jon Benson Date: Sat, 30 Oct 2010 22:21:09 +1100 Subject: [PATCH] Patched tty_buffer.c based on ACE kernel. Will see if it helps smd_tty crash. --- drivers/char/tty_buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tty_buffer.c b/drivers/char/tty_buffer.c index f27c4d6d..73b60a19 100644 --- a/drivers/char/tty_buffer.c +++ b/drivers/char/tty_buffer.c @@ -247,7 +247,7 @@ int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, { int copied = 0; do { - int goal = min(size - copied, TTY_BUFFER_PAGE); + int goal = min((size_t)(size - copied), (size_t)TTY_BUFFER_PAGE); int space = tty_buffer_request_room(tty, goal); struct tty_buffer *tb = tty->buf.tail; /* If there is no space then tb may be NULL */ @@ -284,7 +284,7 @@ int tty_insert_flip_string_flags(struct tty_struct *tty, { int copied = 0; do { - int goal = min(size - copied, TTY_BUFFER_PAGE); + int goal = min((size_t)(size - copied), (size_t)TTY_BUFFER_PAGE); int space = tty_buffer_request_room(tty, goal); struct tty_buffer *tb = tty->buf.tail; /* If there is no space then tb may be NULL */