Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Eduard - Gabriel Munteanu and committed by
Linus Torvalds
ca31e146 84df87b7

+5 -8
+2 -8
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; ··· 12 10 * Generic 'turn off all lock debugging' function: 13 11 */ 14 12 extern int debug_locks_off(void); 15 - 16 - /* 17 - * In the debug case we carry the caller's instruction pointer into 18 - * other functions, but we dont want the function argument overhead 19 - * in the nondebug case - hence these macros: 20 - */ 21 - #define _RET_IP_ (unsigned long)__builtin_return_address(0) 22 - #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) 23 13 24 14 #define DEBUG_LOCKS_WARN_ON(c) \ 25 15 ({ \
+3
include/linux/kernel.h
··· 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)