From: Sven Schnelle <svens@stackframe.org> To: kexec@lists.infradead.org Cc: Sven Schnelle <svens@stackframe.org>, deller@gmx.de, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 2/7] kexec_elf: change order of elf_*_to_cpu() functions Date: Tue, 9 Jul 2019 21:43:23 +0200 [thread overview] Message-ID: <20190709194328.16991-3-svens@stackframe.org> (raw) In-Reply-To: <20190709194328.16991-1-svens@stackframe.org> Change the order to have a 64/32/16 order, no functional change. Signed-off-by: Sven Schnelle <svens@stackframe.org> --- kernel/kexec_elf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/kexec_elf.c b/kernel/kexec_elf.c index 6e9f52171ede..76e7df64d715 100644 --- a/kernel/kexec_elf.c +++ b/kernel/kexec_elf.c @@ -31,22 +31,22 @@ static uint64_t elf64_to_cpu(const struct elfhdr *ehdr, uint64_t value) return value; } -static uint16_t elf16_to_cpu(const struct elfhdr *ehdr, uint16_t value) +static uint32_t elf32_to_cpu(const struct elfhdr *ehdr, uint32_t value) { if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) - value = le16_to_cpu(value); + value = le32_to_cpu(value); else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) - value = be16_to_cpu(value); + value = be32_to_cpu(value); return value; } -static uint32_t elf32_to_cpu(const struct elfhdr *ehdr, uint32_t value) +static uint16_t elf16_to_cpu(const struct elfhdr *ehdr, uint16_t value) { if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) - value = le32_to_cpu(value); + value = le16_to_cpu(value); else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) - value = be32_to_cpu(value); + value = be16_to_cpu(value); return value; } -- 2.20.1
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>, deller@gmx.de, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 2/7] kexec_elf: change order of elf_*_to_cpu() functions Date: Tue, 9 Jul 2019 21:43:23 +0200 [thread overview] Message-ID: <20190709194328.16991-3-svens@stackframe.org> (raw) In-Reply-To: <20190709194328.16991-1-svens@stackframe.org> Change the order to have a 64/32/16 order, no functional change. Signed-off-by: Sven Schnelle <svens@stackframe.org> --- kernel/kexec_elf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/kexec_elf.c b/kernel/kexec_elf.c index 6e9f52171ede..76e7df64d715 100644 --- a/kernel/kexec_elf.c +++ b/kernel/kexec_elf.c @@ -31,22 +31,22 @@ static uint64_t elf64_to_cpu(const struct elfhdr *ehdr, uint64_t value) return value; } -static uint16_t elf16_to_cpu(const struct elfhdr *ehdr, uint16_t value) +static uint32_t elf32_to_cpu(const struct elfhdr *ehdr, uint32_t value) { if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) - value = le16_to_cpu(value); + value = le32_to_cpu(value); else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) - value = be16_to_cpu(value); + value = be32_to_cpu(value); return value; } -static uint32_t elf32_to_cpu(const struct elfhdr *ehdr, uint32_t value) +static uint16_t elf16_to_cpu(const struct elfhdr *ehdr, uint16_t value) { if (ehdr->e_ident[EI_DATA] == ELFDATA2LSB) - value = le32_to_cpu(value); + value = le16_to_cpu(value); else if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) - value = be32_to_cpu(value); + value = be16_to_cpu(value); return value; } -- 2.20.1 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2019-07-09 19:54 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-07-09 19:43 [PATCH v2 0/7] kexec: add generic support for elf kernel images Sven Schnelle 2019-07-09 19:43 ` Sven Schnelle 2019-07-09 19:43 ` [PATCH v2 1/7] kexec: add KEXEC_ELF Sven Schnelle 2019-07-09 19:43 ` Sven Schnelle 2019-07-10 13:19 ` Christophe Leroy 2019-07-10 13:19 ` Christophe Leroy 2019-07-10 14:24 ` Sven Schnelle 2019-07-10 14:24 ` Sven Schnelle 2019-07-09 19:43 ` Sven Schnelle [this message] 2019-07-09 19:43 ` [PATCH v2 2/7] kexec_elf: change order of elf_*_to_cpu() functions Sven Schnelle 2019-07-09 19:43 ` [PATCH v2 3/7] kexec_elf: remove parsing of section headers Sven Schnelle 2019-07-09 19:43 ` Sven Schnelle 2019-07-09 19:43 ` [PATCH v2 4/7] kexec_elf: remove PURGATORY_STACK_SIZE Sven Schnelle 2019-07-09 19:43 ` Sven Schnelle 2019-07-09 19:43 ` [PATCH v2 5/7] kexec_elf: remove elf_addr_to_cpu macro Sven Schnelle 2019-07-09 19:43 ` Sven Schnelle 2019-07-09 19:43 ` [PATCH v2 6/7] kexec_elf: remove Elf_Rel macro Sven Schnelle 2019-07-09 19:43 ` Sven Schnelle 2019-07-09 19:43 ` [PATCH v2 7/7] kexec_elf: remove unused variable in kexec_elf_load() Sven Schnelle 2019-07-09 19:43 ` Sven Schnelle
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=20190709194328.16991-3-svens@stackframe.org \ --to=svens@stackframe.org \ --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: linkBe 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.