powerpc/ptrace: Fix cppcheck issue in gpr32_set_common/gpr32_get_common()
authorSimon Guo <wei.guo.simon@gmail.com>
Sun, 11 Sep 2016 13:44:13 +0000 (21:44 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 13 Sep 2016 07:37:12 +0000 (17:37 +1000)
commit261831160d4df6bafe2f0e12e6de9e5731519e06
tree4485551e56625c713141fb51fffdc9487e3fa08a
parentb135077b83f01549c2a0685b16b540254ce60e0f
powerpc/ptrace: Fix cppcheck issue in gpr32_set_common/gpr32_get_common()

The ckpt_regs usage in gpr32_set_common/gpr32_get_common() will lead to
following cppcheck error at ifndef CONFIG_PPC_TRANSACTIONAL_MEM case:

[arch/powerpc/kernel/ptrace.c:2062]:
(error) Uninitialized variable: ckpt_regs
[arch/powerpc/kernel/ptrace.c:2130]:
(error) Uninitialized variable: ckpt_regs

The problem is due to gpr32_set_common() used ckpt_regs variable which
only makes sense at #ifdef CONFIG_PPC_TRANSACTIONAL_MEM.

This patch fix this issue by passing in "regs" parameter instead.

Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Simon Guo <wei.guo.simon@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/ptrace.c