Re: 2.6.23-rc8 build failure: __you_cannot_kmalloc_that_much in dmi_id_init

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jean Delvare <khali@...>
Cc: LKML <linux-kernel@...>, Christoph Lameter <clameter@...>, Roland Dreier <rolandd@...>
Date: Thursday, October 4, 2007 - 4:48 am

On Tue, 2 Oct 2007 23:26:42 +0200 Jean Delvare <khali@linux-fr.org> wrote:


Yeah, the tricks we play in there do fool some versions of gcc, and you see
the result.

Roland came up with this:

--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -145,7 +145,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
 	 * testing it here shouldn't be needed.  But some versions of gcc need
 	 * help.
 	 */
-	if (__builtin_constant_p(size) && index < 0) {
+	if (__builtin_constant_p(index) && index < 0) {
 		/*
 		 * Generate a link failure. Would be great if we could
 		 * do something to stop the compile here.



Does it fix things for you?
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: 2.6.23-rc8 build failure: __you_cannot_kmalloc_that_much..., Andrew Morton, (Thu Oct 4, 4:48 am)