Commit df21c0d7 authored by Christophe Leroy's avatar Christophe Leroy Committed by Peter Zijlstra

static_call: Remove __DEFINE_STATIC_CALL macro

Only DEFINE_STATIC_CALL use __DEFINE_STATIC_CALL macro now when
CONFIG_HAVE_STATIC_CALL is selected.

Only keep __DEFINE_STATIC_CALL() for the generic fallback, and
also use it to implement DEFINE_STATIC_CALL_NULL() in that case.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/329074f92d96e3220ebe15da7bbe2779beee31eb.1647253456.git.christophe.leroy@csgroup.eu
parent 5517d500
...@@ -180,13 +180,13 @@ extern int static_call_text_reserved(void *start, void *end); ...@@ -180,13 +180,13 @@ extern int static_call_text_reserved(void *start, void *end);
extern long __static_call_return0(void); extern long __static_call_return0(void);
#define __DEFINE_STATIC_CALL(name, _func, _func_init) \ #define DEFINE_STATIC_CALL(name, _func) \
DECLARE_STATIC_CALL(name, _func); \ DECLARE_STATIC_CALL(name, _func); \
struct static_call_key STATIC_CALL_KEY(name) = { \ struct static_call_key STATIC_CALL_KEY(name) = { \
.func = _func_init, \ .func = _func, \
.type = 1, \ .type = 1, \
}; \ }; \
ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func_init) ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func)
#define DEFINE_STATIC_CALL_NULL(name, _func) \ #define DEFINE_STATIC_CALL_NULL(name, _func) \
DECLARE_STATIC_CALL(name, _func); \ DECLARE_STATIC_CALL(name, _func); \
...@@ -225,12 +225,12 @@ extern long __static_call_return0(void); ...@@ -225,12 +225,12 @@ extern long __static_call_return0(void);
static inline int static_call_init(void) { return 0; } static inline int static_call_init(void) { return 0; }
#define __DEFINE_STATIC_CALL(name, _func, _func_init) \ #define DEFINE_STATIC_CALL(name, _func) \
DECLARE_STATIC_CALL(name, _func); \ DECLARE_STATIC_CALL(name, _func); \
struct static_call_key STATIC_CALL_KEY(name) = { \ struct static_call_key STATIC_CALL_KEY(name) = { \
.func = _func_init, \ .func = _func, \
}; \ }; \
ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func_init) ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func)
#define DEFINE_STATIC_CALL_NULL(name, _func) \ #define DEFINE_STATIC_CALL_NULL(name, _func) \
DECLARE_STATIC_CALL(name, _func); \ DECLARE_STATIC_CALL(name, _func); \
...@@ -292,11 +292,11 @@ static inline long __static_call_return0(void) ...@@ -292,11 +292,11 @@ static inline long __static_call_return0(void)
.func = _func_init, \ .func = _func_init, \
} }
#define DEFINE_STATIC_CALL(name, _func) \
__DEFINE_STATIC_CALL(name, _func, _func)
#define DEFINE_STATIC_CALL_NULL(name, _func) \ #define DEFINE_STATIC_CALL_NULL(name, _func) \
DECLARE_STATIC_CALL(name, _func); \ __DEFINE_STATIC_CALL(name, _func, NULL)
struct static_call_key STATIC_CALL_KEY(name) = { \
.func = NULL, \
}
#define DEFINE_STATIC_CALL_RET0(name, _func) \ #define DEFINE_STATIC_CALL_RET0(name, _func) \
__DEFINE_STATIC_CALL(name, _func, __static_call_return0) __DEFINE_STATIC_CALL(name, _func, __static_call_return0)
...@@ -341,7 +341,4 @@ static inline int static_call_text_reserved(void *start, void *end) ...@@ -341,7 +341,4 @@ static inline int static_call_text_reserved(void *start, void *end)
#endif /* CONFIG_HAVE_STATIC_CALL */ #endif /* CONFIG_HAVE_STATIC_CALL */
#define DEFINE_STATIC_CALL(name, _func) \
__DEFINE_STATIC_CALL(name, _func, _func)
#endif /* _LINUX_STATIC_CALL_H */ #endif /* _LINUX_STATIC_CALL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment