Commit 6ad966d7 authored by Shile Zhang's avatar Shile Zhang Committed by Michael Ellerman

powerpc/64: Fix checksum folding in csum_add()

Paul's patch to fix checksum folding, commit b492f7e4 ("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: default avatarShile Zhang <shile.zhang@nokia.com>
Acked-by: default avatarPaul Mackerras <paulus@ozlabs.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 2a9c4f40
...@@ -112,7 +112,7 @@ static inline __wsum csum_add(__wsum csum, __wsum addend) ...@@ -112,7 +112,7 @@ static inline __wsum csum_add(__wsum csum, __wsum addend)
#ifdef __powerpc64__ #ifdef __powerpc64__
res += (__force u64)addend; res += (__force u64)addend;
return (__force __wsum)((u32)res + (res >> 32)); return (__force __wsum) from64to32(res);
#else #else
asm("addc %0,%0,%1;" asm("addc %0,%0,%1;"
"addze %0,%0;" "addze %0,%0;"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment