summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2024-03-28 10:06:34 +0100
committerRichard Weinberger <richard@nod.at>2024-04-22 22:25:44 +0200
commit158a6b914c5196cdce2923e642a6acf0ebba3d31 (patch)
tree871f9ef5cdd2bd16c63929d16d31bf6f2336fd13 /arch/x86
parentum: Makefile: use bash from the environment (diff)
downloadlinux-158a6b914c5196cdce2923e642a6acf0ebba3d31.tar.xz
linux-158a6b914c5196cdce2923e642a6acf0ebba3d31.zip
um: signal: move pid variable where needed
We have W=1 warnings on 64-bit because the pid is only used in branches on 32-bit; move it inside to get rid of the warnings. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Tiwei Bie <tiwei.btw@antgroup.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/um/signal.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c
index 263e1d08f216..16ff097e790d 100644
--- a/arch/x86/um/signal.c
+++ b/arch/x86/um/signal.c
@@ -155,7 +155,7 @@ static int copy_sc_from_user(struct pt_regs *regs,
struct sigcontext __user *from)
{
struct sigcontext sc;
- int err, pid;
+ int err;
/* Always make any pending restarted system calls return -EINTR */
current->restart_block.fn = do_no_restart_syscall;
@@ -201,10 +201,10 @@ static int copy_sc_from_user(struct pt_regs *regs,
#undef GETREG
- pid = userspace_pid[current_thread_info()->cpu];
#ifdef CONFIG_X86_32
if (have_fpx_regs) {
struct user_fxsr_struct fpx;
+ int pid = userspace_pid[current_thread_info()->cpu];
err = copy_from_user(&fpx,
&((struct _fpstate __user *)sc.fpstate)->_fxsr_env[0],
@@ -240,7 +240,7 @@ static int copy_sc_to_user(struct sigcontext __user *to,
{
struct sigcontext sc;
struct faultinfo * fi = &current->thread.arch.faultinfo;
- int err, pid;
+ int err;
memset(&sc, 0, sizeof(struct sigcontext));
#define PUTREG(regno, regname) sc.regname = regs->regs.gp[HOST_##regno]
@@ -288,10 +288,9 @@ static int copy_sc_to_user(struct sigcontext __user *to,
if (err)
return 1;
- pid = userspace_pid[current_thread_info()->cpu];
-
#ifdef CONFIG_X86_32
if (have_fpx_regs) {
+ int pid = userspace_pid[current_thread_info()->cpu];
struct user_fxsr_struct fpx;
err = save_fpx_registers(pid, (unsigned long *) &fpx);