diff mbox series

[3/5] Nokia RX-51: Simplify copy kernel code

Message ID 20220811202725.24752-3-pali@kernel.org
State Accepted
Commit 04bd87c24c31bbd8f27f6d1f7484c9a17f622c9a
Delegated to: Tom Rini
Headers show
Series [1/5] Nokia RX-51: Fix invalidating zImage kernel format | expand

Commit Message

Pali Rohár Aug. 11, 2022, 8:27 p.m. UTC
Expression (r + (r0 - r1)) produce same result as (r - (r1 - r0)). So it
does not matter which one is called. Always call the first option and
remove second one.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 board/nokia/rx51/lowlevel_init.S | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Tom Rini Aug. 20, 2022, 11:01 p.m. UTC | #1
On Thu, Aug 11, 2022 at 10:27:23PM +0200, Pali Rohár wrote:

> Expression (r + (r0 - r1)) produce same result as (r - (r1 - r0)). So it
> does not matter which one is called. Always call the first option and
> remove second one.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/board/nokia/rx51/lowlevel_init.S b/board/nokia/rx51/lowlevel_init.S
index dd3c830cc2e2..4f76e80b20f1 100644
--- a/board/nokia/rx51/lowlevel_init.S
+++ b/board/nokia/rx51/lowlevel_init.S
@@ -55,16 +55,13 @@  save_boot_params:
 copy_kernel_start:
 	adr	r0, relocaddr	/* r0 - address of section relocaddr */
 	ldr	r1, relocaddr	/* r1 - address of relocaddr after relocation */
-	cmp	r0, r1
 
 	/* r4 - calculated offset */
-	subhi	r4, r0, r1
-	sublo	r4, r1, r0
+	sub	r4, r0, r1
 
 	/* r0 - start of kernel before */
 	ldr	r0, startaddr
-	addhi	r0, r0, r4
-	sublo	r0, r0, r4
+	add	r0, r0, r4
 	ldr	r1, kernoffs
 	add	r0, r0, r1