linux-mips
[Top] [All Lists]

Re: A blind patch:)

To: Songmao Tian <tiansm@lemote.com>
Subject: Re: A blind patch:)
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 30 Jul 2007 18:18:04 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <46AE049C.6040500@lemote.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <46AE049C.6040500@lemote.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.14 (2007-02-12)
On Mon, Jul 30, 2007 at 11:32:44PM +0800, Songmao Tian wrote:

> commit 5fabf601a53079c182d5c25f6e850d6a7bd48988 is broken. since the 
> regptr is disappeared in the signature of the function, I think the 
> regptr is useless.

Indeed, you found a bug but your fix wasn't right.

  Ralf

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index bbf20ce..d34b1fb 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -281,9 +281,8 @@ static void emulate_load_store_insn(struct pt_regs *regs,
                        : "r" (addr), "i" (-EFAULT));
                if (res)
                        goto fault;
-               *regptr = &regs->regs[insn.i_format.rt];
                compute_return_epc(regs);
-               *regptr = value;
+               regs->regs[insn.i_format.rt] = value;
                break;
 #endif /* CONFIG_64BIT */
 
@@ -324,9 +323,8 @@ static void emulate_load_store_insn(struct pt_regs *regs,
                        : "r" (addr), "i" (-EFAULT));
                if (res)
                        goto fault;
-               *regptr = &regs->regs[insn.i_format.rt];
                compute_return_epc(regs);
-               *regptr = value;
+               regs->regs[insn.i_format.rt] = value;
                break;
 #endif /* CONFIG_64BIT */
 

<Prev in Thread] Current Thread [Next in Thread>