diff mbox

2.6.32-rc3: floating-point build failure (undefined reference to `__udivdi3' in menu governor)

Message ID 20091007174553.GC11702@bombadil.infradead.org (mailing list archive)
State RFC, archived
Headers show

Commit Message

kyle mcmartin Oct. 7, 2009, 5:45 p.m. UTC
None
diff mbox

Patch

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d3cd23f..4936eb6 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -51,6 +51,9 @@  extern const char linux_proc_banner[];
 #define DIV_ROUND_CLOSEST(x, divisor)(			\
 {							\
 	typeof(divisor) __divisor = divisor;		\
+	if (__builtin_types_compatible_p(typeof(divisor), unsigned long long) &&	\
+		__builtin_popcountll(__divisor) == 1)			\
+		(((x) + ((__divisor) / 2) << __builtin_ffsll(__divisor)));	\
 	(((x) + ((__divisor) / 2)) / (__divisor));	\
 }							\
 )