aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2007-07-13 10:02:29 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-07-13 12:40:00 -0400
commite70dfc10b99ebffa1f464b1b9290df2589284f70 (patch)
treecf781d6ee4bc032ea7ac24a2b8eb53de33d9cb18 /arch/mips
parente50e1c744df20e704441a99eef7c6414e6920712 (diff)
[MIPS] math-emu minor cleanup
Declaring emulpc and contpc as "unsigned long" can get rid of some casts. This also get rid of some sparse warnings. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/math-emu/cp1emu.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index d7f05b0abe17..17419e11ecad 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -205,7 +205,7 @@ static int isBranchInstr(mips_instruction * i)
205static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) 205static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
206{ 206{
207 mips_instruction ir; 207 mips_instruction ir;
208 void * emulpc, *contpc; 208 unsigned long emulpc, contpc;
209 unsigned int cond; 209 unsigned int cond;
210 210
211 if (get_user(ir, (mips_instruction __user *) xcp->cp0_epc)) { 211 if (get_user(ir, (mips_instruction __user *) xcp->cp0_epc)) {
@@ -230,7 +230,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
230 * Linux MIPS branch emulator operates on context, updating the 230 * Linux MIPS branch emulator operates on context, updating the
231 * cp0_epc. 231 * cp0_epc.
232 */ 232 */
233 emulpc = (void *) (xcp->cp0_epc + 4); /* Snapshot emulation target */ 233 emulpc = xcp->cp0_epc + 4; /* Snapshot emulation target */
234 234
235 if (__compute_return_epc(xcp)) { 235 if (__compute_return_epc(xcp)) {
236#ifdef CP1DBG 236#ifdef CP1DBG
@@ -244,12 +244,12 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
244 return SIGBUS; 244 return SIGBUS;
245 } 245 }
246 /* __compute_return_epc() will have updated cp0_epc */ 246 /* __compute_return_epc() will have updated cp0_epc */
247 contpc = (void *) xcp->cp0_epc; 247 contpc = xcp->cp0_epc;
248 /* In order not to confuse ptrace() et al, tweak context */ 248 /* In order not to confuse ptrace() et al, tweak context */
249 xcp->cp0_epc = (unsigned long) emulpc - 4; 249 xcp->cp0_epc = emulpc - 4;
250 } else { 250 } else {
251 emulpc = (void *) xcp->cp0_epc; 251 emulpc = xcp->cp0_epc;
252 contpc = (void *) (xcp->cp0_epc + 4); 252 contpc = xcp->cp0_epc + 4;
253 } 253 }
254 254
255 emul: 255 emul:
@@ -427,8 +427,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
427 * instruction 427 * instruction
428 */ 428 */
429 xcp->cp0_epc += 4; 429 xcp->cp0_epc += 4;
430 contpc = (void *) 430 contpc = (xcp->cp0_epc +
431 (xcp->cp0_epc +
432 (MIPSInst_SIMM(ir) << 2)); 431 (MIPSInst_SIMM(ir) << 2));
433 432
434 if (get_user(ir, 433 if (get_user(ir,
@@ -462,7 +461,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
462 * Single step the non-cp1 461 * Single step the non-cp1
463 * instruction in the dslot 462 * instruction in the dslot
464 */ 463 */
465 return mips_dsemul(xcp, ir, (unsigned long) contpc); 464 return mips_dsemul(xcp, ir, contpc);
466 } 465 }
467 else { 466 else {
468 /* branch not taken */ 467 /* branch not taken */
@@ -521,7 +520,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx)
521 } 520 }
522 521
523 /* we did it !! */ 522 /* we did it !! */
524 xcp->cp0_epc = (unsigned long) contpc; 523 xcp->cp0_epc = contpc;
525 xcp->cp0_cause &= ~CAUSEF_BD; 524 xcp->cp0_cause &= ~CAUSEF_BD;
526 525
527 return 0; 526 return 0;