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

tty: hvc_console.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>
CC: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+2 -1
+2 -1
drivers/tty/hvc/hvc_console.c
··· 319 319 int rc; 320 320 321 321 /* Auto increments kref reference if found. */ 322 - if (!(hp = hvc_get_by_index(tty->index))) 322 + hp = hvc_get_by_index(tty->index); 323 + if (!hp) 323 324 return -ENODEV; 324 325 325 326 tty->driver_data = hp;