Skip to content

Commit

Permalink
mm/slub.c: convert vnsprintf-static to va_format
Browse files Browse the repository at this point in the history
Inspired by Joe Perches suggestion in ntfs logging clean-up.

Signed-off-by: Fabian Frederick <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Pekka Enberg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed Jun 4, 2014
1 parent f9f5828 commit ecc42fb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,28 +578,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)
Expand Down

0 comments on commit ecc42fb

Please sign in to comment.