diff options
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
-rw-r--r-- | arch/powerpc/lib/code-patching.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index 17e5b236431..7c975d43e3f 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c | |||
@@ -13,23 +13,17 @@ | |||
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | #include <asm/page.h> | 14 | #include <asm/page.h> |
15 | #include <asm/code-patching.h> | 15 | #include <asm/code-patching.h> |
16 | #include <asm/uaccess.h> | ||
17 | 16 | ||
18 | 17 | ||
19 | int patch_instruction(unsigned int *addr, unsigned int instr) | 18 | void patch_instruction(unsigned int *addr, unsigned int instr) |
20 | { | 19 | { |
21 | int err; | 20 | *addr = instr; |
22 | |||
23 | __put_user_size(instr, addr, 4, err); | ||
24 | if (err) | ||
25 | return err; | ||
26 | asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); | 21 | asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); |
27 | return 0; | ||
28 | } | 22 | } |
29 | 23 | ||
30 | int patch_branch(unsigned int *addr, unsigned long target, int flags) | 24 | void patch_branch(unsigned int *addr, unsigned long target, int flags) |
31 | { | 25 | { |
32 | return patch_instruction(addr, create_branch(addr, target, flags)); | 26 | patch_instruction(addr, create_branch(addr, target, flags)); |
33 | } | 27 | } |
34 | 28 | ||
35 | unsigned int create_branch(const unsigned int *addr, | 29 | unsigned int create_branch(const unsigned int *addr, |