Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309715
b: refs/heads/master
c: 725fe00
h: refs/heads/master
i:
  309713: 0886ee2
  309711: 2f1a8d3
v: v3
  • Loading branch information
Grant Likely authored and Linus Torvalds committed Jun 1, 2012
1 parent 4addc1b commit 244fa4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d84970bbaf9a09b3fc60c18ee6d59bc9cb4c3b8a
refs/heads/master: 725fe002d315c2501c110b7245d3eb4f4535f4d6
8 changes: 5 additions & 3 deletions trunk/lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,13 +870,15 @@ static noinline_for_stack
char *pointer(const char *fmt, char *buf, char *end, void *ptr,
struct printf_spec spec)
{
int default_width = 2 * sizeof(void *) + (spec.flags & SPECIAL ? 2 : 0);

if (!ptr && *fmt != 'K') {
/*
* Print (null) with the same width as a pointer so it makes
* tabular output look nice.
*/
if (spec.field_width == -1)
spec.field_width = 2 * sizeof(void *);
spec.field_width = default_width;
return string(buf, end, "(null)", spec);
}

Expand Down Expand Up @@ -931,7 +933,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
*/
if (in_irq() || in_serving_softirq() || in_nmi()) {
if (spec.field_width == -1)
spec.field_width = 2 * sizeof(void *);
spec.field_width = default_width;
return string(buf, end, "pK-error", spec);
}
if (!((kptr_restrict == 0) ||
Expand All @@ -948,7 +950,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
}
spec.flags |= SMALL;
if (spec.field_width == -1) {
spec.field_width = 2 * sizeof(void *);
spec.field_width = default_width;
spec.flags |= ZEROPAD;
}
spec.base = 16;
Expand Down

0 comments on commit 244fa4b

Please sign in to comment.