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 5194cf79c90f0f3576e1ea917ea5ed9d5e0c50e3..0ef0093800f25c90654d4853f925fc016b6b290c 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 4a803c5a1ff7276859b823a7b9b02dc24ee6e564..f1c720c0d5689519fa9ff559a940fe9db5ae4443 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
This page took 0.027796 seconds and 5 git commands to generate.