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-next>] [day] [month] [year] [list]
Message-ID: <20240410141135.1378948-1-andriy.shevchenko@linux.intel.com>
Date: Wed, 10 Apr 2024 17:11:35 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	linux-kernel@...r.kernel.org,
	linux-serial@...r.kernel.org
Cc: Jiri Slaby <jirislaby@...nel.org>
Subject: [PATCH v1 1/1] serial: max3100: Convert to_max3100_port() to be static inline

As Jiri rightfully pointed out the current to_max3100_port() macro
implementation is fragile in a sense that it expects the variable
name to be port, otherwise it blow up the build.

Change this to be static inline to prevent bad compilation.

Suggested-by: Jiri Slaby <jirislaby@...nel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 drivers/tty/serial/max3100.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 1e6b5763ce3f..07ee001640bb 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -111,7 +111,10 @@ struct max3100_port {
 	struct timer_list	timer;
 };
 
-#define to_max3100_port(port)	container_of(port, struct max3100_port, port)
+static inline struct max3100_port *to_max3100_port(struct uart_port *port)
+{
+	return container_of(port, struct max3100_port, port);
+}
 
 static struct max3100_port *max3100s[MAX_MAX3100]; /* the chips */
 static DEFINE_MUTEX(max3100s_lock);		   /* race on probe */
-- 
2.43.0.rc1.1.gbec44491f096


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ