diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-10-25 10:37:56 -0400 |
---|---|---|
committer | Jonas Bonn <jonas@southpole.se> | 2013-11-05 10:27:55 -0500 |
commit | 56aea88df7b3930b3010488bdf9d1796bb051fb1 (patch) | |
tree | 912a80846e7751141857151c5a2b0f85f7f17636 /arch/openrisc | |
parent | f69405ce6c0fc9f4a039011007371b31f80b470d (diff) |
openrisc: Refactor 16-bit constant relocation
arch/openrisc/kernel/module.c: In function 'apply_relocate_add':
arch/openrisc/kernel/module.c:50:13: warning: assignment from incompatible pointer type
arch/openrisc/kernel/module.c:54:13: warning: assignment from incompatible pointer type
Move the pointer increments to the dereference statements to avoid
incompatible pointer assignments, and remove superfluous casts.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Diffstat (limited to 'arch/openrisc')
-rw-r--r-- | arch/openrisc/kernel/module.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/openrisc/kernel/module.c b/arch/openrisc/kernel/module.c index 10ff50f0202a..ef872ae4c878 100644 --- a/arch/openrisc/kernel/module.c +++ b/arch/openrisc/kernel/module.c | |||
@@ -47,12 +47,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, | |||
47 | *location = value; | 47 | *location = value; |
48 | break; | 48 | break; |
49 | case R_OR32_CONST: | 49 | case R_OR32_CONST: |
50 | location = (uint16_t *)location + 1; | 50 | *((uint16_t *)location + 1) = value; |
51 | *((uint16_t *)location) = (uint16_t) (value); | ||
52 | break; | 51 | break; |
53 | case R_OR32_CONSTH: | 52 | case R_OR32_CONSTH: |
54 | location = (uint16_t *)location + 1; | 53 | *((uint16_t *)location + 1) = value >> 16; |
55 | *((uint16_t *)location) = (uint16_t) (value >> 16); | ||
56 | break; | 54 | break; |
57 | case R_OR32_JUMPTARG: | 55 | case R_OR32_JUMPTARG: |
58 | value -= (uint32_t)location; | 56 | value -= (uint32_t)location; |