diff options
| author | 2012-07-25 14:33:45 +0200 | |
|---|---|---|
| committer | 2012-07-25 14:35:04 +0200 | |
| commit | 8cef081c71dd4e16a01a1e63cedab21eef8b5735 (patch) | |
| tree | b5b0fb5ab09dc60dee5fc8fd8e980359abbd1b1e /arch/powerpc/lib/code-patching.c | |
| parent | ARM: tegra: harmony: add regulator supply name and its input supply (diff) | |
| parent | Merge tag 'clk-for-linus' of git://git.linaro.org/people/mturquette/linux (diff) | |
| download | wireguard-linux-8cef081c71dd4e16a01a1e63cedab21eef8b5735.tar.xz wireguard-linux-8cef081c71dd4e16a01a1e63cedab21eef8b5735.zip | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fixes
The merge of the 'clk-for-linus' branch caused an automated
merge failure. Pull that in here so we can fix the problem.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to '')
| -rw-r--r-- | arch/powerpc/lib/code-patching.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index 7c975d43e3f3..dd223b3eb333 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c @@ -13,17 +13,23 @@ #include <linux/mm.h> #include <asm/page.h> #include <asm/code-patching.h> +#include <asm/uaccess.h> -void patch_instruction(unsigned int *addr, unsigned int instr) +int patch_instruction(unsigned int *addr, unsigned int instr) { - *addr = instr; + int err; + + err = __put_user(instr, addr); + if (err) + return err; asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); + return 0; } -void patch_branch(unsigned int *addr, unsigned long target, int flags) +int patch_branch(unsigned int *addr, unsigned long target, int flags) { - patch_instruction(addr, create_branch(addr, target, flags)); + return patch_instruction(addr, create_branch(addr, target, flags)); } unsigned int create_branch(const unsigned int *addr, |
