Skip to content

Commit

Permalink
tty_buffer: Fix distinct type warning
Browse files Browse the repository at this point in the history
CC      drivers/char/tty_buffer.o
drivers/char/tty_buffer.c: In function ‘tty_insert_flip_string_fixed_flag’:
drivers/char/tty_buffer.c:251: warning: comparison of distinct pointer types lacks a cast
drivers/char/tty_buffer.c: In function ‘tty_insert_flip_string_flags’:
drivers/char/tty_buffer.c:288: warning: comparison of distinct pointer types lacks a cast

Fix it by replacing min() with min_t() in tty_insert_flip_string_flags and
					  tty_insert_flip_string_fixed_flag().

Signed-off-by: Fang Wenqi <antonf@turbolinux.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Fang Wenqi authored and Greg Kroah-Hartman committed Mar 19, 2010
1 parent e74d098 commit d4bee0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/tty_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit d4bee0a

Please sign in to comment.