Re: [PATCH 11/11] dynamic_debug: use a single printk() to emit msgs

From: Joe Perches
Date: Fri Jul 15 2011 - 02:41:59 EST


On Thu, 2011-07-14 at 12:09 -0400, Jason Baron wrote:
> We were using KERN_CONT to combine msgs with their prefix.
[]
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c

Perhaps instead:

> +static int dynamic_emit_prefix(const struct _ddebug *descriptor, char *buf)

static char *dynamic_emit_prefix(...)
[]

snprintf(buf, PREFIX_SIZE, KERN_DEBUG"%s%s%s%s%s%s",

Add a space please after KERN_DEBUG

[]
return buf;

> int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
[]
> + res = dynamic_emit_prefix(descriptor, buf);
> + res += printk("%s %pV", buf, &vaf);

This double counts the length of dynamic_emit_prefix.
I think this and the others should be:

res = printk("%s %pV", dynamic_emit_prefix(descriptor, buf), &vaf);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/