aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-06-04 19:06:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:53:55 -0400
commitecc42fbe952fa4aae88c2413e21912b1d665fb93 (patch)
tree0391eb27cb6ed1f0dc5c73149dc1e0668a602839 /mm/slub.c
parentf9f58285947d9c88079bfb7b7666c987011e3377 (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.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 1594b14e2597..de99d500af6c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -578,28 +578,30 @@ static void print_page_info(struct page *page)
578 578
579static void slab_bug(struct kmem_cache *s, char *fmt, ...) 579static 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
594static void slab_fix(struct kmem_cache *s, char *fmt, ...) 595static 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
605static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p) 607static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)