From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-serial@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
Peter Hurley <peter@hurleysoftware.com>,
Rob Herring <robh@kernel.org>,
Paul Burton <paul.burton@imgtec.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
linux-kernel@vger.kernel.org, Jiri Slaby <jslaby@suse.com>
Subject: [PATCH 1/4] earlycon: mark earlycon code as __used iif the caller is built-in
Date: Mon, 6 Jun 2016 18:41:00 +0900 [thread overview]
Message-ID: <1465206063-1018-2-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1465206063-1018-1-git-send-email-yamada.masahiro@socionext.com>
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@socionext.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
next prev parent reply other threads:[~2016-06-06 9:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 9:40 [PATCH 0/4] serial: earlycon: keep earlycon symbols for non-module and driver clean-ups Masahiro Yamada
2016-06-06 9:41 ` Masahiro Yamada [this message]
2016-06-06 9:41 ` [PATCH 2/4] serial: 8250_uniphier: drop !defined(MODULE) conditional Masahiro Yamada
2016-06-06 9:41 ` [PATCH 3/4] serial: 8250_mtk: " Masahiro Yamada
2016-06-06 10:27 ` Matthias Brugger
2016-06-06 9:41 ` [PATCH 4/4] serial: 8250_ingenic: drop #if conditional surrounding earlycon code Masahiro Yamada
2016-06-06 10:25 ` [PATCH 0/4] serial: earlycon: keep earlycon symbols for non-module and driver clean-ups Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465206063-1018-2-git-send-email-yamada.masahiro@socionext.com \
--to=yamada.masahiro@socionext.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=paul.burton@imgtec.com \
--cc=peter@hurleysoftware.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®