Skip to content

Commit ca31e14

Browse files
edgmnttorvalds
authored andcommitted
Move _RET_IP_ and _THIS_IP_ to include/linux/kernel.h
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 <[email protected]> Acked-by: Pekka Enberg <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 84df87b commit ca31e14

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

include/linux/debug_locks.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef __LINUX_DEBUG_LOCKING_H
22
#define __LINUX_DEBUG_LOCKING_H
33

4+
#include <linux/kernel.h>
5+
46
struct task_struct;
57

68
extern int debug_locks;
@@ -11,14 +13,6 @@ extern int debug_locks_silent;
1113
*/
1214
extern int debug_locks_off(void);
1315

14-
/*
15-
* In the debug case we carry the caller's instruction pointer into
16-
* other functions, but we dont want the function argument overhead
17-
* in the nondebug case - hence these macros:
18-
*/
19-
#define _RET_IP_ (unsigned long)__builtin_return_address(0)
20-
#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
21-
2216
#define DEBUG_LOCKS_WARN_ON(c) \
2317
({ \
2418
int __ret = 0; \

include/linux/kernel.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ extern const char linux_proc_banner[];
4646
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
4747
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
4848

49+
#define _RET_IP_ (unsigned long)__builtin_return_address(0)
50+
#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
51+
4952
#ifdef CONFIG_LBD
5053
# include <asm/div64.h>
5154
# define sector_div(a, b) do_div(a, b)

0 commit comments

Comments
 (0)