summaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2007-07-19 10:49:09 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 19:04:50 +0200
commitea02e3dde3509ffa7fda7f8de9c8a366e03f7bbd (patch)
tree0c48aa948de8549a2b183c2ed3e5b338fa9730b7 /mm/slab.c
parentdequeue_huge_page() warning fix (diff)
downloadlinux-ea02e3dde3509ffa7fda7f8de9c8a366e03f7bbd.tar.xz
linux-ea02e3dde3509ffa7fda7f8de9c8a366e03f7bbd.zip
FRV: work around a possible compiler bug
Work around a possible bug in the FRV compiler. What appears to be happening is that gcc resolves the __builtin_constant_p() in kmalloc() to true, but then fails to reduce the therefore constant conditions in the if-statements it guards to constant results. When compiling with -O2 or -Os, one single spurious error crops up in cpuup_callback() in mm/slab.c. This can be avoided by making the memsize variable const. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 96d30ee256ef..88bc6336ce3d 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1163,7 +1163,7 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb,
struct kmem_cache *cachep;
struct kmem_list3 *l3 = NULL;
int node = cpu_to_node(cpu);
- int memsize = sizeof(struct kmem_list3);
+ const int memsize = sizeof(struct kmem_list3);
switch (action) {
case CPU_LOCK_ACQUIRE: