mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
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>
This commit is contained in:
parent
246fef761a
commit
e35a5d8145
|
|
@ -1505,13 +1505,7 @@ void gserial_suspend(struct gserial *gser)
|
|||
spin_unlock_irqrestore(&serial_port_lock, flags);
|
||||
if (!gserial_wakeup_host(gser))
|
||||
return;
|
||||
|
||||
/* Check if port is valid after acquiring lock back */
|
||||
spin_lock_irqsave(&serial_port_lock, flags);
|
||||
if (!port) {
|
||||
spin_unlock_irqrestore(&serial_port_lock, flags);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
spin_lock(&port->port_lock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user