aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-10-16 14:19:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-05 19:15:43 -0500
commit369e2b84e4eed08e5368abc3bc4277d500a186ea (patch)
tree10e8cb160da1253528b709d965b9ec379df39d7b /drivers/tty/tty_io.c
parent91f189de4640a6531a00fbc6a6c6adc7804af1e9 (diff)
tty: Remove sparse lock annotations from tty_write_lock()/_unlock()
sparse lock annotations cannot represent conditional acquire, such as mutex_lock_interruptible() or mutex_trylock(), and produce sparse warnings at _every_ correct call site. Remove lock annotations from tty_write_lock() and tty_write_unlock(). Fixes sparse warnings: drivers/tty/tty_io.c:1083:13: warning: context imbalance in 'tty_write_unlock' - wrong count at exit drivers/tty/tty_io.c:1090:12: warning: context imbalance in 'tty_write_lock' - wrong count at exit drivers/tty/tty_io.c:1211:17: warning: context imbalance in 'tty_write_message' - unexpected unlock drivers/tty/tty_io.c:1233:16: warning: context imbalance in 'tty_write' - different lock contexts for basic block drivers/tty/tty_io.c:1285:5: warning: context imbalance in 'tty_send_xchar' - different lock contexts for basic block drivers/tty/tty_io.c:2653:12: warning: context imbalance in 'send_break' - different lock contexts for basic block Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 16a2c0237dd6..c322e7af7373 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1024,14 +1024,12 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
1024} 1024}
1025 1025
1026static void tty_write_unlock(struct tty_struct *tty) 1026static void tty_write_unlock(struct tty_struct *tty)
1027 __releases(&tty->atomic_write_lock)
1028{ 1027{
1029 mutex_unlock(&tty->atomic_write_lock); 1028 mutex_unlock(&tty->atomic_write_lock);
1030 wake_up_interruptible_poll(&tty->write_wait, POLLOUT); 1029 wake_up_interruptible_poll(&tty->write_wait, POLLOUT);
1031} 1030}
1032 1031
1033static int tty_write_lock(struct tty_struct *tty, int ndelay) 1032static int tty_write_lock(struct tty_struct *tty, int ndelay)
1034 __acquires(&tty->atomic_write_lock)
1035{ 1033{
1036 if (!mutex_trylock(&tty->atomic_write_lock)) { 1034 if (!mutex_trylock(&tty->atomic_write_lock)) {
1037 if (ndelay) 1035 if (ndelay)