Re: [PATCH] SLQB: Use _RET_IP_ instead of__builtin_return_address(0)
From: Robert P. J. Day
Date: Sun May 03 2009 - 08:21:06 EST
On Sun, 3 May 2009, Pekka J Enberg wrote:
> From: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
>
> This patch changes SLQB to use the shorter _RET_IP_ form for consistency
> with SLUB and to prepare SQLB for eventual kmemtrace hooks.
... big snip ...
> void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags)
> {
> - return __kmem_cache_alloc(s, gfpflags, __builtin_return_address(0));
> + return __kmem_cache_alloc(s, gfpflags, _RET_IP_);
> }
since i originally pointed out this possible simplification, i might
as well also point out that the above is not necessarily correct. in
include/linux/kernel.h:
#define _RET_IP_ (unsigned long)__builtin_return_address(0)
as in, _RET_IP_ represents the **(unsigned long)** cast of that
(void*) value. so, technically, that's not merely an aesthetic
replacement. is that still what you wanted?
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Annoying Kernel Pedantry.
Web page: http://crashcourse.ca
Linked In: http://www.linkedin.com/in/rpjday
Twitter: http://twitter.com/rpjday
========================================================================
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/