diff options
author | LEROY Christophe <christophe.leroy@c-s.fr> | 2015-05-19 17:18:55 +0200 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2015-08-07 22:59:19 -0500 |
commit | 92c985f1d76c228abe202cb3004f03c9b45860d1 (patch) | |
tree | 804abef3839a59c6a2ceae1f9d29702944189b03 /arch/powerpc/include/asm/checksum.h | |
parent | 44d5401425db90dc46a0ca000bdc41429768d351 (diff) | |
download | lwn-92c985f1d76c228abe202cb3004f03c9b45860d1.tar.gz lwn-92c985f1d76c228abe202cb3004f03c9b45860d1.zip |
powerpc: put csum_tcpudp_magic inline
csum_tcpudp_magic() is only a few instructions, and does modify
really few registers. So it is not worth having it as a separate
function and suffer function branching and saving of volatile
registers.
This patch makes it inline by use of the already existing
csum_tcpudp_nofold() function.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/include/asm/checksum.h')
-rw-r--r-- | arch/powerpc/include/asm/checksum.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/checksum.h b/arch/powerpc/include/asm/checksum.h index 8251a3ba870f..5e43d2d40084 100644 --- a/arch/powerpc/include/asm/checksum.h +++ b/arch/powerpc/include/asm/checksum.h @@ -20,15 +20,6 @@ extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); /* - * computes the checksum of the TCP/UDP pseudo-header - * returns a 16-bit checksum, already complemented - */ -extern __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, - unsigned short len, - unsigned short proto, - __wsum sum); - -/* * computes the checksum of a memory block at buff, length len, * and adds in "sum" (32-bit) * @@ -127,6 +118,18 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, #endif } +/* + * computes the checksum of the TCP/UDP pseudo-header + * returns a 16-bit checksum, already complemented + */ +static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, + unsigned short len, + unsigned short proto, + __wsum sum) +{ + return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); +} + #endif #endif /* __KERNEL__ */ #endif |