forked from pool/kexec-tools
080f64dafa
- Update to version 2.0.14 (bsc#1039937, FATE#320672, FATE#320671) Changelog: http://git.kernel.org/cgit/utils/kernel/kexec/kexec-tools.git/log/?id=refs/tags/v2.0.13..v2.0.14 - Backport upstream fixes (bsc#1039937, FATE#320672, FATE#320671) 0001-kexec-tools-2.0.14.git.patch 0002-ppc64-Reduce-number-of-ELF-LOAD-segments.patch 0003-kexec-Increase-the-upper-limit-for-RAM-segments.patch 0004-alpha-add-missing-__NR_kexec_load-definition.patch 0005-kexec-implemented-XEN-KEXEC-STATUS-to-determine-if-a.patch 0006-kexec-Remove-redundant-space-from-help-message.patch 0007-purgatory-Add-purgatory.map-and-purgatory.ro.sym-to-.patch 0008-kexec-Add-option-to-get-crash-kernel-region-size.patch 0009-crashdump-arm-Add-get_crash_kernel_load_range-functi.patch 0010-crashdump-arm64-Add-get_crash_kernel_load_range-func.patch 0011-crashdump-cris-Add-get_crash_kernel_load_range-funct.patch 0012-crashdump-ia64-Add-get_crash_kernel_load_range-funct.patch 0013-crashdump-m68k-Add-get_crash_kernel_load_range-funct.patch 0014-crashdump-mips-Add-get_crash_kernel_load_range-funct.patch 0015-crashdump-ppc-Add-get_crash_kernel_load_range-functi.patch 0016-crashdump-ppc64-Add-get_crash_kernel_load_range-func.patch 0017-crashdump-s390-Add-get_crash_kernel_load_range-funct.patch 0018-crashdump-sh-Add-get_crash_kernel_load_range-functio.patch 0019-gitignore-add-two-generated-files-in-purgatory.patch 0020-Only-print-debug-message-when-failed-to-serach-for-k.patch 0021-build_mem_phdrs-check-if-p_paddr-is-invalid.patch 0022-uImage-fix-realloc-pointer-confusion.patch 0023-uImage-Fix-uImage_load-for-little-endian-machines.patch 0024-uImage-Add-new-IH_ARCH_xxx-definitions.patch 0025-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch 0026-uImage-use-char-instead-of-unsigned-char-for-uImage_.patch 0027-arm64-add-uImage-support.patch OBS-URL: https://build.opensuse.org/request/show/500203 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kexec-tools?expand=0&rev=83
183 lines
5.3 KiB
Diff
183 lines
5.3 KiB
Diff
From a17234fe94bce780ac36a0ba9bfc9b6e8ffd84f0 Mon Sep 17 00:00:00 2001
|
|
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
|
|
Date: Wed, 17 May 2017 14:51:44 +0900
|
|
Subject: [PATCH 38/45] arm64: change return values on error to negative
|
|
|
|
EFAILED is defined "-1" and so we don't need to negate it as a return value.
|
|
|
|
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
|
|
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
|
|
Tested-by: Pratyush Anand <panand@redhat.com>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
---
|
|
kexec/arch/arm64/kexec-arm64.c | 24 ++++++++++++------------
|
|
kexec/arch/arm64/kexec-elf-arm64.c | 6 +++---
|
|
kexec/arch/arm64/kexec-image-arm64.c | 4 ++--
|
|
3 files changed, 17 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
|
|
index 7024f749f3f6..153c96f73b3d 100644
|
|
--- a/kexec/arch/arm64/kexec-arm64.c
|
|
+++ b/kexec/arch/arm64/kexec-arm64.c
|
|
@@ -79,7 +79,7 @@ int arm64_process_image_header(const struct arm64_image_header *h)
|
|
#endif
|
|
|
|
if (!arm64_header_check_magic(h))
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
|
|
if (h->image_size) {
|
|
arm64_mem.text_offset = arm64_header_text_offset(h);
|
|
@@ -202,7 +202,7 @@ static int set_bootargs(struct dtb *dtb, const char *command_line)
|
|
if (result) {
|
|
fprintf(stderr,
|
|
"kexec: Set device tree bootargs failed.\n");
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
|
|
return 0;
|
|
@@ -222,7 +222,7 @@ static int read_proc_dtb(struct dtb *dtb)
|
|
|
|
if (result) {
|
|
dbgprintf("%s: %s\n", __func__, strerror(errno));
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
|
|
dtb->path = path;
|
|
@@ -245,7 +245,7 @@ static int read_sys_dtb(struct dtb *dtb)
|
|
|
|
if (result) {
|
|
dbgprintf("%s: %s\n", __func__, strerror(errno));
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
|
|
dtb->path = path;
|
|
@@ -275,7 +275,7 @@ static int read_1st_dtb(struct dtb *dtb)
|
|
goto on_success;
|
|
|
|
dbgprintf("%s: not found\n", __func__);
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
|
|
on_success:
|
|
dbgprintf("%s: found %s\n", __func__, dtb->path);
|
|
@@ -294,7 +294,7 @@ static int setup_2nd_dtb(struct dtb *dtb, char *command_line)
|
|
|
|
if (result) {
|
|
fprintf(stderr, "kexec: Invalid 2nd device tree.\n");
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
|
|
result = set_bootargs(dtb, command_line);
|
|
@@ -349,14 +349,14 @@ int arm64_load_other_segments(struct kexec_info *info,
|
|
if (result) {
|
|
fprintf(stderr,
|
|
"kexec: Error: No device tree available.\n");
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
}
|
|
|
|
result = setup_2nd_dtb(&dtb, command_line);
|
|
|
|
if (result)
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
|
|
/* Put the other segments after the image. */
|
|
|
|
@@ -384,7 +384,7 @@ int arm64_load_other_segments(struct kexec_info *info,
|
|
|
|
if (_ALIGN_UP(initrd_end, GiB(1)) - _ALIGN_DOWN(image_base, GiB(1)) > GiB(32)) {
|
|
fprintf(stderr, "kexec: Error: image + initrd too big.\n");
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
|
|
dbgprintf("initrd: base %lx, size %lxh (%ld)\n",
|
|
@@ -395,7 +395,7 @@ int arm64_load_other_segments(struct kexec_info *info,
|
|
initrd_base + initrd_size);
|
|
|
|
if (result)
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
}
|
|
|
|
@@ -403,7 +403,7 @@ int arm64_load_other_segments(struct kexec_info *info,
|
|
|
|
if (dtb.size > MiB(2)) {
|
|
fprintf(stderr, "kexec: Error: dtb too big.\n");
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
|
|
dtb_base = add_buffer_phys_virt(info, dtb.buf, dtb.size, dtb.size,
|
|
@@ -509,7 +509,7 @@ static int get_memory_ranges_iomem(struct memory_range *array,
|
|
|
|
if (!*count) {
|
|
dbgprintf("%s: failed: No RAM found.\n", __func__);
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
|
|
return 0;
|
|
diff --git a/kexec/arch/arm64/kexec-elf-arm64.c b/kexec/arch/arm64/kexec-elf-arm64.c
|
|
index daf8bf0df9c4..2b6c127ebc92 100644
|
|
--- a/kexec/arch/arm64/kexec-elf-arm64.c
|
|
+++ b/kexec/arch/arm64/kexec-elf-arm64.c
|
|
@@ -48,7 +48,7 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
|
|
|
|
if (info->kexec_flags & KEXEC_ON_CRASH) {
|
|
fprintf(stderr, "kexec: kdump not yet supported on arm64\n");
|
|
- return -EFAILED;
|
|
+ return EFAILED;
|
|
}
|
|
|
|
result = build_elf_exec_info(kernel_buf, kernel_size, &ehdr, 0);
|
|
@@ -92,7 +92,7 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
|
|
|
|
if (i == ehdr.e_phnum) {
|
|
dbgprintf("%s: Valid arm64 header not found\n", __func__);
|
|
- result = -EFAILED;
|
|
+ result = EFAILED;
|
|
goto exit;
|
|
}
|
|
|
|
@@ -100,7 +100,7 @@ int elf_arm64_load(int argc, char **argv, const char *kernel_buf,
|
|
|
|
if (kernel_segment == ULONG_MAX) {
|
|
dbgprintf("%s: Kernel segment is not allocated\n", __func__);
|
|
- result = -EFAILED;
|
|
+ result = EFAILED;
|
|
goto exit;
|
|
}
|
|
|
|
diff --git a/kexec/arch/arm64/kexec-image-arm64.c b/kexec/arch/arm64/kexec-image-arm64.c
|
|
index 960ed9667a4d..e5f2a9befdb1 100644
|
|
--- a/kexec/arch/arm64/kexec-image-arm64.c
|
|
+++ b/kexec/arch/arm64/kexec-image-arm64.c
|
|
@@ -36,13 +36,13 @@ int image_arm64_load(int argc, char **argv, const char *kernel_buf,
|
|
header = (const struct arm64_image_header *)(kernel_buf);
|
|
|
|
if (arm64_process_image_header(header))
|
|
- return -1;
|
|
+ return EFAILED;
|
|
|
|
kernel_segment = arm64_locate_kernel_segment(info);
|
|
|
|
if (kernel_segment == ULONG_MAX) {
|
|
dbgprintf("%s: Kernel segment is not allocated\n", __func__);
|
|
- result = -EFAILED;
|
|
+ result = EFAILED;
|
|
goto exit;
|
|
}
|
|
|
|
--
|
|
2.13.0
|
|
|