nios2: fix __wsum type degradation in csum_fold()
Subsystems (2)
PATCH 1/1 nios2: fix __wsum type degradation in csum_fold()
From: Keith Busch <[email protected]>
csum_fold() shifts a bitwise __wsum type, which sparse reports as "restricted __wsum degrades to integer". Sparse only checks the body of a static inline once something instantiates it, so this went unnoticed until a recent block layer change added the first csum_fold() caller to a file built on this architecture.
Force cast to a __u32 for the shift, as the other architectures do.
--- arch/nios2/include/asm/checksum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nios2/include/asm/checksum.h +1 -1
@@ -27,7 +27,7 @@ static inline __sum16 csum_fold(__wsum sum) "add %0, %0, r8\n" "nor %0, %0, %0\n" : "=r" (sum) - : "r" (sum << 16), "0" (sum) + : "r" ((__force u32)sum << 16), "0" (sum) : "r8");return (__force __sum16 ) sum; }
Signature · 1 line
2.52.0
Quoted 9 lines · Keith Busch
From: Keith Busch <[email protected]>
csum_fold()shifts a bitwise__wsumtype, which sparse reports as "restricted__wsumdegrades to integer". Sparse only checks the body of a static inline once something instantiates it, so this went unnoticed until a recent block layer change added the firstcsum_fold()caller to a file built on this architecture.Force cast to a
__u32for the shift, as the other architectures do.
Ping on this one?
Quoted 9 lines · Keith Busch
Quoted 8 lines · Keith Busch
From: Keith Busch <[email protected]>
csum_fold()shifts a bitwise__wsumtype, which sparse reports as "restricted__wsumdegrades to integer". Sparse only checks the body of a static inline once something instantiates it, so this went unnoticed until a recent block layer change added the firstcsum_fold()caller to a file built on this architecture.
Quoted 3 lines
Quoted 1 line
Force cast to a
__u32for the shift, as the other architectures do.Ping on this one?
Applied!
Sorry for the delay.
THanks,
Dinh