mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
nios2: fix __wsum type degradation in csum_fold()
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.
Fixes: eea9507a69 ("nios2: Library functions")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Keith Busch <[email protected]>
Signed-off-by: Dinh Nguyen <[email protected]>
This commit is contained in:
1 parent
cee9395acd
commit
b963f2345f
1 file changed
+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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user