public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] openrisc: Refactor 16-bit constant relocation
@ 2013-10-25 14:37 Geert Uytterhoeven
  2013-11-05 15:18 ` Jonas Bonn
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2013-10-25 14:37 UTC (permalink / raw)
  To: Jonas Bonn; +Cc: linux, linux-kernel, Geert Uytterhoeven

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>
---
Assembler output is identical before and after patch

 arch/openrisc/kernel/module.c |    6 ++----
 1 file 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,
 			*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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] openrisc: Refactor 16-bit constant relocation
  2013-10-25 14:37 [PATCH] openrisc: Refactor 16-bit constant relocation Geert Uytterhoeven
@ 2013-11-05 15:18 ` Jonas Bonn
  0 siblings, 0 replies; 2+ messages in thread
From: Jonas Bonn @ 2013-11-05 15:18 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux, linux-kernel

On 10/25/2013 04:37 PM, Geert Uytterhoeven wrote:
> 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>

Thanks, Geert.  Will apply.

/Jonas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-05 15:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-25 14:37 [PATCH] openrisc: Refactor 16-bit constant relocation Geert Uytterhoeven
2013-11-05 15:18 ` Jonas Bonn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox