]> git.karo-electronics.de Git - linux-beck.git/commitdiff
tty: tty_ldsem.c: move assignment out of if () block
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 09:22:18 +0000 (11:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 17:04:18 +0000 (19:04 +0200)
We should not be doing assignments within an if () block
so fix up the code to not do this.

change was created using Coccinelle.

CC: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ldsem.c

index 0ffb0cbe28237239ffd093877a363c7957c8e328..ad7eba5ca380fad606a711f79eda67e3b150074a 100644 (file)
@@ -299,7 +299,8 @@ down_write_failed(struct ld_semaphore *sem, long count, long timeout)
                timeout = schedule_timeout(timeout);
                raw_spin_lock_irq(&sem->wait_lock);
                set_task_state(tsk, TASK_UNINTERRUPTIBLE);
-               if ((locked = writer_trylock(sem)))
+               locked = writer_trylock(sem);
+               if (locked)
                        break;
        }