SHA256
1
0
forked from pool/kexec-tools
kexec-tools/0029-Don-t-use-L-width-specifier-with-integer-values.patch
Tony Jones 080f64dafa Accepting request 500203 from home:tiwai:branches:Kernel:kdump
- 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
2017-05-31 20:00:34 +00:00

193 lines
7.4 KiB
Diff

From 47cc70157c6610d4c01a7ab4f8f0d24ab054b43b Mon Sep 17 00:00:00 2001
From: Philip Prindeville <philipp@redfish-solutions.com>
Date: Fri, 10 Mar 2017 20:12:15 -0700
Subject: [PATCH 29/45] Don't use %L width specifier with integer values
MUSL doesn't support %L except for floating-point arguments; therefore,
%ll must be used instead with integer arguments.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
kexec/arch/arm/kexec-arm.c | 2 +-
kexec/arch/i386/crashdump-x86.c | 8 ++++----
kexec/arch/i386/kexec-x86-common.c | 2 +-
kexec/arch/ia64/kexec-elf-rel-ia64.c | 2 +-
kexec/arch/mips/crashdump-mips.c | 2 +-
kexec/arch/mips/kexec-mips.c | 2 +-
kexec/arch/s390/kexec-s390.c | 2 +-
kexec/crashdump.c | 8 ++++----
kexec/kexec-iomem.c | 2 +-
9 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c
index 2194b7cbfcb7..49f35b11b21c 100644
--- a/kexec/arch/arm/kexec-arm.c
+++ b/kexec/arch/arm/kexec-arm.c
@@ -47,7 +47,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
int count;
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index c4cf2013a001..285dea9abd4b 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -119,7 +119,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
}
while(fgets(line, sizeof(line), fp) != NULL) {
- if (sscanf(line, "%Lx %c %s", &vaddr, &type, sym) != 3)
+ if (sscanf(line, "%llx %c %s", &vaddr, &type, sym) != 3)
continue;
if (strcmp(sym, symbol) == 0) {
dbgprintf("kernel symbol %s vaddr = %16llx\n", symbol, vaddr);
@@ -296,12 +296,12 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
if (memory_ranges >= CRASH_MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;
- dbgprintf("%016Lx-%016Lx : %s",
+ dbgprintf("%016llx-%016llx : %s",
start, end, str);
/* Only Dumping memory of type System RAM. */
if (memcmp(str, "System RAM\n", 11) == 0) {
@@ -778,7 +778,7 @@ static int get_crash_notes(int cpu, uint64_t *addr, uint64_t *len)
*addr = x86__pa(vaddr + (cpu * MAX_NOTE_BYTES));
*len = MAX_NOTE_BYTES;
- dbgprintf("crash_notes addr = %Lx\n",
+ dbgprintf("crash_notes addr = %llx\n",
(unsigned long long)*addr);
fclose(fp);
diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
index 3e97239c0c78..be03618770f7 100644
--- a/kexec/arch/i386/kexec-x86-common.c
+++ b/kexec/arch/i386/kexec-x86-common.c
@@ -81,7 +81,7 @@ static int get_memory_ranges_proc_iomem(struct memory_range **range, int *ranges
int count;
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/ia64/kexec-elf-rel-ia64.c b/kexec/arch/ia64/kexec-elf-rel-ia64.c
index 7f7c08cba4b1..500f2473ee38 100644
--- a/kexec/arch/ia64/kexec-elf-rel-ia64.c
+++ b/kexec/arch/ia64/kexec-elf-rel-ia64.c
@@ -155,6 +155,6 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr,
}
return;
overflow:
- die("overflow in relocation type %lu val %Lx\n",
+ die("overflow in relocation type %lu val %llx\n",
r_type, value);
}
diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
index 9c33599a34ed..6308ec81276f 100644
--- a/kexec/arch/mips/crashdump-mips.c
+++ b/kexec/arch/mips/crashdump-mips.c
@@ -173,7 +173,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
int type, consumed, count;
if (memory_ranges >= CRASH_MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c
index ee3cd3a8b6eb..2e5b700da1ed 100644
--- a/kexec/arch/mips/kexec-mips.c
+++ b/kexec/arch/mips/kexec-mips.c
@@ -48,7 +48,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
while (fgets(line, sizeof(line), fp) != 0) {
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
+ count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;
diff --git a/kexec/arch/s390/kexec-s390.c b/kexec/arch/s390/kexec-s390.c
index f863483ce808..33ba6b970664 100644
--- a/kexec/arch/s390/kexec-s390.c
+++ b/kexec/arch/s390/kexec-s390.c
@@ -170,7 +170,7 @@ int get_memory_ranges_s390(struct memory_range memory_range[], int *ranges,
if (current_range == MAX_MEMORY_RANGES)
break;
- sscanf(line,"%Lx-%Lx : %n", &start, &end, &cons);
+ sscanf(line,"%llx-%llx : %n", &start, &end, &cons);
str = line+cons;
if ((memcmp(str, sys_ram, strlen(sys_ram)) == 0) ||
((memcmp(str, crash_kernel, strlen(crash_kernel)) == 0) &&
diff --git a/kexec/crashdump.c b/kexec/crashdump.c
index 15c11051fb98..0b363c503833 100644
--- a/kexec/crashdump.c
+++ b/kexec/crashdump.c
@@ -98,7 +98,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
}
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
- count = sscanf(line, "%Lx", &temp);
+ count = sscanf(line, "%llx", &temp);
if (count != 1)
die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
*addr = (uint64_t) temp;
@@ -112,7 +112,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n",
crash_notes_size, strerror(errno));
- count = sscanf(line, "%Lu", &temp);
+ count = sscanf(line, "%llu", &temp);
if (count != 1)
die("Cannot parse %s: %s\n",
crash_notes_size, strerror(errno));
@@ -120,7 +120,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
fclose(fp);
}
- dbgprintf("%s: crash_notes addr = %Lx, size = %Lu\n", __FUNCTION__,
+ dbgprintf("%s: crash_notes addr = %llx, size = %llu\n", __FUNCTION__,
(unsigned long long)*addr, (unsigned long long)*len);
return 0;
@@ -141,7 +141,7 @@ static int get_vmcoreinfo(const char *kdump_info, uint64_t *addr, uint64_t *len)
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
- count = sscanf(line, "%Lx %Lx", &temp, &temp2);
+ count = sscanf(line, "%llx %llx", &temp, &temp2);
if (count != 2)
die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
diff --git a/kexec/kexec-iomem.c b/kexec/kexec-iomem.c
index 485a2e810080..7ec385371a2c 100644
--- a/kexec/kexec-iomem.c
+++ b/kexec/kexec-iomem.c
@@ -44,7 +44,7 @@ int kexec_iomem_for_each_line(char *match,
die("Cannot open %s\n", iomem);
while(fgets(line, sizeof(line), fp) != 0) {
- count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
+ count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;
--
2.13.0