Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: tty_ldsem.c: move assignment out of if () block

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>

+2 -1
+2 -1
drivers/tty/tty_ldsem.c
··· 299 299 timeout = schedule_timeout(timeout); 300 300 raw_spin_lock_irq(&sem->wait_lock); 301 301 set_task_state(tsk, TASK_UNINTERRUPTIBLE); 302 - if ((locked = writer_trylock(sem))) 302 + locked = writer_trylock(sem); 303 + if (locked) 303 304 break; 304 305 } 305 306