* [PATCH] Move _RET_IP_ and _THIS_IP_ to include/linux/kernel.h
@ 2008-07-05 9:14 Eduard - Gabriel Munteanu
2008-07-05 11:36 ` Pekka Enberg
0 siblings, 1 reply; 2+ messages in thread
From: Eduard - Gabriel Munteanu @ 2008-07-05 9:14 UTC (permalink / raw)
To: akpm; +Cc: torvalds, linux-kernel, penberg
These two macros are useful beyond lock debugging. Moved definitions from
include/linux/debug_locks.h to include/linux/kernel.h, so code that needs
them does not have to include the former, which would have been a less
intuitive choice of a header.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
---
include/linux/debug_locks.h | 10 ++--------
include/linux/kernel.h | 3 +++
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index f4a5871..4aaa4af 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -1,6 +1,8 @@
#ifndef __LINUX_DEBUG_LOCKING_H
#define __LINUX_DEBUG_LOCKING_H
+#include <linux/kernel.h>
+
struct task_struct;
extern int debug_locks;
@@ -11,14 +13,6 @@ extern int debug_locks_silent;
*/
extern int debug_locks_off(void);
-/*
- * In the debug case we carry the caller's instruction pointer into
- * other functions, but we dont want the function argument overhead
- * in the nondebug case - hence these macros:
- */
-#define _RET_IP_ (unsigned long)__builtin_return_address(0)
-#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
-
#define DEBUG_LOCKS_WARN_ON(c) \
({ \
int __ret = 0; \
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 792bf0a..2e70006 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -46,6 +46,9 @@ extern const char linux_proc_banner[];
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#define _RET_IP_ (unsigned long)__builtin_return_address(0)
+#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
+
#ifdef CONFIG_LBD
# include <asm/div64.h>
# define sector_div(a, b) do_div(a, b)
--
1.5.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Move _RET_IP_ and _THIS_IP_ to include/linux/kernel.h
2008-07-05 9:14 [PATCH] Move _RET_IP_ and _THIS_IP_ to include/linux/kernel.h Eduard - Gabriel Munteanu
@ 2008-07-05 11:36 ` Pekka Enberg
0 siblings, 0 replies; 2+ messages in thread
From: Pekka Enberg @ 2008-07-05 11:36 UTC (permalink / raw)
To: Eduard - Gabriel Munteanu; +Cc: akpm, torvalds, linux-kernel
On Sat, Jul 5, 2008 at 12:14 PM, Eduard - Gabriel Munteanu
<eduard.munteanu@linux360.ro> wrote:
> These two macros are useful beyond lock debugging. Moved definitions from
> include/linux/debug_locks.h to include/linux/kernel.h, so code that needs
> them does not have to include the former, which would have been a less
> intuitive choice of a header.
>
> Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-05 11:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-05 9:14 [PATCH] Move _RET_IP_ and _THIS_IP_ to include/linux/kernel.h Eduard - Gabriel Munteanu
2008-07-05 11:36 ` Pekka Enberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox