Commit ca31e146d5c2fe51498e619eb3a64782d02e310a

Authored by Eduard - Gabriel Munteanu
Committed by Linus Torvalds
1 parent 84df87b7eb

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 <eduard.munteanu@linux360.ro>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 5 additions and 8 deletions Side-by-side Diff

include/linux/debug_locks.h
1 1 #ifndef __LINUX_DEBUG_LOCKING_H
2 2 #define __LINUX_DEBUG_LOCKING_H
3 3  
  4 +#include <linux/kernel.h>
  5 +
4 6 struct task_struct;
5 7  
6 8 extern int debug_locks;
... ... @@ -10,14 +12,6 @@
10 12 * Generic 'turn off all lock debugging' function:
11 13 */
12 14 extern int debug_locks_off(void);
13   -
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 15  
22 16 #define DEBUG_LOCKS_WARN_ON(c) \
23 17 ({ \
include/linux/kernel.h
... ... @@ -46,6 +46,9 @@
46 46 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
47 47 #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
48 48  
  49 +#define _RET_IP_ (unsigned long)__builtin_return_address(0)
  50 +#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
  51 +
49 52 #ifdef CONFIG_LBD
50 53 # include <asm/div64.h>
51 54 # define sector_div(a, b) do_div(a, b)