ARM: get rid of horrible *(unsigned int *)(regs + 1)
authorRussell King <rmk+kernel@armlinux.org.uk>
Fri, 13 May 2016 09:26:10 +0000 (10:26 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Wed, 22 Jun 2016 18:55:05 +0000 (19:55 +0100)
Get rid of the horrible "*(unsigned int *)(regs + 1)" to get at the
parent context domain access register value, instead using the newly
introduced svc_pt_regs structure.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/include/asm/ptrace.h
arch/arm/kernel/process.c

index 5194cf7..0ef0093 100644 (file)
@@ -25,6 +25,8 @@ struct svc_pt_regs {
        u32 unused;
 };
 
+#define to_svc_pt_regs(r) container_of(r, struct svc_pt_regs, regs)
+
 #define user_mode(regs)        \
        (((regs)->ARM_cpsr & 0xf) == 0)
 
index 4a803c5..f1c720c 100644 (file)
@@ -106,7 +106,7 @@ void __show_regs(struct pt_regs *regs)
        if (user_mode(regs))
                domain = DACR_UACCESS_ENABLE;
        else
-               domain = *(unsigned int *)(regs + 1);
+               domain = to_svc_pt_regs(regs)->dacr;
 #else
        domain = get_domain();
 #endif