[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/14] linux-user/sparc: Remove unneeded checks of 'err' from spar
From: |
Laurent Vivier |
Subject: |
[PULL 12/14] linux-user/sparc: Remove unneeded checks of 'err' from sparc64_get_context() |
Date: |
Fri, 18 Dec 2020 11:24:05 +0100 |
From: Peter Maydell <peter.maydell@linaro.org>
Unlike the kernel macros, our __get_user() and __put_user() do not
return a failure code. Kernel code typically has a style of
err |= __get_user(...); err |= __get_user(...);
and then checking err at the end. In sparc64_get_context() our
version of the code dropped the accumulating into err but left the
"if (err) goto do_sigsegv" checks, which will never be taken. Delete
unnecessary if()s.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201106152738.26026-3-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/sparc/signal.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c
index 0057b48fad93..58b48afe29c9 100644
--- a/linux-user/sparc/signal.c
+++ b/linux-user/sparc/signal.c
@@ -555,8 +555,6 @@ void sparc64_get_context(CPUSPARCState *env)
for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
__put_user(*src, dst);
}
- if (err)
- goto do_sigsegv;
}
/* XXX: tstate must be saved properly */
@@ -598,8 +596,6 @@ void sparc64_get_context(CPUSPARCState *env)
* hidden behind an "if (fenab)" where fenab is always 0).
*/
- if (err)
- goto do_sigsegv;
unlock_user_struct(ucp, ucp_addr, 1);
return;
do_sigsegv:
--
2.29.2
- [PULL 00/14] Linux user for 6.0 patches, Laurent Vivier, 2020/12/18
- [PULL 01/14] linux-user/mmap.c: check range of mremap result in target address space, Laurent Vivier, 2020/12/18
- [PULL 04/14] linux-user/elfload: Introduce MIPS GET_FEATURE_REG_SET() macro, Laurent Vivier, 2020/12/18
- [PULL 02/14] linux-user/elfload: Move GET_FEATURE macro out of get_elf_hwcap() body, Laurent Vivier, 2020/12/18
- [PULL 05/14] linux-user/elfload: Introduce MIPS GET_FEATURE_REG_EQU() macro, Laurent Vivier, 2020/12/18
- [PULL 10/14] linux-user: Add most IFTUN ioctls, Laurent Vivier, 2020/12/18
- [PULL 03/14] linux-user/elfload: Rename MIPS GET_FEATURE() as GET_FEATURE_INSN(), Laurent Vivier, 2020/12/18
- [PULL 09/14] linux-user: Implement copy_file_range, Laurent Vivier, 2020/12/18
- [PULL 06/14] linux-user/elfload: Update HWCAP bits from linux 5.7, Laurent Vivier, 2020/12/18
- [PULL 11/14] linux-user/sparc: Correct sparc64_get/set_context() FPU handling, Laurent Vivier, 2020/12/18
- [PULL 12/14] linux-user/sparc: Remove unneeded checks of 'err' from sparc64_get_context(),
Laurent Vivier <=
- [PULL 14/14] linux-user/sparc: Handle tstate in sparc64_get/set_context(), Laurent Vivier, 2020/12/18
- [PULL 08/14] docs/user: Display linux-user binaries nicely, Laurent Vivier, 2020/12/18
- [PULL 13/14] linux-user/sparc: Don't restore %g7 in sparc64_set_context(), Laurent Vivier, 2020/12/18
- [PULL 07/14] linux-user: Add support for MIPS Loongson 2F/3A, Laurent Vivier, 2020/12/18
- Re: [PULL 00/14] Linux user for 6.0 patches, Peter Maydell, 2020/12/31