]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix sign checks in copy_from_read_buf()
authorGeorgi Guninski <guninski@guninski.com>
Wed, 2 Feb 2005 09:41:06 +0000 (01:41 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 2 Feb 2005 09:41:06 +0000 (01:41 -0800)
Fix signedness and remove the now unnecessary cast.

Acked-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/n_tty.c

index 4280394442f7104fff91b5ba4304d3a47793be42..ade7ceb51039b08cba86cefa3125cae768ce1f6c 100644 (file)
@@ -1143,13 +1143,13 @@ static inline int copy_from_read_buf(struct tty_struct *tty,
 
 {
        int retval;
-       ssize_t n;
+       size_t n;
        unsigned long flags;
 
        retval = 0;
        spin_lock_irqsave(&tty->read_lock, flags);
        n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail);
-       n = min((ssize_t)*nr, n);
+       n = min(*nr, n);
        spin_unlock_irqrestore(&tty->read_lock, flags);
        if (n) {
                mb();