diff options
author | Jiri Slaby <jslaby@suse.cz> | 2011-11-09 15:33:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-15 18:52:48 -0500 |
commit | 9de44bd604ccdd25f8ffb04d828080f210679266 (patch) | |
tree | 50a37de3d70e616d9ec2b36bc450e2d061215289 /drivers/tty/tty_io.c | |
parent | 955787ca94a17bdfd00e369a21ceb97aa21792fc (diff) |
TTY: open/release, cleanup printks
* use __func__ instead of hardcoded names (tty_release_dev is a
non-existant function)
* add missing \n's
* unwrap for better grepping
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r-- | drivers/tty/tty_io.c | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index b874b6d1b0be..57c374399f59 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -1570,8 +1570,8 @@ static int tty_release_checks(struct tty_struct *tty, struct tty_struct *o_tty, | |||
1570 | { | 1570 | { |
1571 | #ifdef TTY_PARANOIA_CHECK | 1571 | #ifdef TTY_PARANOIA_CHECK |
1572 | if (idx < 0 || idx >= tty->driver->num) { | 1572 | if (idx < 0 || idx >= tty->driver->num) { |
1573 | printk(KERN_DEBUG "tty_release_dev: bad idx when trying to " | 1573 | printk(KERN_DEBUG "%s: bad idx when trying to free (%s)\n", |
1574 | "free (%s)\n", tty->name); | 1574 | __func__, tty->name); |
1575 | return -1; | 1575 | return -1; |
1576 | } | 1576 | } |
1577 | 1577 | ||
@@ -1580,31 +1580,28 @@ static int tty_release_checks(struct tty_struct *tty, struct tty_struct *o_tty, | |||
1580 | return 0; | 1580 | return 0; |
1581 | 1581 | ||
1582 | if (tty != tty->driver->ttys[idx]) { | 1582 | if (tty != tty->driver->ttys[idx]) { |
1583 | printk(KERN_DEBUG "tty_release_dev: driver.table[%d] not tty " | 1583 | printk(KERN_DEBUG "%s: driver.table[%d] not tty for (%s)\n", |
1584 | "for (%s)\n", idx, tty->name); | 1584 | __func__, idx, tty->name); |
1585 | return -1; | 1585 | return -1; |
1586 | } | 1586 | } |
1587 | if (tty->termios != tty->driver->termios[idx]) { | 1587 | if (tty->termios != tty->driver->termios[idx]) { |
1588 | printk(KERN_DEBUG "tty_release_dev: driver.termios[%d] not termios " | 1588 | printk(KERN_DEBUG "%s: driver.termios[%d] not termios for (%s)\n", |
1589 | "for (%s)\n", | 1589 | __func__, idx, tty->name); |
1590 | idx, tty->name); | ||
1591 | return -1; | 1590 | return -1; |
1592 | } | 1591 | } |
1593 | if (tty->driver->other) { | 1592 | if (tty->driver->other) { |
1594 | if (o_tty != tty->driver->other->ttys[idx]) { | 1593 | if (o_tty != tty->driver->other->ttys[idx]) { |
1595 | printk(KERN_DEBUG "tty_release_dev: other->table[%d] " | 1594 | printk(KERN_DEBUG "%s: other->table[%d] not o_tty for (%s)\n", |
1596 | "not o_tty for (%s)\n", | 1595 | __func__, idx, tty->name); |
1597 | idx, tty->name); | ||
1598 | return -1; | 1596 | return -1; |
1599 | } | 1597 | } |
1600 | if (o_tty->termios != tty->driver->other->termios[idx]) { | 1598 | if (o_tty->termios != tty->driver->other->termios[idx]) { |
1601 | printk(KERN_DEBUG "tty_release_dev: other->termios[%d] " | 1599 | printk(KERN_DEBUG "%s: other->termios[%d] not o_termios for (%s)\n", |
1602 | "not o_termios for (%s)\n", | 1600 | __func__, idx, tty->name); |
1603 | idx, tty->name); | ||
1604 | return -1; | 1601 | return -1; |
1605 | } | 1602 | } |
1606 | if (o_tty->link != tty) { | 1603 | if (o_tty->link != tty) { |
1607 | printk(KERN_DEBUG "tty_release_dev: bad pty pointers\n"); | 1604 | printk(KERN_DEBUG "%s: bad pty pointers\n", __func__); |
1608 | return -1; | 1605 | return -1; |
1609 | } | 1606 | } |
1610 | } | 1607 | } |
@@ -1640,11 +1637,11 @@ int tty_release(struct inode *inode, struct file *filp) | |||
1640 | int idx; | 1637 | int idx; |
1641 | char buf[64]; | 1638 | char buf[64]; |
1642 | 1639 | ||
1643 | if (tty_paranoia_check(tty, inode, "tty_release_dev")) | 1640 | if (tty_paranoia_check(tty, inode, __func__)) |
1644 | return 0; | 1641 | return 0; |
1645 | 1642 | ||
1646 | tty_lock(); | 1643 | tty_lock(); |
1647 | check_tty_count(tty, "tty_release_dev"); | 1644 | check_tty_count(tty, __func__); |
1648 | 1645 | ||
1649 | __tty_fasync(-1, filp, 0); | 1646 | __tty_fasync(-1, filp, 0); |
1650 | 1647 | ||
@@ -1660,8 +1657,8 @@ int tty_release(struct inode *inode, struct file *filp) | |||
1660 | } | 1657 | } |
1661 | 1658 | ||
1662 | #ifdef TTY_DEBUG_HANGUP | 1659 | #ifdef TTY_DEBUG_HANGUP |
1663 | printk(KERN_DEBUG "tty_release_dev of %s (tty count=%d)...", | 1660 | printk(KERN_DEBUG "%s: %s (tty count=%d)...\n", __func__, |
1664 | tty_name(tty, buf), tty->count); | 1661 | tty_name(tty, buf), tty->count); |
1665 | #endif | 1662 | #endif |
1666 | 1663 | ||
1667 | if (tty->ops->close) | 1664 | if (tty->ops->close) |
@@ -1719,8 +1716,8 @@ int tty_release(struct inode *inode, struct file *filp) | |||
1719 | if (!do_sleep) | 1716 | if (!do_sleep) |
1720 | break; | 1717 | break; |
1721 | 1718 | ||
1722 | printk(KERN_WARNING "tty_release_dev: %s: read/write wait queue " | 1719 | printk(KERN_WARNING "%s: %s: read/write wait queue active!\n", |
1723 | "active!\n", tty_name(tty, buf)); | 1720 | __func__, tty_name(tty, buf)); |
1724 | tty_unlock(); | 1721 | tty_unlock(); |
1725 | mutex_unlock(&tty_mutex); | 1722 | mutex_unlock(&tty_mutex); |
1726 | schedule(); | 1723 | schedule(); |
@@ -1733,15 +1730,14 @@ int tty_release(struct inode *inode, struct file *filp) | |||
1733 | */ | 1730 | */ |
1734 | if (pty_master) { | 1731 | if (pty_master) { |
1735 | if (--o_tty->count < 0) { | 1732 | if (--o_tty->count < 0) { |
1736 | printk(KERN_WARNING "tty_release_dev: bad pty slave count " | 1733 | printk(KERN_WARNING "%s: bad pty slave count (%d) for %s\n", |
1737 | "(%d) for %s\n", | 1734 | __func__, o_tty->count, tty_name(o_tty, buf)); |
1738 | o_tty->count, tty_name(o_tty, buf)); | ||
1739 | o_tty->count = 0; | 1735 | o_tty->count = 0; |
1740 | } | 1736 | } |
1741 | } | 1737 | } |
1742 | if (--tty->count < 0) { | 1738 | if (--tty->count < 0) { |
1743 | printk(KERN_WARNING "tty_release_dev: bad tty->count (%d) for %s\n", | 1739 | printk(KERN_WARNING "%s: bad tty->count (%d) for %s\n", |
1744 | tty->count, tty_name(tty, buf)); | 1740 | __func__, tty->count, tty_name(tty, buf)); |
1745 | tty->count = 0; | 1741 | tty->count = 0; |
1746 | } | 1742 | } |
1747 | 1743 | ||
@@ -1790,7 +1786,7 @@ int tty_release(struct inode *inode, struct file *filp) | |||
1790 | } | 1786 | } |
1791 | 1787 | ||
1792 | #ifdef TTY_DEBUG_HANGUP | 1788 | #ifdef TTY_DEBUG_HANGUP |
1793 | printk(KERN_DEBUG "freeing tty structure..."); | 1789 | printk(KERN_DEBUG "%s: freeing tty structure...\n", __func__); |
1794 | #endif | 1790 | #endif |
1795 | /* | 1791 | /* |
1796 | * Ask the line discipline code to release its structures | 1792 | * Ask the line discipline code to release its structures |
@@ -1967,12 +1963,12 @@ retry_open: | |||
1967 | 1963 | ||
1968 | tty_add_file(tty, filp); | 1964 | tty_add_file(tty, filp); |
1969 | 1965 | ||
1970 | check_tty_count(tty, "tty_open"); | 1966 | check_tty_count(tty, __func__); |
1971 | if (tty->driver->type == TTY_DRIVER_TYPE_PTY && | 1967 | if (tty->driver->type == TTY_DRIVER_TYPE_PTY && |
1972 | tty->driver->subtype == PTY_TYPE_MASTER) | 1968 | tty->driver->subtype == PTY_TYPE_MASTER) |
1973 | noctty = 1; | 1969 | noctty = 1; |
1974 | #ifdef TTY_DEBUG_HANGUP | 1970 | #ifdef TTY_DEBUG_HANGUP |
1975 | printk(KERN_DEBUG "opening %s...", tty->name); | 1971 | printk(KERN_DEBUG "%s: opening %s...\n", __func__, tty->name); |
1976 | #endif | 1972 | #endif |
1977 | if (tty->ops->open) | 1973 | if (tty->ops->open) |
1978 | retval = tty->ops->open(tty, filp); | 1974 | retval = tty->ops->open(tty, filp); |
@@ -1986,8 +1982,8 @@ retry_open: | |||
1986 | 1982 | ||
1987 | if (retval) { | 1983 | if (retval) { |
1988 | #ifdef TTY_DEBUG_HANGUP | 1984 | #ifdef TTY_DEBUG_HANGUP |
1989 | printk(KERN_DEBUG "error %d in opening %s...", retval, | 1985 | printk(KERN_DEBUG "%s: error %d in opening %s...\n", __func__, |
1990 | tty->name); | 1986 | retval, tty->name); |
1991 | #endif | 1987 | #endif |
1992 | tty_unlock(); /* need to call tty_release without BTM */ | 1988 | tty_unlock(); /* need to call tty_release without BTM */ |
1993 | tty_release(inode, filp); | 1989 | tty_release(inode, filp); |