sh: correct definitions to access stack pointers
authorRoel Kluin <roel.kluin@gmail.com>
Sat, 1 Jan 2011 18:36:36 +0000 (18:36 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 5 Jan 2011 07:58:19 +0000 (16:58 +0900)
A definition like:

#define regs_return_value(regs) ((regs)->regs[0])

called with regs_return_value(foo) will be preprocessed to:

((foo)->foo[0])
        ^^^
So to fix this to ensure the preprocessor compiles such calls correctly.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/include/asm/ptrace.h
arch/sh/include/asm/ptrace_32.h
arch/sh/include/asm/ptrace_64.h

index f6edc10aa0d338e2041de62d4359f03c85662596..de167d3a1a8023423cd9ed83f42e2038aa01bbee 100644 (file)
@@ -40,8 +40,8 @@
 #include <asm/system.h>
 
 #define user_mode(regs)                        (((regs)->sr & 0x40000000)==0)
-#define user_stack_pointer(regs)       ((unsigned long)(regs)->regs[15])
-#define kernel_stack_pointer(regs)     ((unsigned long)(regs)->regs[15])
+#define user_stack_pointer(_regs)      ((unsigned long)(_regs)->regs[15])
+#define kernel_stack_pointer(_regs)    ((unsigned long)(_regs)->regs[15])
 #define instruction_pointer(regs)      ((unsigned long)(regs)->pc)
 
 extern void show_regs(struct pt_regs *);
index 35d9e257558cb16936696d576223b0589eecb662..6c2239cca1a2d86204a52ecef53ab5514f8a6073 100644 (file)
@@ -76,7 +76,7 @@ struct pt_dspregs {
 #ifdef __KERNEL__
 
 #define MAX_REG_OFFSET         offsetof(struct pt_regs, tra)
-#define regs_return_value(regs)        ((regs)->regs[0])
+#define regs_return_value(_regs)       ((_regs)->regs[0])
 
 #endif /* __KERNEL__ */
 
index d43c1cb0bbe705fcffe6760e93dc6bdf716f2409..bf9be7764d69f250978300cfb5c3e556e0d71e76 100644 (file)
@@ -13,7 +13,7 @@ struct pt_regs {
 #ifdef __KERNEL__
 
 #define MAX_REG_OFFSET         offsetof(struct pt_regs, tregs[7])
-#define regs_return_value(regs)        ((regs)->regs[3])
+#define regs_return_value(_regs)       ((_regs)->regs[3])
 
 #endif /* __KERNEL__ */