net: remove unused parameter from skb_checksum_try_convert

the check parameter is never used

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Li RongQing 2019-07-04 17:03:26 +08:00 committed by David S. Miller
parent 60a6127c5e
commit e4aa33ad59
4 changed files with 6 additions and 10 deletions

View File

@ -3919,18 +3919,16 @@ static inline bool __skb_checksum_convert_check(struct sk_buff *skb)
return (skb->ip_summed == CHECKSUM_NONE && skb->csum_valid); return (skb->ip_summed == CHECKSUM_NONE && skb->csum_valid);
} }
static inline void __skb_checksum_convert(struct sk_buff *skb, static inline void __skb_checksum_convert(struct sk_buff *skb, __wsum pseudo)
__sum16 check, __wsum pseudo)
{ {
skb->csum = ~pseudo; skb->csum = ~pseudo;
skb->ip_summed = CHECKSUM_COMPLETE; skb->ip_summed = CHECKSUM_COMPLETE;
} }
#define skb_checksum_try_convert(skb, proto, check, compute_pseudo) \ #define skb_checksum_try_convert(skb, proto, compute_pseudo) \
do { \ do { \
if (__skb_checksum_convert_check(skb)) \ if (__skb_checksum_convert_check(skb)) \
__skb_checksum_convert(skb, check, \ __skb_checksum_convert(skb, compute_pseudo(skb, proto)); \
compute_pseudo(skb, proto)); \
} while (0) } while (0)
static inline void skb_remcsum_adjust_partial(struct sk_buff *skb, void *ptr, static inline void skb_remcsum_adjust_partial(struct sk_buff *skb, void *ptr,

View File

@ -83,7 +83,7 @@ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,
options = (__be32 *)(greh + 1); options = (__be32 *)(greh + 1);
if (greh->flags & GRE_CSUM) { if (greh->flags & GRE_CSUM) {
if (!skb_checksum_simple_validate(skb)) { if (!skb_checksum_simple_validate(skb)) {
skb_checksum_try_convert(skb, IPPROTO_GRE, 0, skb_checksum_try_convert(skb, IPPROTO_GRE,
null_compute_pseudo); null_compute_pseudo);
} else if (csum_err) { } else if (csum_err) {
*csum_err = true; *csum_err = true;

View File

@ -2224,8 +2224,7 @@ static int udp_unicast_rcv_skb(struct sock *sk, struct sk_buff *skb,
int ret; int ret;
if (inet_get_convert_csum(sk) && uh->check && !IS_UDPLITE(sk)) if (inet_get_convert_csum(sk) && uh->check && !IS_UDPLITE(sk))
skb_checksum_try_convert(skb, IPPROTO_UDP, uh->check, skb_checksum_try_convert(skb, IPPROTO_UDP, inet_compute_pseudo);
inet_compute_pseudo);
ret = udp_queue_rcv_skb(sk, skb); ret = udp_queue_rcv_skb(sk, skb);

View File

@ -826,8 +826,7 @@ static int udp6_unicast_rcv_skb(struct sock *sk, struct sk_buff *skb,
int ret; int ret;
if (inet_get_convert_csum(sk) && uh->check && !IS_UDPLITE(sk)) if (inet_get_convert_csum(sk) && uh->check && !IS_UDPLITE(sk))
skb_checksum_try_convert(skb, IPPROTO_UDP, uh->check, skb_checksum_try_convert(skb, IPPROTO_UDP, ip6_compute_pseudo);
ip6_compute_pseudo);
ret = udpv6_queue_rcv_skb(sk, skb); ret = udpv6_queue_rcv_skb(sk, skb);