From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D09EBC74A21 for ; Wed, 10 Jul 2019 14:43:32 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 100D320651 for ; Wed, 10 Jul 2019 14:43:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=duncanthrax.net header.i=@duncanthrax.net header.b="g3KFFk7/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 100D320651 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=stackframe.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45kMPY5SbSzDqLT for ; Thu, 11 Jul 2019 00:43:29 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=stackframe.org (client-ip=2001:470:70c5:1111::170; helo=smtp.duncanthrax.net; envelope-from=svens@stackframe.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=stackframe.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=duncanthrax.net header.i=@duncanthrax.net header.b="g3KFFk7/"; dkim-atps=neutral Received: from smtp.duncanthrax.net (smtp.duncanthrax.net [IPv6:2001:470:70c5:1111::170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45kM6L0rlXzDqJV for ; Thu, 11 Jul 2019 00:30:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=41hNx7RJF3M/NVaosyif8t4ddhlZec6gxVrDuKDyR9E=; b=g3KFFk7/4Ly48Hiu9KlSjq+2/V yR9iPrXXUi5c/HfDTO1IbPKsXls8XtBRFjcShorqoELXRa22SU7KGD0cta7UB45GX+6rY+AUgeI2c Crt8HOLG5WZg4qi1b0+hjNxXh/G/VITFWwpU1Hht8dp5+Gu+ios25tGUBIB3ULsmfT2Y=; Received: from [134.3.44.134] (helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1hlDbp-0004hm-VU; Wed, 10 Jul 2019 16:30:14 +0200 From: Sven Schnelle To: kexec@lists.infradead.org Subject: [PATCH v3 2/7] kexec_elf: change order of elf_*_to_cpu() functions Date: Wed, 10 Jul 2019 16:29:39 +0200 Message-Id: <20190710142944.2774-3-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190710142944.2774-1-svens@stackframe.org> References: <20190710142944.2774-1-svens@stackframe.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , deller@gmx.de, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Change the order to have a 64/32/16 order, no functional change. Signed-off-by: Sven Schnelle --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hlDbr-0007td-QV for kexec@lists.infradead.org; Wed, 10 Jul 2019 14:30:19 +0000 From: Sven Schnelle Subject: [PATCH v3 2/7] kexec_elf: change order of elf_*_to_cpu() functions Date: Wed, 10 Jul 2019 16:29:39 +0200 Message-Id: <20190710142944.2774-3-svens@stackframe.org> In-Reply-To: <20190710142944.2774-1-svens@stackframe.org> References: <20190710142944.2774-1-svens@stackframe.org> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: kexec@lists.infradead.org Cc: Sven Schnelle , deller@gmx.de, linuxppc-dev@lists.ozlabs.org Change the order to have a 64/32/16 order, no functional change. Signed-off-by: Sven Schnelle --- 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