diff options
| author | Ingo Molnar <mingo@kernel.org> | 2012-05-30 10:59:04 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2012-05-30 10:59:04 +0200 |
| commit | 063e04776172f93b16a5eefd5661a340c1126513 (patch) | |
| tree | 19cb1623631c8cc5dcf0d91f4731feec7cbefa04 /lib/vsprintf.c | |
| parent | 59cd358a7a5b2f6b61faa01dae6cfda3830ac62a (diff) | |
| parent | 731a7378b81c2f5fa88ca1ae20b83d548d5613dc (diff) | |
| download | linux-next-063e04776172f93b16a5eefd5661a340c1126513.tar.gz linux-next-063e04776172f93b16a5eefd5661a340c1126513.zip | |
Merge branch 'linus' into perf/urgent
Merge back Linus's latest branch so that we pick up the uprobes changes.
( I tested this branch locally and while it's one from the middle of the
merge window it's a good one to base further work off. )
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/vsprintf.c')
| -rw-r--r-- | lib/vsprintf.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index abbabec9720a..5391299c1e78 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -284,6 +284,7 @@ char *number(char *buf, char *end, unsigned long long num, char locase; int need_pfx = ((spec.flags & SPECIAL) && spec.base != 10); int i; + bool is_zero = num == 0LL; /* locase = 0 or 0x20. ORing digits or letters with 'locase' * produces same digits or (maybe lowercased) letters */ @@ -305,8 +306,9 @@ char *number(char *buf, char *end, unsigned long long num, } } if (need_pfx) { - spec.field_width--; if (spec.base == 16) + spec.field_width -= 2; + else if (!is_zero) spec.field_width--; } @@ -353,9 +355,11 @@ char *number(char *buf, char *end, unsigned long long num, } /* "0x" / "0" prefix */ if (need_pfx) { - if (buf < end) - *buf = '0'; - ++buf; + if (spec.base == 16 || !is_zero) { + if (buf < end) + *buf = '0'; + ++buf; + } if (spec.base == 16) { if (buf < end) *buf = ('X' | locase); @@ -436,7 +440,7 @@ char *symbol_string(char *buf, char *end, void *ptr, else if (ext != 'f' && ext != 's') sprint_symbol(sym, value); else - kallsyms_lookup(value, NULL, NULL, NULL, sym); + sprint_symbol_no_offset(sym, value); return string(buf, end, sym, spec); #else |
