Re: [PATCH 2/5] MIPS/ptrace: Update mips_get_syscall_arg's return type

From: Paul Burton
Date: Mon Aug 12 2019 - 00:47:25 EST


Hello,

Nathan Chancellor wrote:
> 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.

Applied to mips-next.

> commit 077ff3be06e8
> https://git.kernel.org/mips/c/077ff3be06e8
>
> Fixes: c0ff3c53d4f9 ("MIPS: Enable HAVE_ARCH_TRACEHOOK.")
> Link: https://github.com/ClangBuiltLinux/linux/issues/604
> Signed-off-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
> Signed-off-by: Paul Burton <paul.burton@xxxxxxxx>

Thanks,
Paul

[ This message was auto-generated; if you believe anything is incorrect
then please email paul.burton@xxxxxxxx to report it. ]