lkml.org 
[lkml]   [2012]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/4] firewire: net: prefix all log messages with interface name
From
Date
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__)




\
 
 \ /
  Last update: 2012-02-18 22:35    [W:0.041 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site