Thread (4 messages) 4 messages, 2 authors, 2015-05-25

Re: [PATCH] serial: 8250: remove return statements from void function

From: Masahiro Yamada <hidden>
Date: 2015-05-25 01:53:24
Also in: lkml

2015-05-25 4:46 GMT+09:00 Greg Kroah-Hartman [off-list ref]:
On Mon, May 11, 2015 at 12:30:22PM +0900, Masahiro Yamada wrote:
quoted
serial8250_set_mctrl() is a void type function.  Returning something
does not look nice.

Signed-off-by: Masahiro Yamada <redacted>
---

 drivers/tty/serial/8250/8250_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 4882027..146f56c 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2019,8 +2019,9 @@ EXPORT_SYMBOL_GPL(serial8250_do_set_mctrl);
 static void serial8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
 {
      if (port->set_mctrl)
-             return port->set_mctrl(port, mctrl);
-     return serial8250_do_set_mctrl(port, mctrl);
+             port->set_mctrl(port, mctrl);
+     else
+             serial8250_do_set_mctrl(port, mctrl);
 }
You just changed the logic here!

Could you tell me why?

The logic still looks the same to me.




-- 
Best Regards
Masahiro Yamada
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help