Skip to content

Commit 780813d

Browse files
arndbbp3tk0v
authored andcommitted
x86/math-emu: Fix div_Xsig() prototype
The third argument of div_Xsig() is the output of the division, but is marked 'const', which means the compiler is not expecting it to be updated and may generate bad code around the call. clang-21 now warns about the pattern since an uninitialized variable is passed into two 'const' arguments by reference: arch/x86/math-emu/poly_atan.c:93:28: error: variable 'argSignif' is uninitialized \ when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] 93 | div_Xsig(&Numer, &Denom, &argSignif); | ^~~~~~~~~ arch/x86/math-emu/poly_l2.c:195:29: error: variable 'argSignif' is uninitialized \ when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] 195 | div_Xsig(&Numer, &Denom, &argSignif); | ^~~~~~~~~ The implementation is in assembly, so the problem has gone unnoticed since the code was added in the linux-1.1 days. Remove the 'const' marker here. Fixes: e19a1bd ("Import 1.1.38") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://patch.msgid.link/20250807205334.123231-1-arnd@kernel.org
1 parent 6146a0f commit 780813d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/math-emu/poly.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ asmlinkage void mul_Xsig_Xsig(Xsig *dest, const Xsig *mult);
3939
asmlinkage void shr_Xsig(Xsig *, const int n);
4040
asmlinkage int round_Xsig(Xsig *);
4141
asmlinkage int norm_Xsig(Xsig *);
42-
asmlinkage void div_Xsig(Xsig *x1, const Xsig *x2, const Xsig *dest);
42+
asmlinkage void div_Xsig(Xsig *x1, const Xsig *x2, Xsig *dest);
4343

4444
/* Macro to extract the most significant 32 bits from a long long */
4545
#define LL_MSW(x) (((unsigned long *)&x)[1])

0 commit comments

Comments
 (0)