Skip to content

Commit df21c0d

Browse files
chleroyPeter Zijlstra
authored andcommitted
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: Christophe Leroy <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/329074f92d96e3220ebe15da7bbe2779beee31eb.1647253456.git.christophe.leroy@csgroup.eu
1 parent 5517d50 commit df21c0d

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

include/linux/static_call.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ extern int static_call_text_reserved(void *start, void *end);
180180

181181
extern long __static_call_return0(void);
182182

183-
#define __DEFINE_STATIC_CALL(name, _func, _func_init) \
183+
#define DEFINE_STATIC_CALL(name, _func) \
184184
DECLARE_STATIC_CALL(name, _func); \
185185
struct static_call_key STATIC_CALL_KEY(name) = { \
186-
.func = _func_init, \
186+
.func = _func, \
187187
.type = 1, \
188188
}; \
189-
ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func_init)
189+
ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func)
190190

191191
#define DEFINE_STATIC_CALL_NULL(name, _func) \
192192
DECLARE_STATIC_CALL(name, _func); \
@@ -225,12 +225,12 @@ extern long __static_call_return0(void);
225225

226226
static inline int static_call_init(void) { return 0; }
227227

228-
#define __DEFINE_STATIC_CALL(name, _func, _func_init) \
228+
#define DEFINE_STATIC_CALL(name, _func) \
229229
DECLARE_STATIC_CALL(name, _func); \
230230
struct static_call_key STATIC_CALL_KEY(name) = { \
231-
.func = _func_init, \
231+
.func = _func, \
232232
}; \
233-
ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func_init)
233+
ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func)
234234

235235
#define DEFINE_STATIC_CALL_NULL(name, _func) \
236236
DECLARE_STATIC_CALL(name, _func); \
@@ -292,11 +292,11 @@ static inline long __static_call_return0(void)
292292
.func = _func_init, \
293293
}
294294

295+
#define DEFINE_STATIC_CALL(name, _func) \
296+
__DEFINE_STATIC_CALL(name, _func, _func)
297+
295298
#define DEFINE_STATIC_CALL_NULL(name, _func) \
296-
DECLARE_STATIC_CALL(name, _func); \
297-
struct static_call_key STATIC_CALL_KEY(name) = { \
298-
.func = NULL, \
299-
}
299+
__DEFINE_STATIC_CALL(name, _func, NULL)
300300

301301
#define DEFINE_STATIC_CALL_RET0(name, _func) \
302302
__DEFINE_STATIC_CALL(name, _func, __static_call_return0)
@@ -341,7 +341,4 @@ static inline int static_call_text_reserved(void *start, void *end)
341341

342342
#endif /* CONFIG_HAVE_STATIC_CALL */
343343

344-
#define DEFINE_STATIC_CALL(name, _func) \
345-
__DEFINE_STATIC_CALL(name, _func, _func)
346-
347344
#endif /* _LINUX_STATIC_CALL_H */

0 commit comments

Comments
 (0)