Pārlūkot izejas kodu

[ARM] 3100/1: simplify a pointer computation

Patch from Nicolas Pitre

Looks clearer this way.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Nicolas Pitre 19 gadi atpakaļ
vecāks
revīzija
c906107bb7
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      arch/arm/kernel/process.c

+ 1 - 1
arch/arm/kernel/process.c

@@ -355,7 +355,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start,
 	struct thread_info *thread = p->thread_info;
 	struct pt_regs *childregs;
 
-	childregs = ((struct pt_regs *)((unsigned long)thread + THREAD_START_SP)) - 1;
+	childregs = (void *)thread + THREAD_START_SP - sizeof(*regs);
 	*childregs = *regs;
 	childregs->ARM_r0 = 0;
 	childregs->ARM_sp = stack_start;