summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2021-05-19 09:21:50 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-20 16:59:14 +0200
commitb8be5db573b822920b0f6230498d900752bede17 (patch)
treeda5d44b2b38b388b869d3dd43ef80e5f3073e6aa /drivers/tty/serial
parent4bc2bd5aefd60a2837a20b1e88e89eaaa677d229 (diff)
downloadlinux-stable-b8be5db573b822920b0f6230498d900752bede17.tar.gz
linux-stable-b8be5db573b822920b0f6230498d900752bede17.tar.bz2
linux-stable-b8be5db573b822920b0f6230498d900752bede17.zip
tty/serial: clean up uart_match_port
* make parameters const (as they are only read) * return bool (as comparison results are returned) * add \n before final return Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210519072153.3859-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/serial_core.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 2793b1cf2d24..b5beb215f062 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -3027,26 +3027,28 @@ out:
/*
* Are the two ports equivalent?
*/
-int uart_match_port(struct uart_port *port1, struct uart_port *port2)
+bool uart_match_port(const struct uart_port *port1,
+ const struct uart_port *port2)
{
if (port1->iotype != port2->iotype)
- return 0;
+ return false;
switch (port1->iotype) {
case UPIO_PORT:
- return (port1->iobase == port2->iobase);
+ return port1->iobase == port2->iobase;
case UPIO_HUB6:
- return (port1->iobase == port2->iobase) &&
- (port1->hub6 == port2->hub6);
+ return port1->iobase == port2->iobase &&
+ port1->hub6 == port2->hub6;
case UPIO_MEM:
case UPIO_MEM16:
case UPIO_MEM32:
case UPIO_MEM32BE:
case UPIO_AU:
case UPIO_TSI:
- return (port1->mapbase == port2->mapbase);
+ return port1->mapbase == port2->mapbase;
}
- return 0;
+
+ return false;
}
EXPORT_SYMBOL(uart_match_port);