[PATCH] powerpc: fsl_pci: cast the regs->nip to void * when passing it to probe_kernel_address()

Kevin Hao haokexin at gmail.com
Mon Sep 21 19:22:50 AEST 2015


With the reimplementation of probe_kernel_address() in commit
ecc83243e1d4 ("uaccess: reimplement probe_kernel_address() using
probe_kernel_read()"), the explication of the cast for the addr
parameter has been dropped. So we have to explicitly cast the
regs->nip to void * when passing it to probe_kernel_address() in
order to fix the following build error:
  arch/powerpc/sysdev/fsl_pci.c: In function 'fsl_pci_mcheck_exception':
  arch/powerpc/sysdev/fsl_pci.c:1002:4: error: passing argument 2 of 'probe_kernel_read' makes pointer from integer without a cast [-Werror]
      ret = probe_kernel_address(regs->nip, inst);
      ^

Signed-off-by: Kevin Hao <haokexin at gmail.com>
---

This is against linux-next.

 arch/powerpc/sysdev/fsl_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index ebc1f412cf49..13b9bcf5485e 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -999,7 +999,7 @@ int fsl_pci_mcheck_exception(struct pt_regs *regs)
 			ret = get_user(regs->nip, &inst);
 			pagefault_enable();
 		} else {
-			ret = probe_kernel_address(regs->nip, inst);
+			ret = probe_kernel_address((void *)regs->nip, inst);
 		}
 
 		if (mcheck_handle_load(regs, inst)) {
-- 
2.4.3



More information about the Linuxppc-dev mailing list