Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324446
b: refs/heads/master
c: 666f355
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Greg Kroah-Hartman committed Sep 17, 2012
1 parent e1c1d75 commit 491755c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05e4e5b87aab74f994acf9dd4bed4a8f1367cd09
refs/heads/master: 666f355f3805d68b6ed5f7013806f1f65abfbf03
14 changes: 5 additions & 9 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,8 @@ void device_shutdown(void)
*/

#ifdef CONFIG_PRINTK
int create_syslog_header(const struct device *dev, char *hdr, size_t hdrlen)
static int
create_syslog_header(const struct device *dev, char *hdr, size_t hdrlen)
{
const char *subsys;
size_t pos = 0;
Expand Down Expand Up @@ -1943,17 +1944,12 @@ EXPORT_SYMBOL(dev_printk_emit);
static int __dev_printk(const char *level, const struct device *dev,
struct va_format *vaf)
{
char hdr[128];
size_t hdrlen;

if (!dev)
return printk("%s(NULL device *): %pV", level, vaf);

hdrlen = create_syslog_header(dev, hdr, sizeof(hdr));

return printk_emit(0, level[1] - '0', hdrlen ? hdr : NULL, hdrlen,
"%s %s: %pV",
dev_driver_string(dev), dev_name(dev), vaf);
return dev_printk_emit(level[1] - '0', dev,
"%s %s: %pV",
dev_driver_string(dev), dev_name(dev), vaf);
}

int dev_printk(const char *level, const struct device *dev,
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,6 @@ extern const char *dev_driver_string(const struct device *dev);

#ifdef CONFIG_PRINTK

extern int create_syslog_header(const struct device *dev,
char *hdr, size_t hdrlen);
extern int dev_vprintk_emit(int level, const struct device *dev,
const char *fmt, va_list args);
extern __printf(3, 4)
Expand Down
31 changes: 11 additions & 20 deletions trunk/lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,15 +591,11 @@ int __dynamic_dev_dbg(struct _ddebug *descriptor,
res = printk(KERN_DEBUG "(NULL device *): %pV", &vaf);
} else {
char buf[PREFIX_SIZE];
char dict[128];
size_t dictlen;

dictlen = create_syslog_header(dev, dict, sizeof(dict));

res = printk_emit(0, 7, dictlen ? dict : NULL, dictlen,
"%s%s %s: %pV",
dynamic_emit_prefix(descriptor, buf),
dev_driver_string(dev), dev_name(dev), &vaf);
res = dev_printk_emit(7, dev, "%s%s %s: %pV",
dynamic_emit_prefix(descriptor, buf),
dev_driver_string(dev), dev_name(dev),
&vaf);
}

va_end(args);
Expand Down Expand Up @@ -627,18 +623,13 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,

if (dev && dev->dev.parent) {
char buf[PREFIX_SIZE];
char dict[128];
size_t dictlen;

dictlen = create_syslog_header(dev->dev.parent,
dict, sizeof(dict));

res = printk_emit(0, 7, dictlen ? dict : NULL, dictlen,
"%s%s %s %s: %pV",
dynamic_emit_prefix(descriptor, buf),
dev_driver_string(dev->dev.parent),
dev_name(dev->dev.parent),
netdev_name(dev), &vaf);

res = dev_printk_emit(7, dev->dev.parent,
"%s%s %s %s: %pV",
dynamic_emit_prefix(descriptor, buf),
dev_driver_string(dev->dev.parent),
dev_name(dev->dev.parent),
netdev_name(dev), &vaf);
} else if (dev) {
res = printk(KERN_DEBUG "%s: %pV", netdev_name(dev), &vaf);
} else {
Expand Down
16 changes: 6 additions & 10 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6429,16 +6429,12 @@ static int __netdev_printk(const char *level, const struct net_device *dev,
int r;

if (dev && dev->dev.parent) {
char dict[128];
size_t dictlen = create_syslog_header(dev->dev.parent,
dict, sizeof(dict));

r = printk_emit(0, level[1] - '0',
dictlen ? dict : NULL, dictlen,
"%s %s %s: %pV",
dev_driver_string(dev->dev.parent),
dev_name(dev->dev.parent),
netdev_name(dev), vaf);
r = dev_printk_emit(level[1] - '0',
dev->dev.parent,
"%s %s %s: %pV",
dev_driver_string(dev->dev.parent),
dev_name(dev->dev.parent),
netdev_name(dev), vaf);
} else if (dev) {
r = printk("%s%s: %pV", level, netdev_name(dev), vaf);
} else {
Expand Down

0 comments on commit 491755c

Please sign in to comment.