diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-06-04 19:06:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:53:55 -0400 |
commit | ecc42fbe952fa4aae88c2413e21912b1d665fb93 (patch) | |
tree | 0391eb27cb6ed1f0dc5c73149dc1e0668a602839 /mm/slub.c | |
parent | f9f58285947d9c88079bfb7b7666c987011e3377 (diff) |
mm/slub.c: convert vnsprintf-static to va_format
Inspired by Joe Perches suggestion in ntfs logging clean-up.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Joe Perches <joe@perches.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -578,28 +578,30 @@ static void print_page_info(struct page *page) | |||
578 | 578 | ||
579 | static void slab_bug(struct kmem_cache *s, char *fmt, ...) | 579 | static void slab_bug(struct kmem_cache *s, char *fmt, ...) |
580 | { | 580 | { |
581 | struct va_format vaf; | ||
581 | va_list args; | 582 | va_list args; |
582 | char buf[100]; | ||
583 | 583 | ||
584 | va_start(args, fmt); | 584 | va_start(args, fmt); |
585 | vsnprintf(buf, sizeof(buf), fmt, args); | 585 | vaf.fmt = fmt; |
586 | va_end(args); | 586 | vaf.va = &args; |
587 | pr_err("=============================================================================\n"); | 587 | pr_err("=============================================================================\n"); |
588 | pr_err("BUG %s (%s): %s\n", s->name, print_tainted(), buf); | 588 | pr_err("BUG %s (%s): %pV\n", s->name, print_tainted(), &vaf); |
589 | pr_err("-----------------------------------------------------------------------------\n\n"); | 589 | pr_err("-----------------------------------------------------------------------------\n\n"); |
590 | 590 | ||
591 | add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); | 591 | add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); |
592 | va_end(args); | ||
592 | } | 593 | } |
593 | 594 | ||
594 | static void slab_fix(struct kmem_cache *s, char *fmt, ...) | 595 | static void slab_fix(struct kmem_cache *s, char *fmt, ...) |
595 | { | 596 | { |
597 | struct va_format vaf; | ||
596 | va_list args; | 598 | va_list args; |
597 | char buf[100]; | ||
598 | 599 | ||
599 | va_start(args, fmt); | 600 | va_start(args, fmt); |
600 | vsnprintf(buf, sizeof(buf), fmt, args); | 601 | vaf.fmt = fmt; |
602 | vaf.va = &args; | ||
603 | pr_err("FIX %s: %pV\n", s->name, &vaf); | ||
601 | va_end(args); | 604 | va_end(args); |
602 | pr_err("FIX %s: %s\n", s->name, buf); | ||
603 | } | 605 | } |
604 | 606 | ||
605 | static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p) | 607 | static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p) |