[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/18] signal/sparc64_set_context: remove __get_user
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 11/18] signal/sparc64_set_context: remove __get_user checks |
Date: |
Mon, 9 Jun 2014 15:46:36 +0300 |
From: Riku Voipio <address@hidden>
Remove checks of __get_user and the err variable
used to control flow with it.
Signed-off-by: Riku Voipio <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
---
linux-user/signal.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 3bb9a70..a76aa92 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -2527,7 +2527,6 @@ void sparc64_set_context(CPUSPARCState *env)
target_mc_gregset_t *grp;
abi_ulong pc, npc, tstate;
abi_ulong fp, i7, w_addr;
- int err = 0;
unsigned int i;
ucp_addr = env->regwptr[UREG_I0];
@@ -2536,15 +2535,14 @@ void sparc64_set_context(CPUSPARCState *env)
grp = &ucp->tuc_mcontext.mc_gregs;
__get_user(pc, &((*grp)[MC_PC]));
__get_user(npc, &((*grp)[MC_NPC]));
- if (err || ((pc | npc) & 3))
+ if ((pc | npc) & 3)
goto do_sigsegv;
if (env->regwptr[UREG_I1]) {
target_sigset_t target_set;
sigset_t set;
if (TARGET_NSIG_WORDS == 1) {
- if (__get_user(target_set.sig[0], &ucp->tuc_sigmask.sig[0]))
- goto do_sigsegv;
+ __get_user(target_set.sig[0], &ucp->tuc_sigmask.sig[0]);
} else {
abi_ulong *src, *dst;
src = ucp->tuc_sigmask.sig;
@@ -2552,8 +2550,6 @@ void sparc64_set_context(CPUSPARCState *env)
for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
__get_user(*dst, src);
}
- if (err)
- goto do_sigsegv;
}
target_to_host_sigset_internal(&set, &target_set);
do_sigprocmask(SIG_SETMASK, &set, NULL);
@@ -2596,7 +2592,7 @@ void sparc64_set_context(CPUSPARCState *env)
* is only restored if fenab is non-zero in:
* __get_user(fenab, &(ucp->tuc_mcontext.mc_fpregs.mcfpu_enab));
*/
- err |= __get_user(env->fprs, &(ucp->tuc_mcontext.mc_fpregs.mcfpu_fprs));
+ __get_user(env->fprs, &(ucp->tuc_mcontext.mc_fpregs.mcfpu_fprs));
{
uint32_t *src = ucp->tuc_mcontext.mc_fpregs.mcfpu_fregs.sregs;
for (i = 0; i < 64; i++, src++) {
@@ -2611,8 +2607,6 @@ void sparc64_set_context(CPUSPARCState *env)
&(ucp->tuc_mcontext.mc_fpregs.mcfpu_fsr));
__get_user(env->gsr,
&(ucp->tuc_mcontext.mc_fpregs.mcfpu_gsr));
- if (err)
- goto do_sigsegv;
unlock_user_struct(ucp, ucp_addr, 0);
return;
do_sigsegv:
--
2.0.0.rc2
- [Qemu-devel] [PULL 13/18] linux-user: fix gcc-4.9 compiler error on __{get, put]}_user, (continued)
- [Qemu-devel] [PULL 13/18] linux-user: fix gcc-4.9 compiler error on __{get, put]}_user, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 08/18] signal/all/do_sigreturn - remove __get_user checks, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 01/18] signal/all: remove __get/__put_user return value reading, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 18/18] User mode support for Linux ELF files with no section header, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 07/18] signal/all/do_sigaltstack remove __get_user value check, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 03/18] signal/all: remove return value from copy_siginfo_to_user, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 06/18] signal/sparc/restore_fpu_state: remove, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 05/18] signal/all: remove return value from restore_sigcontext, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 15/18] linux-user: Don't overrun guest buffer in sched_getaffinity, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 14/18] linux-user/uname: Return correct uname string for x86_64, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 11/18] signal/sparc64_set_context: remove __get_user checks,
riku . voipio <=
- [Qemu-devel] [PULL 16/18] linux-user: Tell guest about big host page sizes, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 04/18] signal/all: remove return value from setup_sigcontext, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 09/18] signal/all/setup_frame remove __put_user checks, riku . voipio, 2014/06/09
- Re: [Qemu-devel] [PULL 00/18] linux-user fixes, Peter Maydell, 2014/06/09