[2/2] powerpc/signal: Add helper function to fetch quad word aligned pointer
mpe at ellerman.id.au
Thu Jul 16 16:09:49 AEST 2015
On Mon, 2015-06-07 at 10:25:34 UTC, Anshuman Khandual wrote:
> 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 <khandual at linux.vnet.ibm.com>
> 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.
More information about the Linuxppc-dev