Thread (3 messages) flat view 3 messages, 2 authors, 2015-07-16

Re: [2/2] powerpc/signal: Add helper function to fetch quad word aligned pointer

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-07-16 06:09:50

On Mon, 2015-06-07 at 10:25:34 UTC, Anshuman Khandual wrote:
quoted hunk ↗ jump to hunk
This patch adds one helper function 'vmx_reserve_addr' which computes
quad word aligned pointer for vmx_reserve array element in sigcontext
structure making the code more readable.

Signed-off-by: Anshuman Khandual <redacted>
---
 arch/powerpc/kernel/signal_64.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index c7c24d2..e8762f5 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -73,6 +73,12 @@ static const char fmt32[] = KERN_INFO \
 static const char fmt64[] = KERN_INFO \
 	"%s[%d]: bad frame in %s: %016lx nip %016lx lr %016lx\n";
 
+static elf_vrreg_t __user *vmx_reserve_addr(struct sigcontext __user *sc)
+{
+		return (elf_vrreg_t __user *)
+			(((unsigned long)sc->vmx_reserve + 15) & ~0xful);
You have more tabs here than you need. Please put it on one line, I don't care
if it's a bit more than 80 chars.

Please add a comment describing what it's doing and why.

Also I think I'd prefer if it was named sigcontext_vmx_regs() or something more
like that, ie. it's about sigcontext primarily.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help