Skip to content

Commit

Permalink
kexec_elf: change order of elf_*_to_cpu() functions
Browse files Browse the repository at this point in the history
Change the order to have a 64/32/16 order, no functional change.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
svenschnelle authored and hdeller committed Sep 6, 2019
1 parent 175fca3 commit d34e0ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kernel/kexec_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,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;
}
Expand Down

0 comments on commit d34e0ad

Please sign in to comment.