summaryrefslogtreecommitdiff
path: root/include/linux/static_call.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-03-23 16:49:03 +0100
committerPeter Zijlstra <peterz@infradead.org>2021-04-09 13:22:12 +0200
commit9432bbd969c667fc9c4b1c140c5a745ff2a7b540 (patch)
treea99799dd473f7d94ac74d67dda3f354df3eeb54b /include/linux/static_call.h
parent7d95f22798ecea513f37b792b39fec4bcf20fec3 (diff)
static_call: Relax static_call_update() function argument type
static_call_update() had stronger type requirements than regular C, relax them to match. Instead of requiring the @func argument has the exact matching type, allow any type which C is willing to promote to the right (function) pointer type. Specifically this allows (void *) arguments. This cleans up a bunch of static_call_update() callers for PREEMPT_DYNAMIC and should get around silly GCC11 warnings for free. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/YFoN7nCl8OfGtpeh@hirez.programming.kicks-ass.net
Diffstat (limited to 'include/linux/static_call.h')
-rw-r--r--include/linux/static_call.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 85ecc789f4ff..8d50f62420ca 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -113,9 +113,9 @@ extern void arch_static_call_transform(void *site, void *tramp, void *func, bool
#define static_call_update(name, func) \
({ \
- BUILD_BUG_ON(!__same_type(*(func), STATIC_CALL_TRAMP(name))); \
+ typeof(&STATIC_CALL_TRAMP(name)) __F = (func); \
__static_call_update(&STATIC_CALL_KEY(name), \
- STATIC_CALL_TRAMP_ADDR(name), func); \
+ STATIC_CALL_TRAMP_ADDR(name), __F); \
})
#ifdef CONFIG_HAVE_STATIC_CALL_INLINE