mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] jump_label: avoid unneeded casts in STATIC_KEY_INIT_{TRUE,FALSE}
@ 2022-02-13 16:57 Masahiro Yamada
  2022-02-13 16:57 ` [PATCH 2/2] jump_label: refactor #ifdef of struct static_key Masahiro Yamada
  2022-02-17 18:56 ` [tip: locking/core] jump_label: Avoid unneeded casts in STATIC_KEY_INIT_{TRUE,FALSE} tip-bot2 for Masahiro Yamada
  0 siblings, 2 replies; 6+ messages in thread
From: Masahiro Yamada @ 2022-02-13 16:57 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: linux-kernel, Masahiro Yamada, Ard Biesheuvel, Jason Baron,
	Josh Poimboeuf, Steven Rostedt

Commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key")
introduced the union to struct static_key.

It is more natual to set JUMP_TYPE_* to the .type field without casting.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 include/linux/jump_label.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 48b9b2a82767..6924e6837e6d 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -251,10 +251,10 @@ extern void static_key_disable_cpuslocked(struct static_key *key);
  */
 #define STATIC_KEY_INIT_TRUE					\
 	{ .enabled = { 1 },					\
-	  { .entries = (void *)JUMP_TYPE_TRUE } }
+	  { .type = JUMP_TYPE_TRUE } }
 #define STATIC_KEY_INIT_FALSE					\
 	{ .enabled = { 0 },					\
-	  { .entries = (void *)JUMP_TYPE_FALSE } }
+	  { .type = JUMP_TYPE_FALSE } }
 
 #else  /* !CONFIG_JUMP_LABEL */
 
-- 
2.32.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-02-18 19:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/2] jump_label: refactor #ifdef of struct static_key Masahiro Yamada
2022-02-17 18:56   ` [tip: locking/core] jump_label: Refactor " 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

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®