Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
[pandora-kernel.git] / drivers / char / tty_buffer.c
index af8d977..cc1e985 100644 (file)
@@ -238,7 +238,7 @@ EXPORT_SYMBOL_GPL(tty_buffer_request_room);
  *     @size: size
  *
  *     Queue a series of bytes to the tty buffering. All the characters
- *     passed are marked as without error. Returns the number added.
+ *     passed are marked with the supplied flag. Returns the number added.
  *
  *     Locking: Called functions may take tty->buf.lock
  */
@@ -248,7 +248,7 @@ int tty_insert_flip_string_fixed_flag(struct tty_struct *tty,
 {
        int copied = 0;
        do {
-               int goal = min(size - copied, TTY_BUFFER_PAGE);
+               int goal = min_t(size_t, size - copied, 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 */
@@ -285,7 +285,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_t(size_t, size - copied, 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 */