powerpc/32: use patch_site_addr() in machine_init()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 9 Nov 2018 17:33:20 +0000 (17:33 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 19 Dec 2018 07:56:32 +0000 (18:56 +1100)
Use patch_site_addr() instead of hardcoding the
address calculation in machine_init()

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/setup_32.c

index 972c98d1e20808cd90e56b5940e559186fb6cc00..be6ee8dec98d05dc11bc87ad84a50eed8aefbacb 100644 (file)
@@ -101,8 +101,7 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
  */
 notrace void __init machine_init(u64 dt_ptr)
 {
-       unsigned int *addr = (unsigned int *)((unsigned long)&patch__memset_nocache +
-                                              patch__memset_nocache);
+       unsigned int *addr = (unsigned int *)patch_site_addr(&patch__memset_nocache);
        unsigned long insn;
 
        /* Configure static keys first, now that we're relocated. */