Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256391
b: refs/heads/master
c: e1447d8
h: refs/heads/master
i:
  256389: adb85fa
  256387: 5732348
  256383: 635bb61
v: v3
  • Loading branch information
Joe Perches authored and Gustavo F. Padovan committed Jun 30, 2011
1 parent 7e73216 commit 7fdaec0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 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: e175072f377047e28e399c5c661e39e69722f35b
refs/heads/master: e1447d8d8da5ceea60dca027e78274e6ea9b660e
9 changes: 6 additions & 3 deletions trunk/include/net/bluetooth/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ struct bt_power {
#define BT_POWER_FORCE_ACTIVE_OFF 0
#define BT_POWER_FORCE_ACTIVE_ON 1

#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg)
#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg)
#define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg)
__attribute__((format (printf, 2, 3)))
int bt_printk(const char *level, const char *fmt, ...);

#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg)
#define BT_ERR(fmt, arg...) bt_printk(KERN_ERR, pr_fmt(fmt), ##arg)
#define BT_DBG(fmt, arg...) pr_debug(fmt "\n", ##arg)

/* Connection and socket states */
enum {
Expand Down
19 changes: 19 additions & 0 deletions trunk/net/bluetooth/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,22 @@ int bt_to_errno(__u16 code)
}
}
EXPORT_SYMBOL(bt_to_errno);

int bt_printk(const char *level, const char *format, ...)
{
struct va_format vaf;
va_list args;
int r;

va_start(args, format);

vaf.fmt = format;
vaf.va = &args;

r = printk("%sBluetooth: %pV\n", level, &vaf);

va_end(args);

return r;
}
EXPORT_SYMBOL(bt_printk);

0 comments on commit 7fdaec0

Please sign in to comment.