Skip to content

Commit

Permalink
openrisc: Refactor 16-bit constant relocation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
geertu authored and Jonas Bonn committed Nov 5, 2013
1 parent f69405c commit 56aea88
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/openrisc/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
*location = value;
break;
case R_OR32_CONST:
location = (uint16_t *)location + 1;
*((uint16_t *)location) = (uint16_t) (value);
*((uint16_t *)location + 1) = value;
break;
case R_OR32_CONSTH:
location = (uint16_t *)location + 1;
*((uint16_t *)location) = (uint16_t) (value >> 16);
*((uint16_t *)location + 1) = value >> 16;
break;
case R_OR32_JUMPTARG:
value -= (uint32_t)location;
Expand Down

0 comments on commit 56aea88

Please sign in to comment.