Skip to content

Commit

Permalink
powerpc/process: Fix sparse address space warnings
Browse files Browse the repository at this point in the history
This patch fixes the following warnings, which are leftovers
from when __get_user() was replaced by probe_kernel_address().

arch/powerpc/kernel/process.c:1287:22: warning: incorrect type in argument 2 (different address spaces)
arch/powerpc/kernel/process.c:1287:22:    expected void const *src
arch/powerpc/kernel/process.c:1287:22:    got unsigned int [noderef] <asn:1>*<noident>
arch/powerpc/kernel/process.c:1319:21: warning: incorrect type in argument 2 (different address spaces)
arch/powerpc/kernel/process.c:1319:21:    expected void const *src
arch/powerpc/kernel/process.c:1319:21:    got unsigned int [noderef] <asn:1>*<noident>

Fixes: 7b051f6 ("powerpc: Use probe_kernel_address in show_instructions")
Reviewed-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Split out of larger patch]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Christophe Leroy authored and Michael Ellerman committed Oct 13, 2018
1 parent 7241d26 commit 3b35bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ static void show_instructions(struct pt_regs *regs)
#endif

if (!__kernel_text_address(pc) ||
probe_kernel_address((unsigned int __user *)pc, instr)) {
probe_kernel_address((const void *)pc, instr)) {
pr_cont("XXXXXXXX ");
} else {
if (regs->nip == pc)
Expand Down Expand Up @@ -1323,7 +1323,7 @@ void show_user_instructions(struct pt_regs *regs)
pr_info("%s[%d]: code: ", current->comm, current->pid);
}

if (probe_kernel_address((unsigned int __user *)pc, instr)) {
if (probe_kernel_address((const void *)pc, instr)) {
pr_cont("XXXXXXXX ");
} else {
if (regs->nip == pc)
Expand Down

0 comments on commit 3b35bd4

Please sign in to comment.