From: Masahiro Yamada <masahiroy@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Ard Biesheuvel <ardb@kernel.org>, Jason Baron <jbaron@akamai.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH 2/2] jump_label: refactor #ifdef of struct static_key
Date: Mon, 14 Feb 2022 01:57:17 +0900 [thread overview]
Message-ID: <20220213165717.2354046-2-masahiroy@kernel.org> (raw)
In-Reply-To: <20220213165717.2354046-1-masahiroy@kernel.org>
Move #ifdef CONFIG_JUMP_LABEL inside the struct static_key.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
include/linux/jump_label.h | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 6924e6837e6d..107751cc047b 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -82,10 +82,9 @@ extern bool static_key_initialized;
"%s(): static key '%pS' used before call to jump_label_init()", \
__func__, (key))
-#ifdef CONFIG_JUMP_LABEL
-
struct static_key {
atomic_t enabled;
+#ifdef CONFIG_JUMP_LABEL
/*
* Note:
* To make anonymous unions work with old compilers, the static
@@ -104,13 +103,9 @@ struct static_key {
struct jump_entry *entries;
struct static_key_mod *next;
};
+#endif /* CONFIG_JUMP_LABEL */
};
-#else
-struct static_key {
- atomic_t enabled;
-};
-#endif /* CONFIG_JUMP_LABEL */
#endif /* __ASSEMBLY__ */
#ifdef CONFIG_JUMP_LABEL
--
2.32.0
next prev parent reply other threads:[~2022-02-13 16:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-13 16:57 [PATCH 1/2] jump_label: avoid unneeded casts in STATIC_KEY_INIT_{TRUE,FALSE} Masahiro Yamada
2022-02-13 16:57 ` Masahiro Yamada [this message]
2022-02-17 18:56 ` [tip: locking/core] jump_label: Refactor #ifdef of struct static_key tip-bot2 for Masahiro Yamada
2022-02-18 19:07 ` [PATCH 2/2] jump_label: refactor " Jason Baron
2022-02-18 19:27 ` Josh Poimboeuf
2022-02-17 18:56 ` [tip: locking/core] jump_label: Avoid unneeded casts in STATIC_KEY_INIT_{TRUE,FALSE} tip-bot2 for Masahiro Yamada
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=20220213165717.2354046-2-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=ardb@kernel.org \
--cc=jbaron@akamai.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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®