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] [day] [month] [year] [list]
Date:   Fri, 8 Dec 2017 22:53:26 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-serial@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.com>, Pat Gefre <pfg@....com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 3/3] serial: ioc4: Adjust three function calls together with a
 variable assignment

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 8 Dec 2017 22:40:31 +0100

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/tty/serial/ioc4_serial.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index 6981ad2ca1b7..ba95a4cb8130 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -1945,7 +1945,8 @@ static void handle_intr(void *arg, uint32_t sio_ir)
 			 * hasn't been delivered to the cpu yet anyway, even
 			 * though we see it as asserted when we read the sio_ir.
 			 */
-			if ((sio_ir = PENDING(port)) & hooks->intr_rx_high) {
+			sio_ir = PENDING(port);
+			if (sio_ir & hooks->intr_rx_high) {
 				if ((port->ip_flags & READ_ABORTED) == 0) {
 					port->ip_ienb &= ~hooks->intr_rx_high;
 					port->ip_flags |= INPUT_HIGH;
@@ -2902,16 +2903,18 @@ static struct ioc4_submodule ioc4_serial_submodule = {
  */
 static int __init ioc4_serial_init(void)
 {
-	int ret;
-
 	/* register with serial core */
-	if ((ret = uart_register_driver(&ioc4_uart_rs232)) < 0) {
+	int ret = uart_register_driver(&ioc4_uart_rs232);
+
+	if (ret < 0) {
 		printk(KERN_WARNING
 			"%s: Couldn't register rs232 IOC4 serial driver\n",
 			__func__);
 		goto out;
 	}
-	if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) {
+
+	ret = uart_register_driver(&ioc4_uart_rs422);
+	if (ret < 0) {
 		printk(KERN_WARNING
 			"%s: Couldn't register rs422 IOC4 serial driver\n",
 			__func__);
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ