summaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-02-05 11:26:38 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-05 11:26:38 -0800
commit7a21ef6fe902ac0ad53b45af6851ae5ec3a64299 (patch)
tree1e8c690f6fb644c8ce8873c7907ef0ed934446df /mm/slab.c
parentc265c46bbb8c53db0bd084261ab2996c6d74aebf (diff)
downloadop-kernel-dev-7a21ef6fe902ac0ad53b45af6851ae5ec3a64299.zip
op-kernel-dev-7a21ef6fe902ac0ad53b45af6851ae5ec3a64299.tar.gz
mm/slab.c (non-NUMA): Fix compile warning and clean up code
The non-NUMA case would do an unmatched "free_alien_cache()" on an alien pointer that had never been allocated. It might not matter from a code generation standpoint (since in the non-NUMA case, the code doesn't actually _do_ anything), but it not only results in a compiler warning, it's really really ugly too. Fix the compiler warning by just having a matching dummy allocation. That also avoids an unnecessary #ifdef in the code. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 9cc049a..d66c2b0 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -900,12 +900,18 @@ static void drain_alien_cache(struct kmem_cache *cachep, struct array_cache **al
}
}
#else
-#define alloc_alien_cache(node, limit) do { } while (0)
+
#define drain_alien_cache(cachep, alien) do { } while (0)
+static inline struct array_cache **alloc_alien_cache(int node, int limit)
+{
+ return (struct array_cache **) 0x01020304ul;
+}
+
static inline void free_alien_cache(struct array_cache **ac_ptr)
{
}
+
#endif
static int __devinit cpuup_callback(struct notifier_block *nfb,
@@ -970,11 +976,10 @@ static int __devinit cpuup_callback(struct notifier_block *nfb,
0xbaadf00d);
if (!shared)
goto bad;
-#ifdef CONFIG_NUMA
+
alien = alloc_alien_cache(node, cachep->limit);
if (!alien)
goto bad;
-#endif
cachep->array[cpu] = nc;
l3 = cachep->nodelists[node];
OpenPOWER on IntegriCloud