summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/checksum.h
diff options
context:
space:
mode:
authorAlexander Lobakin <alobakin@pm.me>2020-06-20 12:35:00 +0300
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2020-06-25 11:37:23 +0300
commitff711d67b1786ec1e3e4019d615287a2e890e9ab (patch)
tree15d1f44bf8ccde34e30b9abbd5dc6bc4a5aedbc4 /arch/mips/include/asm/checksum.h
parent7b5f96949da771e4bc47c6dc6de16c5e738635de (diff)
downloadlinux-ff711d67b1786ec1e3e4019d615287a2e890e9ab.tar.xz
MIPS: checksum: fix sparse flooding on asm/checksum.h
csum_fold() in MIPS' asm/checksum.h is another source of sparse flooding when building different networking source code. The thing is that only half of __wsum <--> u32 casts inside the function is forced, which is insufficient. Add all necessary forced typecasting to stop floods and simplify actual bug hunting. Signed-off-by: Alexander Lobakin <alobakin@pm.me> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/include/asm/checksum.h')
-rw-r--r--arch/mips/include/asm/checksum.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h
index dcebaaf8c862..181f7d14efb9 100644
--- a/arch/mips/include/asm/checksum.h
+++ b/arch/mips/include/asm/checksum.h
@@ -113,9 +113,9 @@ static inline __sum16 csum_fold(__wsum csum)
u32 sum = (__force u32)csum;
sum += (sum << 16);
- csum = (sum < csum);
+ csum = (__force __wsum)(sum < (__force u32)csum);
sum >>= 16;
- sum += csum;
+ sum += (__force u32)csum;
return (__force __sum16)~sum;
}