From: "Pali Rohár" <pali@kernel.org>
To: u-boot@lists.denx.de
Subject: [PATCH 3/5] Nokia RX-51: Simplify copy kernel code
Date: Thu, 11 Aug 2022 22:27:23 +0200 [thread overview]
Message-ID: <20220811202725.24752-3-pali@kernel.org> (raw)
In-Reply-To: <20220811202725.24752-1-pali@kernel.org>
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(-)
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
--
2.20.1
next prev parent reply other threads:[~2022-08-11 20:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 20:27 [PATCH 1/5] Nokia RX-51: Fix invalidating zImage kernel format Pali Rohár
2022-08-11 20:27 ` [PATCH 2/5] Nokia RX-51: Use U-Boot generic position independent code Pali Rohár
2022-08-20 23:01 ` Tom Rini
2022-08-11 20:27 ` Pali Rohár [this message]
2022-08-20 23:01 ` [PATCH 3/5] Nokia RX-51: Simplify copy kernel code Tom Rini
2022-08-11 20:27 ` [PATCH 4/5] Nokia RX-51: Simplify calculation of attached kernel image address Pali Rohár
2022-08-20 23:01 ` Tom Rini
2022-08-11 20:27 ` [PATCH 5/5] Nokia RX-51: Move board required options from defconfig to Kconfig Pali Rohár
2022-08-20 23:01 ` Tom Rini
2022-08-20 23:01 ` [PATCH 1/5] Nokia RX-51: Fix invalidating zImage kernel format Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220811202725.24752-3-pali@kernel.org \
--to=pali@kernel.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox