Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geert Uytterhoeven and committed by
Jonas Bonn
56aea88d f69405ce

+2 -4
+2 -4
arch/openrisc/kernel/module.c
··· 47 47 *location = value; 48 48 break; 49 49 case R_OR32_CONST: 50 - location = (uint16_t *)location + 1; 51 - *((uint16_t *)location) = (uint16_t) (value); 50 + *((uint16_t *)location + 1) = value; 52 51 break; 53 52 case R_OR32_CONSTH: 54 - location = (uint16_t *)location + 1; 55 - *((uint16_t *)location) = (uint16_t) (value >> 16); 53 + *((uint16_t *)location + 1) = value >> 16; 56 54 break; 57 55 case R_OR32_JUMPTARG: 58 56 value -= (uint32_t)location;