diff options
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 3add92329bae..30b00de4f321 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <stdarg.h> | 19 | #include <stdarg.h> |
20 | #include <linux/build_bug.h> | ||
20 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
21 | #include <linux/clk-provider.h> | 22 | #include <linux/clk-provider.h> |
22 | #include <linux/module.h> /* for KSYM_SYMBOL_LEN */ | 23 | #include <linux/module.h> /* for KSYM_SYMBOL_LEN */ |
@@ -405,6 +406,8 @@ struct printf_spec { | |||
405 | unsigned int base:8; /* number base, 8, 10 or 16 only */ | 406 | unsigned int base:8; /* number base, 8, 10 or 16 only */ |
406 | signed int precision:16; /* # of digits/chars */ | 407 | signed int precision:16; /* # of digits/chars */ |
407 | } __packed; | 408 | } __packed; |
409 | static_assert(sizeof(struct printf_spec) == 8); | ||
410 | |||
408 | #define FIELD_WIDTH_MAX ((1 << 23) - 1) | 411 | #define FIELD_WIDTH_MAX ((1 << 23) - 1) |
409 | #define PRECISION_MAX ((1 << 15) - 1) | 412 | #define PRECISION_MAX ((1 << 15) - 1) |
410 | 413 | ||
@@ -422,8 +425,6 @@ char *number(char *buf, char *end, unsigned long long num, | |||
422 | int field_width = spec.field_width; | 425 | int field_width = spec.field_width; |
423 | int precision = spec.precision; | 426 | int precision = spec.precision; |
424 | 427 | ||
425 | BUILD_BUG_ON(sizeof(struct printf_spec) != 8); | ||
426 | |||
427 | /* locase = 0 or 0x20. ORing digits or letters with 'locase' | 428 | /* locase = 0 or 0x20. ORing digits or letters with 'locase' |
428 | * produces same digits or (maybe lowercased) letters */ | 429 | * produces same digits or (maybe lowercased) letters */ |
429 | locase = (spec.flags & SMALL); | 430 | locase = (spec.flags & SMALL); |