summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorShile Zhang <shile.zhang@nokia.com>2017-02-04 17:03:40 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-14 09:28:17 +0100
commit4aff028047156e58b08b06346a19063c723c565a (patch)
tree18a471d51d99a4d2abdc7fc1c7b3b68c0f722b77 /arch
parentd57cb693c592d5148551b3ac858f14eb9e4812f3 (diff)
powerpc/64: Fix checksum folding in csum_add()
[ Upstream commit 6ad966d7303b70165228dba1ee8da1a05c10eefe ] Paul's patch to fix checksum folding, commit b492f7e4e07a ("powerpc/64: Fix checksum folding in csum_tcpudp_nofold and ip_fast_csum_nofold") missed a case in csum_add(). Fix it. Signed-off-by: Shile Zhang <shile.zhang@nokia.com> Acked-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/checksum.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/checksum.h b/arch/powerpc/include/asm/checksum.h
index 1e8fceb308a5..a67bb09585f4 100644
--- a/arch/powerpc/include/asm/checksum.h
+++ b/arch/powerpc/include/asm/checksum.h
@@ -100,7 +100,7 @@ static inline __wsum csum_add(__wsum csum, __wsum addend)
#ifdef __powerpc64__
res += (__force u64)addend;
- return (__force __wsum)((u32)res + (res >> 32));
+ return (__force __wsum) from64to32(res);
#else
asm("addc %0,%0,%1;"
"addze %0,%0;"