From: Sven Schnelle <svens@stackframe.org>
To: kexec@lists.infradead.org
Cc: Christophe Leroy <christophe.leroy@c-s.fr>,
Sven Schnelle <svens@stackframe.org>,
Helge Deller <deller@gmx.de>,
linuxppc-dev@lists.ozlabs.org,
Thiago Jung Bauermann <bauerman@linux.ibm.com>
Subject: [PATCH v5 6/7] kexec_elf: remove unused variable in kexec_elf_load()
Date: Fri, 23 Aug 2019 21:49:18 +0200 [thread overview]
Message-ID: <20190823194919.30916-7-svens@stackframe.org> (raw)
In-Reply-To: <20190823194919.30916-1-svens@stackframe.org>
base was never assigned, so we can remove it.
Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
kernel/kexec_elf.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/kexec_elf.c b/kernel/kexec_elf.c
index 6c806ce96ac1..85f2bd177d6e 100644
--- a/kernel/kexec_elf.c
+++ b/kernel/kexec_elf.c
@@ -363,7 +363,7 @@ int kexec_elf_load(struct kimage *image, struct elfhdr *ehdr,
struct kexec_buf *kbuf,
unsigned long *lowest_load_addr)
{
- unsigned long base = 0, lowest_addr = UINT_MAX;
+ unsigned long lowest_addr = UINT_MAX;
int ret;
size_t i;
@@ -385,7 +385,7 @@ int kexec_elf_load(struct kimage *image, struct elfhdr *ehdr,
kbuf->bufsz = size;
kbuf->memsz = phdr->p_memsz;
kbuf->buf_align = phdr->p_align;
- kbuf->buf_min = phdr->p_paddr + base;
+ kbuf->buf_min = phdr->p_paddr;
kbuf->mem = KEXEC_BUF_MEM_UNKNOWN;
ret = kexec_add_buffer(kbuf);
if (ret)
@@ -396,9 +396,6 @@ int kexec_elf_load(struct kimage *image, struct elfhdr *ehdr,
lowest_addr = load_addr;
}
- /* Update entry point to reflect new load address. */
- ehdr->e_entry += base;
-
*lowest_load_addr = lowest_addr;
ret = 0;
out:
--
2.23.0.rc1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Sven Schnelle <svens@stackframe.org>
To: kexec@lists.infradead.org
Cc: Sven Schnelle <svens@stackframe.org>,
Helge Deller <deller@gmx.de>,
linuxppc-dev@lists.ozlabs.org,
Thiago Jung Bauermann <bauerman@linux.ibm.com>
Subject: [PATCH v5 6/7] kexec_elf: remove unused variable in kexec_elf_load()
Date: Fri, 23 Aug 2019 21:49:18 +0200 [thread overview]
Message-ID: <20190823194919.30916-7-svens@stackframe.org> (raw)
In-Reply-To: <20190823194919.30916-1-svens@stackframe.org>
base was never assigned, so we can remove it.
Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
kernel/kexec_elf.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/kexec_elf.c b/kernel/kexec_elf.c
index 6c806ce96ac1..85f2bd177d6e 100644
--- a/kernel/kexec_elf.c
+++ b/kernel/kexec_elf.c
@@ -363,7 +363,7 @@ int kexec_elf_load(struct kimage *image, struct elfhdr *ehdr,
struct kexec_buf *kbuf,
unsigned long *lowest_load_addr)
{
- unsigned long base = 0, lowest_addr = UINT_MAX;
+ unsigned long lowest_addr = UINT_MAX;
int ret;
size_t i;
@@ -385,7 +385,7 @@ int kexec_elf_load(struct kimage *image, struct elfhdr *ehdr,
kbuf->bufsz = size;
kbuf->memsz = phdr->p_memsz;
kbuf->buf_align = phdr->p_align;
- kbuf->buf_min = phdr->p_paddr + base;
+ kbuf->buf_min = phdr->p_paddr;
kbuf->mem = KEXEC_BUF_MEM_UNKNOWN;
ret = kexec_add_buffer(kbuf);
if (ret)
@@ -396,9 +396,6 @@ int kexec_elf_load(struct kimage *image, struct elfhdr *ehdr,
lowest_addr = load_addr;
}
- /* Update entry point to reflect new load address. */
- ehdr->e_entry += base;
-
*lowest_load_addr = lowest_addr;
ret = 0;
out:
--
2.23.0.rc1
next prev parent reply other threads:[~2019-08-23 19:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-23 19:49 [PATCH v5 0/7] kexec: add generic support for elf kernel images Sven Schnelle
2019-08-23 19:49 ` Sven Schnelle
2019-08-23 19:49 ` [PATCH v5 1/7] kexec: add KEXEC_ELF Sven Schnelle
2019-08-23 19:49 ` Sven Schnelle
2019-08-23 19:49 ` [PATCH v5 2/7] kexec_elf: change order of elf_*_to_cpu() functions Sven Schnelle
2019-08-23 19:49 ` Sven Schnelle
2019-08-23 19:49 ` [PATCH v5 3/7] kexec_elf: remove parsing of section headers Sven Schnelle
2019-08-23 19:49 ` Sven Schnelle
2019-08-23 19:49 ` [PATCH v5 4/7] kexec_elf: remove PURGATORY_STACK_SIZE Sven Schnelle
2019-08-23 19:49 ` Sven Schnelle
2019-08-23 19:49 ` [PATCH v5 5/7] kexec_elf: remove Elf_Rel macro Sven Schnelle
2019-08-23 19:49 ` Sven Schnelle
2019-08-23 19:49 ` Sven Schnelle [this message]
2019-08-23 19:49 ` [PATCH v5 6/7] kexec_elf: remove unused variable in kexec_elf_load() Sven Schnelle
2019-08-23 19:49 ` [PATCH v5 7/7] kexec_elf: support 32 bit ELF files Sven Schnelle
2019-08-23 19:49 ` Sven Schnelle
2019-09-06 15:53 ` [PATCH v5 0/7] kexec: add generic support for elf kernel images Helge Deller
2019-09-06 15:53 ` Helge Deller
2019-09-06 21:47 ` Thiago Jung Bauermann
2019-09-06 21:47 ` Thiago Jung Bauermann
2019-09-06 22:01 ` Helge Deller
2019-09-06 22:01 ` Helge Deller
2019-09-07 1:34 ` Thiago Jung Bauermann
2019-09-07 1:34 ` Thiago Jung Bauermann
2019-09-09 8:20 ` Michael Ellerman
2019-09-09 8:20 ` Michael Ellerman
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=20190823194919.30916-7-svens@stackframe.org \
--to=svens@stackframe.org \
--cc=bauerman@linux.ibm.com \
--cc=christophe.leroy@c-s.fr \
--cc=deller@gmx.de \
--cc=kexec@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.