Re: [PATCH 3/4] firewire: net: prefix all log messages withinterface name

From: Joe Perches
Date: Sat Feb 18 2012 - 16:32:28 EST


On Sat, 2012-02-18 at 22:02 +0100, Stefan Richter wrote:
> Change the log line prefix from "firewire_net: " to
> "firewire_net firewire0: " etc. for the case that several RFC 2734
> interfaces are being used in the same machine.

Why not just "firewireX: " ?

[]
> +#define fwnet_notice(net, fmt, args...) \
> + printk(KERN_NOTICE "%s %s: " fmt, KBUILD_MODNAME, (net)->name, ## args)
> +#define fwnet_err(net, fmt, args...) \
> + printk(KERN_ERR "%s %s: " fmt, KBUILD_MODNAME, (net)->name, ## args)

Adding code for the "%s:...", KBUILD_MODNAME rarely saves
overall space. Did you try embedding KBUILD_MODNAME
without the "%s: " and comparing the size?

Perhaps just add pr_fmt and pr_<level>?

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt /* (if really necessary) */

and

#define fwnet_notice(net, fmt, ...) \
pr_notice("%s: " fmt, (net)->name, ##__VA_ARGS__)
#define fwnet_err(net, fmt, ...) \
pr_err("%s: " fmt, (net)->name, ##__VA_ARGS__)


--
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/