usb: gadget: u_serial: remove some dead code
Subsystems (2)
PATCH 1/1 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.
--- drivers/usb/gadget/function/u_serial.c | 7 ------ 1 file changed, 6 deletions(-)
drivers/usb/gadget/function/u_serial.c +0 -6
@@ -1501,13 +1501,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);
Signature · 1 line
2.47.2
Quoted 6 lines · Dan Carpenter
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 <[email protected]>---
Perhaps you could add Closes and Fixes tag, but its up to you.
Quoted 21 lines
drivers/usb/gadget/function/u_serial.c | 7 ------ 1 file changed, 6 deletions(-)drivers/usb/gadget/function/u_serial.c +0
-6@@ -1501,13 +1501,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);
Quoted 11 lines · Prashanth K
Quoted 6 lines · Dan Carpenter
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 <[email protected]>---
Perhaps you could add Closes and Fixes tag, but its up to you.
Fixes is only for bugs. If I put a Closes tag, then I'd have to give myself reported by credit as well which is just being greedy for tags. :P
regards,
dan carpenter