aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slub_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r--include/linux/slub_def.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 5e2e7297dfaa..a9fb92862aaa 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -145,7 +145,12 @@ static inline struct kmem_cache *kmalloc_slab(size_t size)
145 if (index == 0) 145 if (index == 0)
146 return NULL; 146 return NULL;
147 147
148 if (index < 0) { 148 /*
149 * This function only gets expanded if __builtin_constant_p(size), so
150 * testing it here shouldn't be needed. But some versions of gcc need
151 * help.
152 */
153 if (__builtin_constant_p(size) && index < 0) {
149 /* 154 /*
150 * Generate a link failure. Would be great if we could 155 * Generate a link failure. Would be great if we could
151 * do something to stop the compile here. 156 * do something to stop the compile here.