netdev_printk/dynamic_netdev_dbg: Directly call printk_emit

A lot of stack is used in recursive printks with %pV.

Using multiple levels of %pV (a logging function with %pV
that calls another logging function with %pV) can consume
more stack than necessary.

Avoid excessive stack use by not calling dev_printk from
netdev_printk and dynamic_netdev_dbg.  Duplicate the logic
and form of dev_printk instead.

Make __netdev_printk static.
Remove EXPORT_SYMBOL(__netdev_printk)
Whitespace and brace style neatening.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: David S. Miller <davem@davemloft.net>
Tested-by: Jim Cromie <jim.cromie@gmail.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Joe Perches
2012-09-12 20:12:19 -07:00
committed by Greg Kroah-Hartman
parent 798efc60e4
commit b004ff4972
3 changed files with 40 additions and 13 deletions

View File

@@ -2720,9 +2720,6 @@ static inline const char *netdev_name(const struct net_device *dev)
return dev->name;
}
extern int __netdev_printk(const char *level, const struct net_device *dev,
struct va_format *vaf);
extern __printf(3, 4)
int netdev_printk(const char *level, const struct net_device *dev,
const char *format, ...);