tty: Replace TTY_IO_ERROR bit tests with tty_io_error()
Abstract TTY_IO_ERROR status test treewide with tty_io_error(). NB: tty->flags uses atomic bit ops; replace non-atomic bit test with test_bit(). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

zatwierdzone przez
Greg Kroah-Hartman

rodzic
1aabf523a2
commit
18900ca65a
@@ -1070,7 +1070,7 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
|
||||
|
||||
if (tty_paranoia_check(tty, inode, "tty_read"))
|
||||
return -EIO;
|
||||
if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags)))
|
||||
if (!tty || tty_io_error(tty))
|
||||
return -EIO;
|
||||
|
||||
/* We want to wait for the line discipline to sort out in this
|
||||
@@ -1245,8 +1245,7 @@ static ssize_t tty_write(struct file *file, const char __user *buf,
|
||||
|
||||
if (tty_paranoia_check(tty, file_inode(file), "tty_write"))
|
||||
return -EIO;
|
||||
if (!tty || !tty->ops->write ||
|
||||
(test_bit(TTY_IO_ERROR, &tty->flags)))
|
||||
if (!tty || !tty->ops->write || tty_io_error(tty))
|
||||
return -EIO;
|
||||
/* Short term debug to catch buggy drivers */
|
||||
if (tty->ops->write_room == NULL)
|
||||
|
Reference in New Issue
Block a user