Skip to content

Commit f4700a6

Browse files
Niklas Söderlundanakryiko
authored andcommitted
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 <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Reviewed-by: Louis Peens <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 29f24c4 commit f4700a6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

samples/bpf/xdpsock_user.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,15 +651,13 @@ static unsigned int do_csum(const unsigned char *buff, int len)
651651
return result;
652652
}
653653

654-
__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
655-
656654
/*
657655
* This is a version of ip_compute_csum() optimized for IP headers,
658656
* which always checksum on 4 octet boundaries.
659657
* This function code has been taken from
660658
* Linux kernel lib/checksum.c
661659
*/
662-
__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
660+
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
663661
{
664662
return (__sum16)~do_csum(iph, ihl * 4);
665663
}

0 commit comments

Comments
 (0)