lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120502124718.30480.3406.sendpatchset@w520>
Date:	Wed, 02 May 2012 21:47:18 +0900
From:	Magnus Damm <magnus.damm@...il.com>
To:	linux-serial@...r.kernel.org
Cc:	horms@...ge.net.au, arnd@...db.de, linux-sh@...r.kernel.org,
	gregkh@...uxfoundation.org, swarren@...dotorg.org,
	linux-kernel@...r.kernel.org, rjw@...k.pl,
	paul.gortmaker@...driver.com, lethal@...ux-sh.org, olof@...om.net,
	Magnus Damm <magnus.damm@...il.com>, dan.j.williams@...el.com,
	alan@...ux.intel.com
Subject: [PATCH 04/06] serial8250: Clean up default map and dl code

From: Magnus Damm <damm@...nsource.se>

Get rid of unused functions and macros now when
Alchemy and RM9K are converted over to callbacks.

Signed-off-by: Magnus Damm <damm@...nsource.se>
---

 drivers/tty/serial/8250/8250.c |   38 ++++++++++++--------------------------
 1 file changed, 12 insertions(+), 26 deletions(-)

--- 0007/drivers/tty/serial/8250/8250.c
+++ work/drivers/tty/serial/8250/8250.c	2012-05-01 22:52:30.000000000 +0900
@@ -285,28 +285,18 @@ static const struct serial8250_config ua
 };
 
 /* Uart divisor latch read */
-static int default_dl_read(struct uart_8250_port *up)
+static int default_serial_dl_read(struct uart_8250_port *up)
 {
 	return serial_in(up, UART_DLL) | serial_in(up, UART_DLM) << 8;
 }
 
 /* Uart divisor latch write */
-static void default_dl_write(struct uart_8250_port *up, int value)
+static void default_serial_dl_write(struct uart_8250_port *up, int value)
 {
 	serial_out(up, UART_DLL, value & 0xff);
 	serial_out(up, UART_DLM, value >> 8 & 0xff);
 }
 
-static int _serial_dl_read(struct uart_8250_port *up)
-{
-	return default_dl_read(up);
-}
-
-static void _serial_dl_write(struct uart_8250_port *up, int value)
-{
-	default_dl_write(up, value);
-}
-
 #ifdef CONFIG_MIPS_ALCHEMY
 
 /* Au1x00 UART hardware has a weird register layout */
@@ -403,57 +393,53 @@ static void rm9k_serial_dl_write(struct
 
 #endif
 
-/* sane hardware needs no mapping */
-#define map_8250_in_reg(up, offset) (offset)
-#define map_8250_out_reg(up, offset) (offset)
-
 static unsigned int hub6_serial_in(struct uart_port *p, int offset)
 {
-	offset = map_8250_in_reg(p, offset) << p->regshift;
+	offset = offset << p->regshift;
 	outb(p->hub6 - 1 + offset, p->iobase);
 	return inb(p->iobase + 1);
 }
 
 static void hub6_serial_out(struct uart_port *p, int offset, int value)
 {
-	offset = map_8250_out_reg(p, offset) << p->regshift;
+	offset = offset << p->regshift;
 	outb(p->hub6 - 1 + offset, p->iobase);
 	outb(value, p->iobase + 1);
 }
 
 static unsigned int mem_serial_in(struct uart_port *p, int offset)
 {
-	offset = map_8250_in_reg(p, offset) << p->regshift;
+	offset = offset << p->regshift;
 	return readb(p->membase + offset);
 }
 
 static void mem_serial_out(struct uart_port *p, int offset, int value)
 {
-	offset = map_8250_out_reg(p, offset) << p->regshift;
+	offset = offset << p->regshift;
 	writeb(value, p->membase + offset);
 }
 
 static void mem32_serial_out(struct uart_port *p, int offset, int value)
 {
-	offset = map_8250_out_reg(p, offset) << p->regshift;
+	offset = offset << p->regshift;
 	writel(value, p->membase + offset);
 }
 
 static unsigned int mem32_serial_in(struct uart_port *p, int offset)
 {
-	offset = map_8250_in_reg(p, offset) << p->regshift;
+	offset = offset << p->regshift;
 	return readl(p->membase + offset);
 }
 
 static unsigned int io_serial_in(struct uart_port *p, int offset)
 {
-	offset = map_8250_in_reg(p, offset) << p->regshift;
+	offset = offset << p->regshift;
 	return inb(p->iobase + offset);
 }
 
 static void io_serial_out(struct uart_port *p, int offset, int value)
 {
-	offset = map_8250_out_reg(p, offset) << p->regshift;
+	offset = offset << p->regshift;
 	outb(value, p->iobase + offset);
 }
 
@@ -464,8 +450,8 @@ static void set_io_from_upio(struct uart
 	struct uart_8250_port *up =
 		container_of(p, struct uart_8250_port, port);
 
-	up->dl_read = _serial_dl_read;
-	up->dl_write = _serial_dl_write;
+	up->dl_read = default_serial_dl_read;
+	up->dl_write = default_serial_dl_write;
 
 	switch (p->iotype) {
 	case UPIO_HUB6:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ