Skip to content

Commit 158a6b9

Browse files
jmberg-intelrichardweinberger
authored andcommitted
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 <[email protected]> Reviewed-by: Tiwei Bie <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 19ee692 commit 158a6b9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

arch/x86/um/signal.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static int copy_sc_from_user(struct pt_regs *regs,
155155
struct sigcontext __user *from)
156156
{
157157
struct sigcontext sc;
158-
int err, pid;
158+
int err;
159159

160160
/* Always make any pending restarted system calls return -EINTR */
161161
current->restart_block.fn = do_no_restart_syscall;
@@ -201,10 +201,10 @@ static int copy_sc_from_user(struct pt_regs *regs,
201201

202202
#undef GETREG
203203

204-
pid = userspace_pid[current_thread_info()->cpu];
205204
#ifdef CONFIG_X86_32
206205
if (have_fpx_regs) {
207206
struct user_fxsr_struct fpx;
207+
int pid = userspace_pid[current_thread_info()->cpu];
208208

209209
err = copy_from_user(&fpx,
210210
&((struct _fpstate __user *)sc.fpstate)->_fxsr_env[0],
@@ -240,7 +240,7 @@ static int copy_sc_to_user(struct sigcontext __user *to,
240240
{
241241
struct sigcontext sc;
242242
struct faultinfo * fi = &current->thread.arch.faultinfo;
243-
int err, pid;
243+
int err;
244244
memset(&sc, 0, sizeof(struct sigcontext));
245245

246246
#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,
288288
if (err)
289289
return 1;
290290

291-
pid = userspace_pid[current_thread_info()->cpu];
292-
293291
#ifdef CONFIG_X86_32
294292
if (have_fpx_regs) {
293+
int pid = userspace_pid[current_thread_info()->cpu];
295294
struct user_fxsr_struct fpx;
296295

297296
err = save_fpx_registers(pid, (unsigned long *) &fpx);

0 commit comments

Comments
 (0)