]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS/ptrace: Update mips_get_syscall_arg's return type
authorNathan Chancellor <natechancellor@gmail.com>
Mon, 12 Aug 2019 03:31:17 +0000 (20:31 -0700)
committerPaul Burton <paul.burton@mips.com>
Mon, 12 Aug 2019 04:44:30 +0000 (21:44 -0700)
commit2c4d5a4c3a26f45ea544f0e56c4b3b89efb8faa7
treedf6b697f8b914c2d0fea2ef567aa693db00557a8
parent222126c43037db088465879b80648a1baa969b6c
MIPS/ptrace: Update mips_get_syscall_arg's return type

clang warns:

arch/mips/include/asm/syscall.h:136:3: error: variable 'ret' is
uninitialized when used here [-Werror,-Wuninitialized]
                ret |= mips_get_syscall_arg(args++, task, regs, i++);
                ^~~
arch/mips/include/asm/syscall.h:129:9: note: initialize the variable
'ret' to silence this warning
        int ret;
               ^
                = 0
1 error generated.

It's not wrong; however, it's not an issue in practice because ret is
only assigned to, not read from. ret could just be initialized to zero
but looking into it further, ret has been unused since it was first
added in 2012 so just get rid of it and update mips_get_syscall_arg's
return type since none of the return values are ever checked. If it is
ever needed again, this commit can be reverted and ret can be properly
initialized.

Fixes: a4a41fe11089 ("MIPS: Enable HAVE_ARCH_TRACEHOOK.")
Link: https://github.com/ClangBuiltLinux/linux/issues/604
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: clang-built-linux@googlegroups.com
arch/mips/include/asm/syscall.h