]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arm64: add missing conversion to __wsum in ip_fast_csum()
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
Thu, 29 Jun 2017 14:31:40 +0000 (16:31 +0200)
committerWill Deacon <will.deacon@arm.com>
Thu, 29 Jun 2017 15:32:43 +0000 (16:32 +0100)
ARM64 implementation of ip_fast_csum() do most of the work
in 128 or 64 bit and call csum_fold() to finalize. csum_fold()
itself take a __wsum argument, to insure that this value is
always a 32bit native-order value.

Fix this by adding the sadly needed '__force' to cast the native
'sum' to the type '__wsum'.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/checksum.h

index 09f65339d66df819272baeda20f35991ccc9f055..0b6f5a7d4027c56fcd868e3aecc0f93ef1f10432 100644 (file)
@@ -42,7 +42,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
        } while (--ihl);
 
        sum += ((sum >> 32) | (sum << 32));
-       return csum_fold(sum >> 32);
+       return csum_fold((__force u32)(sum >> 32));
 }
 #define ip_fast_csum ip_fast_csum