Commit 37f65303 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Andrew Morton
Browse files

sparc: ptrace: user_regset_copyin_ignore() always returns 0

user_regset_copyin_ignore() always returns 0, so checking its result seems
pointless -- don't do this anymore...

Link: https://lkml.kernel.org/r/20221014212235.10770-13-s.shtylyov@omp.ru


Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Cc: Brian Cain <bcain@quicinc.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Will Deacon <will@kernel.org>
Cc: Yoshinori Sato <ysato@users.osdn.me>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent aafdac9a
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -158,8 +158,9 @@ static int genregs32_set(struct task_struct *target,
				 35 * sizeof(u32), 36 * sizeof(u32));
				 35 * sizeof(u32), 36 * sizeof(u32));
	if (ret || !count)
	if (ret || !count)
		return ret;
		return ret;
	return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
	user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 36 * sizeof(u32),
					 36 * sizeof(u32), 38 * sizeof(u32));
				  38 * sizeof(u32));
	return 0;
}
}


static int fpregs32_get(struct task_struct *target,
static int fpregs32_get(struct task_struct *target,
@@ -203,7 +204,7 @@ static int fpregs32_set(struct task_struct *target,
					 33 * sizeof(u32),
					 33 * sizeof(u32),
					 34 * sizeof(u32));
					 34 * sizeof(u32));
	if (!ret)
	if (!ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
		user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
					  34 * sizeof(u32), -1);
					  34 * sizeof(u32), -1);
	return ret;
	return ret;
}
}
+11 −12
Original line number Original line Diff line number Diff line
@@ -332,7 +332,7 @@ static int genregs64_set(struct task_struct *target,
	}
	}


	if (!ret)
	if (!ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
		user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
					  36 * sizeof(u64), -1);
					  36 * sizeof(u64), -1);


	return ret;
	return ret;
@@ -406,7 +406,7 @@ static int fpregs64_set(struct task_struct *target,
	task_thread_info(target)->fpsaved[0] = fprs;
	task_thread_info(target)->fpsaved[0] = fprs;


	if (!ret)
	if (!ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
		user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
					  35 * sizeof(u64), -1);
					  35 * sizeof(u64), -1);
	return ret;
	return ret;
}
}
@@ -473,10 +473,8 @@ static int setregs64_set(struct task_struct *target,
				 15 * sizeof(u64));
				 15 * sizeof(u64));
	if (ret)
	if (ret)
		return ret;
		return ret;
	ret =user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
	user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
				  15 * sizeof(u64), 16 * sizeof(u64));
				  15 * sizeof(u64), 16 * sizeof(u64));
	if (ret)
		return ret;
	/* TSTATE */
	/* TSTATE */
	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
				 &tstate,
				 &tstate,
@@ -670,8 +668,9 @@ static int genregs32_set(struct task_struct *target,
	pos *= sizeof(reg);
	pos *= sizeof(reg);
	count *= sizeof(reg);
	count *= sizeof(reg);


	return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
	user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
				  38 * sizeof(reg), -1);
				  38 * sizeof(reg), -1);
	return 0;
}
}


static int fpregs32_get(struct task_struct *target,
static int fpregs32_get(struct task_struct *target,
@@ -737,7 +736,7 @@ static int fpregs32_set(struct task_struct *target,
	task_thread_info(target)->fpsaved[0] = fprs;
	task_thread_info(target)->fpsaved[0] = fprs;


	if (!ret)
	if (!ret)
		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
		user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
					  34 * sizeof(u32), -1);
					  34 * sizeof(u32), -1);
	return ret;
	return ret;
}
}