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

usb: gadget: u_serial: remove some dead code

There is no need to check if "port" is NULL. We already verified that it
is non-NULL. It's a stack variable and can't be modified by a different
thread. Delete this dead code.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Prashanth K <prashanth.k@oss.qualcomm.com>
Link: https://lore.kernel.org/r/685c1413.050a0220.1a8223.d0b9@mx.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
e35a5d81 246fef76

-6
-6
drivers/usb/gadget/function/u_serial.c
··· 1505 1505 spin_unlock_irqrestore(&serial_port_lock, flags); 1506 1506 if (!gserial_wakeup_host(gser)) 1507 1507 return; 1508 - 1509 - /* Check if port is valid after acquiring lock back */ 1510 1508 spin_lock_irqsave(&serial_port_lock, flags); 1511 - if (!port) { 1512 - spin_unlock_irqrestore(&serial_port_lock, flags); 1513 - return; 1514 - } 1515 1509 } 1516 1510 1517 1511 spin_lock(&port->port_lock);