Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: csum: cast to the proper type

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>

authored by

Alex Elder and committed by
Will Deacon
0710442a c8e38668

+1 -1
+1 -1
arch/arm64/include/asm/checksum.h
··· 37 37 } while (--n > 0); 38 38 39 39 sum += ((sum >> 32) | (sum << 32)); 40 - return csum_fold((__force u32)(sum >> 32)); 40 + return csum_fold((__force __wsum)(sum >> 32)); 41 41 } 42 42 #define ip_fast_csum ip_fast_csum 43 43