diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-01-27 03:36:31 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-01-28 06:46:11 +0300 |
commit | 31ed2261e88fbd1eb62fc870ef2c6b2cf2951336 (patch) | |
tree | 48e95b0161655f432a0d3b3172130bfb9090cec8 /include/net/ipv6.h | |
parent | 40ac240c2e06e4b5477705da1b37fb1d160572de (diff) | |
download | linux-31ed2261e88fbd1eb62fc870ef2c6b2cf2951336.tar.xz |
ipv6: partially inline ipv6_fixup_options
Inline a part of ipv6_fixup_options() to avoid extra overhead on
function call if opt is NULL.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r-- | include/net/ipv6.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 5e0b56d66724..082f30256f59 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -437,8 +437,16 @@ struct ipv6_txoptions *ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, int newtype, struct ipv6_opt_hdr *newopt); -struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, - struct ipv6_txoptions *opt); +struct ipv6_txoptions *__ipv6_fixup_options(struct ipv6_txoptions *opt_space, + struct ipv6_txoptions *opt); + +static inline struct ipv6_txoptions * +ipv6_fixup_options(struct ipv6_txoptions *opt_space, struct ipv6_txoptions *opt) +{ + if (!opt) + return NULL; + return __ipv6_fixup_options(opt_space, opt); +} bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb, const struct inet6_skb_parm *opt); |