arm64: csum: cast to the proper type
authorAlex Elder <elder@linaro.org>
Mon, 15 Mar 2021 01:26:50 +0000 (20:26 -0500)
committerWill Deacon <will@kernel.org>
Mon, 15 Mar 2021 10:57:21 +0000 (10:57 +0000)
The last line of ip_fast_csum() calls csum_fold(), forcing the
type of the argument passed to be u32.  But csum_fold() takes a
__wsum argument (which is __u32 __bitwise for arm64).  As long
as we're forcing the cast, cast it to the right type.

Signed-off-by: Alex Elder <elder@linaro.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20210315012650.1221328-1-elder@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/checksum.h

index 93a161b..dc52b73 100644 (file)
@@ -37,7 +37,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
        } while (--n > 0);
 
        sum += ((sum >> 32) | (sum << 32));
-       return csum_fold((__force u32)(sum >> 32));
+       return csum_fold((__force __wsum)(sum >> 32));
 }
 #define ip_fast_csum ip_fast_csum