130-dont-use-percentL.patch 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. commit f14881e87b1426d2c439e2fad9a1e03a3b35e196
  2. Author: Philip Prindeville <philipp@redfish-solutions.com>
  3. Date: Fri Mar 10 19:57:11 2017 -0700
  4. Don't use %L width specifier with integer values
  5. MUSL doesn't support %L except for floating-point arguments; therefore,
  6. %ll must be used instead with integer arguments.
  7. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
  8. diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c
  9. index 2194b7c..49f35b1 100644
  10. --- a/kexec/arch/arm/kexec-arm.c
  11. +++ b/kexec/arch/arm/kexec-arm.c
  12. @@ -47,7 +47,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
  13. int count;
  14. if (memory_ranges >= MAX_MEMORY_RANGES)
  15. break;
  16. - count = sscanf(line, "%Lx-%Lx : %n",
  17. + count = sscanf(line, "%llx-%llx : %n",
  18. &start, &end, &consumed);
  19. if (count != 2)
  20. continue;
  21. diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
  22. index c4cf201..285dea9 100644
  23. --- a/kexec/arch/i386/crashdump-x86.c
  24. +++ b/kexec/arch/i386/crashdump-x86.c
  25. @@ -119,7 +119,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
  26. }
  27. while(fgets(line, sizeof(line), fp) != NULL) {
  28. - if (sscanf(line, "%Lx %c %s", &vaddr, &type, sym) != 3)
  29. + if (sscanf(line, "%llx %c %s", &vaddr, &type, sym) != 3)
  30. continue;
  31. if (strcmp(sym, symbol) == 0) {
  32. dbgprintf("kernel symbol %s vaddr = %16llx\n", symbol, vaddr);
  33. @@ -296,12 +296,12 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
  34. if (memory_ranges >= CRASH_MAX_MEMORY_RANGES)
  35. break;
  36. - count = sscanf(line, "%Lx-%Lx : %n",
  37. + count = sscanf(line, "%llx-%llx : %n",
  38. &start, &end, &consumed);
  39. if (count != 2)
  40. continue;
  41. str = line + consumed;
  42. - dbgprintf("%016Lx-%016Lx : %s",
  43. + dbgprintf("%016llx-%016llx : %s",
  44. start, end, str);
  45. /* Only Dumping memory of type System RAM. */
  46. if (memcmp(str, "System RAM\n", 11) == 0) {
  47. @@ -778,7 +778,7 @@ static int get_crash_notes(int cpu, uint64_t *addr, uint64_t *len)
  48. *addr = x86__pa(vaddr + (cpu * MAX_NOTE_BYTES));
  49. *len = MAX_NOTE_BYTES;
  50. - dbgprintf("crash_notes addr = %Lx\n",
  51. + dbgprintf("crash_notes addr = %llx\n",
  52. (unsigned long long)*addr);
  53. fclose(fp);
  54. diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
  55. index 3e97239..be03618 100644
  56. --- a/kexec/arch/i386/kexec-x86-common.c
  57. +++ b/kexec/arch/i386/kexec-x86-common.c
  58. @@ -81,7 +81,7 @@ static int get_memory_ranges_proc_iomem(struct memory_range **range, int *ranges
  59. int count;
  60. if (memory_ranges >= MAX_MEMORY_RANGES)
  61. break;
  62. - count = sscanf(line, "%Lx-%Lx : %n",
  63. + count = sscanf(line, "%llx-%llx : %n",
  64. &start, &end, &consumed);
  65. if (count != 2)
  66. continue;
  67. diff --git a/kexec/arch/ia64/kexec-elf-rel-ia64.c b/kexec/arch/ia64/kexec-elf-rel-ia64.c
  68. index 7f7c08c..500f247 100644
  69. --- a/kexec/arch/ia64/kexec-elf-rel-ia64.c
  70. +++ b/kexec/arch/ia64/kexec-elf-rel-ia64.c
  71. @@ -155,6 +155,6 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr,
  72. }
  73. return;
  74. overflow:
  75. - die("overflow in relocation type %lu val %Lx\n",
  76. + die("overflow in relocation type %lu val %llx\n",
  77. r_type, value);
  78. }
  79. diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
  80. index 9c33599..6308ec8 100644
  81. --- a/kexec/arch/mips/crashdump-mips.c
  82. +++ b/kexec/arch/mips/crashdump-mips.c
  83. @@ -173,7 +173,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
  84. int type, consumed, count;
  85. if (memory_ranges >= CRASH_MAX_MEMORY_RANGES)
  86. break;
  87. - count = sscanf(line, "%Lx-%Lx : %n",
  88. + count = sscanf(line, "%llx-%llx : %n",
  89. &start, &end, &consumed);
  90. if (count != 2)
  91. continue;
  92. diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c
  93. index ee3cd3a..2e5b700 100644
  94. --- a/kexec/arch/mips/kexec-mips.c
  95. +++ b/kexec/arch/mips/kexec-mips.c
  96. @@ -48,7 +48,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
  97. while (fgets(line, sizeof(line), fp) != 0) {
  98. if (memory_ranges >= MAX_MEMORY_RANGES)
  99. break;
  100. - count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
  101. + count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
  102. if (count != 2)
  103. continue;
  104. str = line + consumed;
  105. diff --git a/kexec/arch/s390/kexec-s390.c b/kexec/arch/s390/kexec-s390.c
  106. index f863483..33ba6b9 100644
  107. --- a/kexec/arch/s390/kexec-s390.c
  108. +++ b/kexec/arch/s390/kexec-s390.c
  109. @@ -170,7 +170,7 @@ int get_memory_ranges_s390(struct memory_range memory_range[], int *ranges,
  110. if (current_range == MAX_MEMORY_RANGES)
  111. break;
  112. - sscanf(line,"%Lx-%Lx : %n", &start, &end, &cons);
  113. + sscanf(line,"%llx-%llx : %n", &start, &end, &cons);
  114. str = line+cons;
  115. if ((memcmp(str, sys_ram, strlen(sys_ram)) == 0) ||
  116. ((memcmp(str, crash_kernel, strlen(crash_kernel)) == 0) &&
  117. diff --git a/kexec/crashdump.c b/kexec/crashdump.c
  118. index 15c1105..0b363c5 100644
  119. --- a/kexec/crashdump.c
  120. +++ b/kexec/crashdump.c
  121. @@ -98,7 +98,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
  122. }
  123. if (!fgets(line, sizeof(line), fp))
  124. die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
  125. - count = sscanf(line, "%Lx", &temp);
  126. + count = sscanf(line, "%llx", &temp);
  127. if (count != 1)
  128. die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
  129. *addr = (uint64_t) temp;
  130. @@ -112,7 +112,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
  131. if (!fgets(line, sizeof(line), fp))
  132. die("Cannot parse %s: %s\n",
  133. crash_notes_size, strerror(errno));
  134. - count = sscanf(line, "%Lu", &temp);
  135. + count = sscanf(line, "%llu", &temp);
  136. if (count != 1)
  137. die("Cannot parse %s: %s\n",
  138. crash_notes_size, strerror(errno));
  139. @@ -120,7 +120,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
  140. fclose(fp);
  141. }
  142. - dbgprintf("%s: crash_notes addr = %Lx, size = %Lu\n", __FUNCTION__,
  143. + dbgprintf("%s: crash_notes addr = %llx, size = %llu\n", __FUNCTION__,
  144. (unsigned long long)*addr, (unsigned long long)*len);
  145. return 0;
  146. @@ -141,7 +141,7 @@ static int get_vmcoreinfo(const char *kdump_info, uint64_t *addr, uint64_t *len)
  147. if (!fgets(line, sizeof(line), fp))
  148. die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
  149. - count = sscanf(line, "%Lx %Lx", &temp, &temp2);
  150. + count = sscanf(line, "%llx %llx", &temp, &temp2);
  151. if (count != 2)
  152. die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
  153. diff --git a/kexec/kexec-iomem.c b/kexec/kexec-iomem.c
  154. index 485a2e8..7ec3853 100644
  155. --- a/kexec/kexec-iomem.c
  156. +++ b/kexec/kexec-iomem.c
  157. @@ -44,7 +44,7 @@ int kexec_iomem_for_each_line(char *match,
  158. die("Cannot open %s\n", iomem);
  159. while(fgets(line, sizeof(line), fp) != 0) {
  160. - count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
  161. + count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
  162. if (count != 2)
  163. continue;
  164. str = line + consumed;