Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

indirect_call_wrapper: extend indirect wrapper to support up to 4 calls

There are many places where 2 annotations are not enough. This patch
adds INDIRECT_CALL_3 and INDIRECT_CALL_4 to cover such cases.

Signed-off-by: Brian Vazquez <brianvv@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Brian Vazquez and committed by
David S. Miller
e678e9dd 13fdc419

+12
+12
include/linux/indirect_call_wrapper.h
··· 23 23 likely(f == f2) ? f2(__VA_ARGS__) : \ 24 24 INDIRECT_CALL_1(f, f1, __VA_ARGS__); \ 25 25 }) 26 + #define INDIRECT_CALL_3(f, f3, f2, f1, ...) \ 27 + ({ \ 28 + likely(f == f3) ? f3(__VA_ARGS__) : \ 29 + INDIRECT_CALL_2(f, f2, f1, __VA_ARGS__); \ 30 + }) 31 + #define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) \ 32 + ({ \ 33 + likely(f == f4) ? f4(__VA_ARGS__) : \ 34 + INDIRECT_CALL_3(f, f3, f2, f1, __VA_ARGS__); \ 35 + }) 26 36 27 37 #define INDIRECT_CALLABLE_DECLARE(f) f 28 38 #define INDIRECT_CALLABLE_SCOPE ··· 40 30 #else 41 31 #define INDIRECT_CALL_1(f, f1, ...) f(__VA_ARGS__) 42 32 #define INDIRECT_CALL_2(f, f2, f1, ...) f(__VA_ARGS__) 33 + #define INDIRECT_CALL_3(f, f3, f2, f1, ...) f(__VA_ARGS__) 34 + #define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) f(__VA_ARGS__) 43 35 #define INDIRECT_CALLABLE_DECLARE(f) 44 36 #define INDIRECT_CALLABLE_SCOPE static 45 37 #endif