Skip to content

Commit 65412c8

Browse files
arndbbp3tk0v
authored andcommitted
x86/asm: Avoid unneeded __div64_32 function definition
The __div64_32() function is provided for 32-bit architectures that don't have a custom do_div() implementation. x86_32 has one, and does not use the header file that declares the function prototype, so the definition causes a W=1 warning: lib/math/div64.c:31:32: error: no previous prototype for '__div64_32' [-Werror=missing-prototypes] Define an empty macro to prevent the function definition from getting built, which avoids the warning and saves a little .text space. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 22dc02f commit 65412c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/x86/include/asm/div64.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ static inline u64 mul_u32_u32(u32 a, u32 b)
7171
}
7272
#define mul_u32_u32 mul_u32_u32
7373

74+
/*
75+
* __div64_32() is never called on x86, so prevent the
76+
* generic definition from getting built.
77+
*/
78+
#define __div64_32
79+
7480
#else
7581
# include <asm-generic/div64.h>
7682

0 commit comments

Comments
 (0)