From: Paolo Abeni <pabeni@redhat.com>
To: Brian Vazquez <brianvv@google.com>,
Brian Vazquez <brianvv.kernel@gmail.com>,
Eric Dumazet <edumazet@google.com>,
"David S . Miller" <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 net-next 1/2] indirect_call_wrapper: extend indirect wrapper to support up to 4 calls
Date: Tue, 23 Jun 2020 19:50:30 +0200 [thread overview]
Message-ID: <7e7ee41bc1c4c714eae7df10dddb5eb20ed51912.camel@redhat.com> (raw)
In-Reply-To: <20200623164232.175846-1-brianvv@google.com>
On Tue, 2020-06-23 at 09:42 -0700, Brian Vazquez wrote:
> 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>
> ---
> include/linux/indirect_call_wrapper.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/linux/indirect_call_wrapper.h b/include/linux/indirect_call_wrapper.h
> index 00d7e8e919c6..54c02c84906a 100644
> --- a/include/linux/indirect_call_wrapper.h
> +++ b/include/linux/indirect_call_wrapper.h
> @@ -23,6 +23,16 @@
> likely(f == f2) ? f2(__VA_ARGS__) : \
> INDIRECT_CALL_1(f, f1, __VA_ARGS__); \
> })
> +#define INDIRECT_CALL_3(f, f3, f2, f1, ...) \
> + ({ \
> + likely(f == f3) ? f3(__VA_ARGS__) : \
> + INDIRECT_CALL_2(f, f2, f1, __VA_ARGS__); \
> + })
> +#define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) \
> + ({ \
> + likely(f == f4) ? f4(__VA_ARGS__) : \
> + INDIRECT_CALL_3(f, f3, f2, f1, __VA_ARGS__); \
> + })
>
> #define INDIRECT_CALLABLE_DECLARE(f) f
> #define INDIRECT_CALLABLE_SCOPE
> @@ -30,6 +40,8 @@
> #else
> #define INDIRECT_CALL_1(f, f1, ...) f(__VA_ARGS__)
> #define INDIRECT_CALL_2(f, f2, f1, ...) f(__VA_ARGS__)
> +#define INDIRECT_CALL_3(f, f3, f2, f1, ...) f(__VA_ARGS__)
> +#define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) f(__VA_ARGS__)
> #define INDIRECT_CALLABLE_DECLARE(f)
> #define INDIRECT_CALLABLE_SCOPE static
> #endif
Acked-by: Paolo Abeni <pabeni@redhat.com>
next prev parent reply other threads:[~2020-06-23 17:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 16:42 [PATCH v2 net-next 1/2] indirect_call_wrapper: extend indirect wrapper to support up to 4 calls Brian Vazquez
2020-06-23 16:42 ` [PATCH v2 net-next 2/2] ipv6: fib6: avoid indirect calls from fib6_rule_lookup Brian Vazquez
2020-06-23 17:51 ` Paolo Abeni
2020-06-23 22:11 ` David Miller
2020-06-23 17:50 ` Paolo Abeni [this message]
2020-06-23 22:11 ` [PATCH v2 net-next 1/2] indirect_call_wrapper: extend indirect wrapper to support up to 4 calls David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e7ee41bc1c4c714eae7df10dddb5eb20ed51912.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=brianvv.kernel@gmail.com \
--cc=brianvv@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox