From: "tip-bot2 for Nathan Chancellor" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Nathan Chancellor <natechancellor@gmail.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Sami Tolvanen <samitolvanen@google.com>, x86 <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [tip: core/static_call] static_call: Fix return type of static_call_init
Date: Sat, 03 Oct 2020 14:22:23 -0000 [thread overview]
Message-ID: <160173494363.7002.10430993422075682487.tip-bot2@tip-bot2> (raw)
The following commit has been merged into the core/static_call branch of tip:
Commit-ID: 69e0ad37c9f32d5aa1beb02aab4ec0cd055be013
Gitweb: https://git.kernel.org/tip/69e0ad37c9f32d5aa1beb02aab4ec0cd055be013
Author: Nathan Chancellor <natechancellor@gmail.com>
AuthorDate: Mon, 28 Sep 2020 16:09:39 -07:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 02 Oct 2020 21:18:25 +02:00
static_call: Fix return type of static_call_init
Functions that are passed to early_initcall should be of type
initcall_t, which expects a return type of int. This is not currently an
error but a patch in the Clang LTO series could change that in the
future.
Fixes: 9183c3f9ed71 ("static_call: Add inline static call infrastructure")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/lkml/20200903203053.3411268-17-samitolvanen@google.com/
---
include/linux/static_call.h | 6 +++---
kernel/static_call.c | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index bfa2ba3..695da4c 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -136,7 +136,7 @@ extern void arch_static_call_transform(void *site, void *tramp, void *func, bool
#ifdef CONFIG_HAVE_STATIC_CALL_INLINE
-extern void __init static_call_init(void);
+extern int __init static_call_init(void);
struct static_call_mod {
struct static_call_mod *next;
@@ -187,7 +187,7 @@ extern int static_call_text_reserved(void *start, void *end);
#elif defined(CONFIG_HAVE_STATIC_CALL)
-static inline void static_call_init(void) { }
+static inline int static_call_init(void) { return 0; }
struct static_call_key {
void *func;
@@ -234,7 +234,7 @@ static inline int static_call_text_reserved(void *start, void *end)
#else /* Generic implementation */
-static inline void static_call_init(void) { }
+static inline int static_call_init(void) { return 0; }
struct static_call_key {
void *func;
diff --git a/kernel/static_call.c b/kernel/static_call.c
index f8362b3..84565c2 100644
--- a/kernel/static_call.c
+++ b/kernel/static_call.c
@@ -410,12 +410,12 @@ int static_call_text_reserved(void *start, void *end)
return __static_call_mod_text_reserved(start, end);
}
-void __init static_call_init(void)
+int __init static_call_init(void)
{
int ret;
if (static_call_initialized)
- return;
+ return 0;
cpus_read_lock();
static_call_lock();
@@ -434,6 +434,7 @@ void __init static_call_init(void)
#ifdef CONFIG_MODULES
register_module_notifier(&static_call_module_nb);
#endif
+ return 0;
}
early_initcall(static_call_init);
reply other threads:[~2020-10-03 14:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=160173494363.7002.10430993422075682487.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=peterz@infradead.org \
--cc=samitolvanen@google.com \
--cc=x86@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®