TTY: tty_io, annotate locking functions
authorJiri Slaby <jslaby@suse.cz>
Wed, 20 Apr 2011 08:43:18 +0000 (10:43 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 25 Apr 2011 21:19:12 +0000 (14:19 -0700)
tty_write_lock and tty_write_unlock contain imbalanced locking. But
this is intentional, so mark them appropriately by
__acquires/__releases.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/tty_io.c

index 3f4ad98..6556f74 100644 (file)
@@ -962,12 +962,14 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
 }
 
 void tty_write_unlock(struct tty_struct *tty)
+       __releases(&tty->atomic_write_lock)
 {
        mutex_unlock(&tty->atomic_write_lock);
        wake_up_interruptible_poll(&tty->write_wait, POLLOUT);
 }
 
 int tty_write_lock(struct tty_struct *tty, int ndelay)
+       __acquires(&tty->atomic_write_lock)
 {
        if (!mutex_trylock(&tty->atomic_write_lock)) {
                if (ndelay)