path: root/samples
diff options
authorNiklas Söderlund <>2021-08-06 14:28:55 +0200
committerAndrii Nakryiko <>2021-08-06 16:53:27 -0700
commitf4700a62c27161e364f66fdce527e8b04083c444 (patch)
treeec35f978264435c6b5690e857b4ae485621039c7 /samples
parent29f24c43cbe09b83162776a370848d5a782dc3b7 (diff)
samples/bpf: xdpsock: Remove forward declaration of ip_fast_csum()
There is a forward declaration of ip_fast_csum() just before its implementation, remove the unneeded forward declaration. While at it mark the implementation as static inline. Signed-off-by: Niklas Söderlund <> Signed-off-by: Simon Horman <> Signed-off-by: Andrii Nakryiko <> Reviewed-by: Louis Peens <> Link:
Diffstat (limited to 'samples')
1 files changed, 1 insertions, 3 deletions
diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c
index 7c56a7a784e1..49d7a6ad7e39 100644
--- a/samples/bpf/xdpsock_user.c
+++ b/samples/bpf/xdpsock_user.c
@@ -651,15 +651,13 @@ out:
return result;
-__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
* This is a version of ip_compute_csum() optimized for IP headers,
* which always checksum on 4 octet boundaries.
* This function code has been taken from
* Linux kernel lib/checksum.c
-__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
+static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
return (__sum16)~do_csum(iph, ihl * 4);