[PATCH 3/5] SLUB: Replace __builtin_return_address(0) with _RET_IP_.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eduard - Gabriel Munteanu
Date: Tuesday, August 19, 2008 - 10:43 am

This patch replaces __builtin_return_address(0) with _RET_IP_, since a
previous patch moved _RET_IP_ and _THIS_IP_ to include/linux/kernel.h and
they're widely available now. This makes for shorter and easier to read
code.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
---
 mm/slub.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 4f5b961..8f66782 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1612,14 +1612,14 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
 
 void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags)
 {
-	return slab_alloc(s, gfpflags, -1, __builtin_return_address(0));
+	return slab_alloc(s, gfpflags, -1, (void *) _RET_IP_);
 }
 EXPORT_SYMBOL(kmem_cache_alloc);
 
 #ifdef CONFIG_NUMA
 void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t gfpflags, int node)
 {
-	return slab_alloc(s, gfpflags, node, __builtin_return_address(0));
+	return slab_alloc(s, gfpflags, node, (void *) _RET_IP_);
 }
 EXPORT_SYMBOL(kmem_cache_alloc_node);
 #endif
@@ -1730,7 +1730,7 @@ void kmem_cache_free(struct kmem_cache *s, void *x)
 
 	page = virt_to_head_page(x);
 
-	slab_free(s, page, x, __builtin_return_address(0));
+	slab_free(s, page, x, (void *) _RET_IP_);
 }
 EXPORT_SYMBOL(kmem_cache_free);
 
@@ -2657,7 +2657,7 @@ void *__kmalloc(size_t size, gfp_t flags)
 	if (unlikely(ZERO_OR_NULL_PTR(s)))
 		return s;
 
-	return slab_alloc(s, flags, -1, __builtin_return_address(0));
+	return slab_alloc(s, flags, -1, (void *) _RET_IP_);
 }
 EXPORT_SYMBOL(__kmalloc);
 
@@ -2685,7 +2685,7 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
 	if (unlikely(ZERO_OR_NULL_PTR(s)))
 		return s;
 
-	return slab_alloc(s, flags, node, __builtin_return_address(0));
+	return slab_alloc(s, flags, node, (void *) _RET_IP_);
 }
 EXPORT_SYMBOL(__kmalloc_node);
 #endif
@@ -2742,7 +2742,7 @@ void kfree(const void *x)
 		put_page(page);
 		return;
 	}
-	slab_free(page->slab, page, object, __builtin_return_address(0));
+	slab_free(page->slab, page, object, (void *) _RET_IP_);
 }
 EXPORT_SYMBOL(kfree);
 
-- 
1.5.6.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/5] Revert &quot;kmemtrace: fix printk format warnings&quot;, Eduard - Gabriel Mun ..., (Tue Aug 19, 10:43 am)
[PATCH 2/5] kmemtrace: Better alternative to &quot;kmemtrace: f ..., Eduard - Gabriel Mun ..., (Tue Aug 19, 10:43 am)
[PATCH 3/5] SLUB: Replace __builtin_return_address(0) with ..., Eduard - Gabriel Mun ..., (Tue Aug 19, 10:43 am)
[PATCH 4/5] kmemtrace: SLUB hooks., Eduard - Gabriel Mun ..., (Tue Aug 19, 10:43 am)
[PATCH 5/5] kmemtrace: Fix 2 typos in documentation., Eduard - Gabriel Mun ..., (Tue Aug 19, 10:43 am)
Re: [PATCH 1/5] Revert &quot;kmemtrace: fix printk format warnings&quot;, Eduard - Gabriel Mun ..., (Tue Aug 19, 10:54 am)
Re: [PATCH 3/5] SLUB: Replace __builtin_return_address(0) ..., Christoph Lameter, (Tue Aug 19, 11:14 am)
Re: [PATCH 3/5] SLUB: Replace __builtin_return_address(0) ..., Eduard - Gabriel Mun ..., (Tue Aug 19, 11:24 am)
Re: [PATCH 1/5] Revert &quot;kmemtrace: fix printk format warnings&quot;, Eduard - Gabriel Mun ..., (Tue Aug 19, 11:32 am)
Re: [PATCH 3/5] SLUB: Replace __builtin_return_address(0) ..., Christoph Lameter, (Tue Aug 19, 11:56 am)
Re: [PATCH 3/5] SLUB: Replace __builtin_return_address(0) ..., Eduard - Gabriel Mun ..., (Tue Aug 19, 12:05 pm)
Re: [PATCH 4/5] kmemtrace: SLUB hooks., Pekka Enberg, (Tue Aug 19, 12:10 pm)
Re: [PATCH 5/5] kmemtrace: Fix 2 typos in documentation., Pekka Enberg, (Tue Aug 19, 12:10 pm)
Re: [PATCH 3/5] SLUB: Replace __builtin_return_address(0) ..., Christoph Lameter, (Tue Aug 19, 1:17 pm)
Re: [PATCH 3/5] SLUB: Replace __builtin_return_address(0) ..., Christoph Lameter, (Tue Aug 19, 1:23 pm)
Re: [PATCH 1/5] Revert &quot;kmemtrace: fix printk format warnings&quot;, Eduard - Gabriel Mun ..., (Tue Aug 19, 2:37 pm)