Thread (68 messages) 68 messages, 11 authors, 2021-06-10
STALE1830d

[PATCH 29/35] USB: serial: digi_acceleport, simplify digi_chars_in_buffer

From: Jiri Slaby <hidden>
Date: 2021-05-05 09:21:36
Also in: linux-usb, lkml
Subsystem: the rest, usb serial subsystem, usb subsystem · Maintainers: Linus Torvalds, Johan Hovold, Greg Kroah-Hartman

"if"'s true branch in digi_chars_in_buffer returns. So there is no need
for "else" and indented code. Remove this else and shift the code to the
left.

Signed-off-by: Jiri Slaby <redacted>
Cc: Johan Hovold <johan@kernel.org>
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/serial/digi_acceleport.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 19ee8191647c..0c4d611621c2 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -1050,12 +1050,11 @@ static unsigned int digi_chars_in_buffer(struct tty_struct *tty)
 			priv->dp_port_num, port->bulk_out_size - 2);
 		/* return(port->bulk_out_size - 2); */
 		return 256;
-	} else {
-		dev_dbg(&port->dev, "digi_chars_in_buffer: port=%d, chars=%d\n",
-			priv->dp_port_num, priv->dp_out_buf_len);
-		return priv->dp_out_buf_len;
 	}
 
+	dev_dbg(&port->dev, "digi_chars_in_buffer: port=%d, chars=%d\n",
+		priv->dp_port_num, priv->dp_out_buf_len);
+	return priv->dp_out_buf_len;
 }
 
 static void digi_dtr_rts(struct usb_serial_port *port, int on)
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help