[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140429193146.34df9d8cfb14e436f9020eae@skynet.be>
Date: Tue, 29 Apr 2014 19:31:46 +0200
From: Fabian Frederick <fabf@...net.be>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Christoph Lameter <cl@...ux-foundation.org>,
Joe Perches <joe@...ches.com>, akpm <akpm@...ux-foundation.org>
Subject: [PATCH 2/2] mm/slub.c: convert vnsprintf-static to va_format
Inspired by Joe Perches suggestion in ntfs logging clean-up.
Cc: Christoph Lameter <cl@...ux-foundation.org>
Cc: Joe Perches <joe@...ches.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@...net.be>
---
mm/slub.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 66ee34f..4991c44 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -581,28 +581,30 @@ static void print_page_info(struct page *page)
static void slab_bug(struct kmem_cache *s, char *fmt, ...)
{
+ struct va_format vaf;
va_list args;
- char buf[100];
va_start(args, fmt);
- vsnprintf(buf, sizeof(buf), fmt, args);
- va_end(args);
+ vaf.fmt = fmt;
+ vaf.va = &args;
pr_err("=============================================================================\n");
- pr_err("BUG %s (%s): %s\n", s->name, print_tainted(), buf);
+ pr_err("BUG %s (%s): %pV\n", s->name, print_tainted(), &vaf);
pr_err("-----------------------------------------------------------------------------\n\n");
add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
+ va_end(args);
}
static void slab_fix(struct kmem_cache *s, char *fmt, ...)
{
+ struct va_format vaf;
va_list args;
- char buf[100];
va_start(args, fmt);
- vsnprintf(buf, sizeof(buf), fmt, args);
+ vaf.fmt = fmt;
+ vaf.va = &args;
+ pr_err("FIX %s: %pV\n", s->name, &vaf);
va_end(args);
- pr_err("FIX %s: %s\n", s->name, buf);
}
static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
--
1.8.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists