Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Sergey 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: Andrew Morton <akpm@linux-foundation.org>

authored by

Sergey Shtylyov and committed by
Andrew Morton
37f65303 aafdac9a

+16 -16
+5 -4
arch/sparc/kernel/ptrace_32.c
··· 158 158 35 * sizeof(u32), 36 * sizeof(u32)); 159 159 if (ret || !count) 160 160 return ret; 161 - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 162 - 36 * sizeof(u32), 38 * sizeof(u32)); 161 + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 36 * sizeof(u32), 162 + 38 * sizeof(u32)); 163 + return 0; 163 164 } 164 165 165 166 static int fpregs32_get(struct task_struct *target, ··· 204 203 33 * sizeof(u32), 205 204 34 * sizeof(u32)); 206 205 if (!ret) 207 - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 208 - 34 * sizeof(u32), -1); 206 + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 207 + 34 * sizeof(u32), -1); 209 208 return ret; 210 209 } 211 210
+11 -12
arch/sparc/kernel/ptrace_64.c
··· 332 332 } 333 333 334 334 if (!ret) 335 - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 336 - 36 * sizeof(u64), -1); 335 + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 336 + 36 * sizeof(u64), -1); 337 337 338 338 return ret; 339 339 } ··· 406 406 task_thread_info(target)->fpsaved[0] = fprs; 407 407 408 408 if (!ret) 409 - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 410 - 35 * sizeof(u64), -1); 409 + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 410 + 35 * sizeof(u64), -1); 411 411 return ret; 412 412 } 413 413 ··· 473 473 15 * sizeof(u64)); 474 474 if (ret) 475 475 return ret; 476 - ret =user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 477 - 15 * sizeof(u64), 16 * sizeof(u64)); 478 - if (ret) 479 - return ret; 476 + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 477 + 15 * sizeof(u64), 16 * sizeof(u64)); 480 478 /* TSTATE */ 481 479 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, 482 480 &tstate, ··· 668 670 pos *= sizeof(reg); 669 671 count *= sizeof(reg); 670 672 671 - return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 672 - 38 * sizeof(reg), -1); 673 + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 674 + 38 * sizeof(reg), -1); 675 + return 0; 673 676 } 674 677 675 678 static int fpregs32_get(struct task_struct *target, ··· 736 737 task_thread_info(target)->fpsaved[0] = fprs; 737 738 738 739 if (!ret) 739 - ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 740 - 34 * sizeof(u32), -1); 740 + user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 741 + 34 * sizeof(u32), -1); 741 742 return ret; 742 743 } 743 744