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]
Date:	Mon,  6 Jun 2016 18:41:00 +0900
From:	Masahiro Yamada <yamada.masahiro@...ionext.com>
To:	linux-serial@...r.kernel.org
Cc:	Arnd Bergmann <arnd@...db.de>,
	Peter Hurley <peter@...leysoftware.com>,
	Rob Herring <robh@...nel.org>,
	Paul Burton <paul.burton@...tec.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Matthias Brugger <matthias.bgg@...il.com>,
	Masahiro Yamada <yamada.masahiro@...ionext.com>,
	linux-kernel@...r.kernel.org, Jiri Slaby <jslaby@...e.com>
Subject: [PATCH 1/4] earlycon: mark earlycon code as __used iif the caller is built-in

Keep earlycon related symbols only when CONFIG_SERIAL_EARLYCON is
enabled and the driver is built-in.  This will be helpful to clean
up ifdefs surrounding earlycon code in serial drivers.

Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---

 include/linux/serial_core.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a3d7c0d..2f44e20 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -352,9 +352,15 @@ struct earlycon_id {
 extern const struct earlycon_id __earlycon_table[];
 extern const struct earlycon_id __earlycon_table_end[];
 
+#if defined(CONFIG_SERIAL_EARLYCON) && !defined(MODULE)
+#define EARLYCON_USED_OR_UNUSED	__used
+#else
+#define EARLYCON_USED_OR_UNUSED	__maybe_unused
+#endif
+
 #define OF_EARLYCON_DECLARE(_name, compat, fn)				\
 	static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name)	\
-	     __used __section(__earlycon_table)				\
+	     EARLYCON_USED_OR_UNUSED __section(__earlycon_table)	\
 		= { .name = __stringify(_name),				\
 		    .compatible = compat,				\
 		    .setup = fn  }
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ