aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string_helpers.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-08-22 04:04:15 -0400
committerIngo Molnar <mingo@kernel.org>2014-08-22 04:04:15 -0400
commit80b304fd00e8b667775ff791121b61ecd7cd0c03 (patch)
treeb4f2ec59fe062c43343ee4c2f10a6bcd0e4dcd1b /lib/string_helpers.c
parentfb21b84e7f809ef04b1e5aed5d463cf0d4866638 (diff)
parent6a7519e81321343165f89abb8b616df186d3e57a (diff)
Merge tag 'efi-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi into x86/urgent
Pull EFI fixes from Matt Fleming: * WARN_ON(!spin_is_locked()) always triggers on non-SMP machines. Swap it for the more canonical lockdep_assert_held() which always does the right thing - Guenter Roeck * Assign the correct value to efi.runtime_version on arm64 so that all the runtime services can be invoked - Semen Protsenko Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/string_helpers.c')
-rw-r--r--lib/string_helpers.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/string_helpers.c b/lib/string_helpers.c
index ed5c1454dd62..29033f319aea 100644
--- a/lib/string_helpers.c
+++ b/lib/string_helpers.c
@@ -25,12 +25,15 @@
25int string_get_size(u64 size, const enum string_size_units units, 25int string_get_size(u64 size, const enum string_size_units units,
26 char *buf, int len) 26 char *buf, int len)
27{ 27{
28 static const char *units_10[] = { "B", "kB", "MB", "GB", "TB", "PB", 28 static const char *const units_10[] = {
29 "EB", "ZB", "YB", NULL}; 29 "B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB", NULL
30 static const char *units_2[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB", 30 };
31 "EiB", "ZiB", "YiB", NULL }; 31 static const char *const units_2[] = {
32 static const char **units_str[] = { 32 "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB",
33 [STRING_UNITS_10] = units_10, 33 NULL
34 };
35 static const char *const *const units_str[] = {
36 [STRING_UNITS_10] = units_10,
34 [STRING_UNITS_2] = units_2, 37 [STRING_UNITS_2] = units_2,
35 }; 38 };
36 static const unsigned int divisor[] = { 39 static const unsigned int divisor[] = {