From fb8f70d1e8ce36ac996658a7985ed76734dcb70c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 16 May 2007 22:10:54 -0700 Subject: [PATCH] --- yaml --- r: 56513 b: refs/heads/master c: ade3aff25fb2dce76e2a9b53e1334bd0a174f739 h: refs/heads/master i: 56511: 6169015c2801e8b9c32c274e37a1a02c547cd785 v: v3 --- [refs] | 2 +- trunk/include/linux/slub_def.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 3cb41af20105..b10e59cb5823 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0b44f7a5b5078d737b3f5914978aabb761254840 +refs/heads/master: ade3aff25fb2dce76e2a9b53e1334bd0a174f739 diff --git a/trunk/include/linux/slub_def.h b/trunk/include/linux/slub_def.h index 5e2e7297dfaa..a9fb92862aaa 100644 --- a/trunk/include/linux/slub_def.h +++ b/trunk/include/linux/slub_def.h @@ -145,7 +145,12 @@ static inline struct kmem_cache *kmalloc_slab(size_t size) if (index == 0) return NULL; - if (index < 0) { + /* + * This function only gets expanded if __builtin_constant_p(size), so + * testing it here shouldn't be needed. But some versions of gcc need + * help. + */ + if (__builtin_constant_p(size) && index < 0) { /* * Generate a link failure. Would be great if we could * do something to stop the compile here.