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: <20210618061516.662-11-jslaby@suse.cz>
Date:   Fri, 18 Jun 2021 08:14:16 +0200
From:   Jiri Slaby <jslaby@...e.cz>
To:     gregkh@...uxfoundation.org
Cc:     linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 10/70] mxser: move max_baud from port to board

mxser_port::max_baud is actually a board property, not port's. So move
it to mxser_board.

While at it, drop the printk informing about max baud rate during probe.

Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
 drivers/tty/mxser.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index a6121fea7a55..db594a64ff00 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -329,7 +329,6 @@ struct mxser_port {
 
 	unsigned long ioaddr;
 	unsigned long opmode_ioaddr;
-	speed_t max_baud;
 
 	u8 rx_high_water;
 	u8 rx_low_water;
@@ -372,6 +371,7 @@ struct mxser_board {
 	unsigned long vector_mask;
 
 	enum mxser_must_hwid must_hwid;
+	speed_t max_baud;
 
 	struct mxser_port ports[MXSER_PORTS_PER_BOARD];
 };
@@ -671,7 +671,7 @@ static int mxser_set_baud(struct tty_struct *tty, speed_t newspd)
 	if (!info->ioaddr)
 		return -1;
 
-	if (newspd > info->max_baud)
+	if (newspd > info->board->max_baud)
 		return -1;
 
 	if (newspd == 134) {
@@ -2345,9 +2345,6 @@ static int mxser_initbrd(struct mxser_board *brd)
 	unsigned int i;
 	int retval;
 
-	printk(KERN_INFO "mxser: max. baud rate = %d bps\n",
-			brd->ports[0].max_baud);
-
 	for (i = 0; i < brd->info->nports; i++) {
 		info = &brd->ports[i];
 		tty_port_init(&info->port);
@@ -2455,17 +2452,14 @@ static int mxser_probe(struct pci_dev *pdev,
 	brd->must_hwid = mxser_must_get_hwid(brd->ports[0].ioaddr);
 	brd->vector_mask = 0;
 
-	for (i = 0; i < brd->info->nports; i++) {
-		for (j = 0; j < UART_INFO_NUM; j++) {
-			if (Gpci_uart_info[j].type == brd->must_hwid) {
-				brd->ports[i].max_baud =
-					Gpci_uart_info[j].max_baud;
-
-				/* exception....CP-102 */
-				if (brd->info->flags & MXSER_HIGHBAUD)
-					brd->ports[i].max_baud = 921600;
-				break;
-			}
+	for (j = 0; j < UART_INFO_NUM; j++) {
+		if (Gpci_uart_info[j].type == brd->must_hwid) {
+			brd->max_baud = Gpci_uart_info[j].max_baud;
+
+			/* exception....CP-102 */
+			if (brd->info->flags & MXSER_HIGHBAUD)
+				brd->max_baud = 921600;
+			break;
 		}
 	}
 
-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ