aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-09-25 05:49:43 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-09-27 17:10:00 -0400
commit6ed93dc6427d14cdfe0b272cc0a9ee4685ce9ad7 (patch)
treefbb25833b61cbaabe5a7cd81240f02334bf999b7
parent36a75f1b3ecf94dcf140b9d3d2f7a03b7e258480 (diff)
Bluetooth: Use %pMR in debug instead of batostr
Instead of old unsafe batostr function use %pMR print specifier for printing Bluetooth addresses in debug and error statements. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r--net/bluetooth/bnep/core.c3
-rw-r--r--net/bluetooth/hci_conn.c6
-rw-r--r--net/bluetooth/hci_core.c22
-rw-r--r--net/bluetooth/hci_event.c15
-rw-r--r--net/bluetooth/l2cap_core.c6
-rw-r--r--net/bluetooth/rfcomm/core.c6
-rw-r--r--net/bluetooth/rfcomm/sock.c2
-rw-r--r--net/bluetooth/rfcomm/tty.c4
-rw-r--r--net/bluetooth/sco.c8
9 files changed, 35 insertions, 37 deletions
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 4a6620bc157..a5b63970263 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -182,8 +182,7 @@ static int bnep_ctrl_set_mcfilter(struct bnep_session *s, u8 *data, int len)
182 a2 = data; 182 a2 = data;
183 data += ETH_ALEN; 183 data += ETH_ALEN;
184 184
185 BT_DBG("mc filter %s -> %s", 185 BT_DBG("mc filter %pMR -> %pMR", a1, a2);
186 batostr((void *) a1), batostr((void *) a2));
187 186
188 /* Iterate from a1 to a2 */ 187 /* Iterate from a1 to a2 */
189 set_bit(bnep_mc_hash(a1), (ulong *) &s->mc_filter); 188 set_bit(bnep_mc_hash(a1), (ulong *) &s->mc_filter);
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index b9196a44f75..53202f6733a 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -320,7 +320,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
320{ 320{
321 struct hci_conn *conn; 321 struct hci_conn *conn;
322 322
323 BT_DBG("%s dst %s", hdev->name, batostr(dst)); 323 BT_DBG("%s dst %pMR", hdev->name, dst);
324 324
325 conn = kzalloc(sizeof(struct hci_conn), GFP_KERNEL); 325 conn = kzalloc(sizeof(struct hci_conn), GFP_KERNEL);
326 if (!conn) 326 if (!conn)
@@ -437,7 +437,7 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
437 int use_src = bacmp(src, BDADDR_ANY); 437 int use_src = bacmp(src, BDADDR_ANY);
438 struct hci_dev *hdev = NULL, *d; 438 struct hci_dev *hdev = NULL, *d;
439 439
440 BT_DBG("%s -> %s", batostr(src), batostr(dst)); 440 BT_DBG("%pMR -> %pMR", src, dst);
441 441
442 read_lock(&hci_dev_list_lock); 442 read_lock(&hci_dev_list_lock);
443 443
@@ -567,7 +567,7 @@ static struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type,
567struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, 567struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
568 __u8 dst_type, __u8 sec_level, __u8 auth_type) 568 __u8 dst_type, __u8 sec_level, __u8 auth_type)
569{ 569{
570 BT_DBG("%s dst %s type 0x%x", hdev->name, batostr(dst), type); 570 BT_DBG("%s dst %pMR type 0x%x", hdev->name, dst, type);
571 571
572 switch (type) { 572 switch (type) {
573 case LE_LINK: 573 case LE_LINK:
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index e4070517ff3..ab4fca2448d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -405,7 +405,7 @@ struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev,
405 struct discovery_state *cache = &hdev->discovery; 405 struct discovery_state *cache = &hdev->discovery;
406 struct inquiry_entry *e; 406 struct inquiry_entry *e;
407 407
408 BT_DBG("cache %p, %s", cache, batostr(bdaddr)); 408 BT_DBG("cache %p, %pMR", cache, bdaddr);
409 409
410 list_for_each_entry(e, &cache->all, all) { 410 list_for_each_entry(e, &cache->all, all) {
411 if (!bacmp(&e->data.bdaddr, bdaddr)) 411 if (!bacmp(&e->data.bdaddr, bdaddr))
@@ -421,7 +421,7 @@ struct inquiry_entry *hci_inquiry_cache_lookup_unknown(struct hci_dev *hdev,
421 struct discovery_state *cache = &hdev->discovery; 421 struct discovery_state *cache = &hdev->discovery;
422 struct inquiry_entry *e; 422 struct inquiry_entry *e;
423 423
424 BT_DBG("cache %p, %s", cache, batostr(bdaddr)); 424 BT_DBG("cache %p, %pMR", cache, bdaddr);
425 425
426 list_for_each_entry(e, &cache->unknown, list) { 426 list_for_each_entry(e, &cache->unknown, list) {
427 if (!bacmp(&e->data.bdaddr, bdaddr)) 427 if (!bacmp(&e->data.bdaddr, bdaddr))
@@ -438,7 +438,7 @@ struct inquiry_entry *hci_inquiry_cache_lookup_resolve(struct hci_dev *hdev,
438 struct discovery_state *cache = &hdev->discovery; 438 struct discovery_state *cache = &hdev->discovery;
439 struct inquiry_entry *e; 439 struct inquiry_entry *e;
440 440
441 BT_DBG("cache %p bdaddr %s state %d", cache, batostr(bdaddr), state); 441 BT_DBG("cache %p bdaddr %pMR state %d", cache, bdaddr, state);
442 442
443 list_for_each_entry(e, &cache->resolve, list) { 443 list_for_each_entry(e, &cache->resolve, list) {
444 if (!bacmp(bdaddr, BDADDR_ANY) && e->name_state == state) 444 if (!bacmp(bdaddr, BDADDR_ANY) && e->name_state == state)
@@ -475,7 +475,7 @@ bool hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data,
475 struct discovery_state *cache = &hdev->discovery; 475 struct discovery_state *cache = &hdev->discovery;
476 struct inquiry_entry *ie; 476 struct inquiry_entry *ie;
477 477
478 BT_DBG("cache %p, %s", cache, batostr(&data->bdaddr)); 478 BT_DBG("cache %p, %pMR", cache, &data->bdaddr);
479 479
480 if (ssp) 480 if (ssp)
481 *ssp = data->ssp_mode; 481 *ssp = data->ssp_mode;
@@ -1257,7 +1257,7 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
1257 list_add(&key->list, &hdev->link_keys); 1257 list_add(&key->list, &hdev->link_keys);
1258 } 1258 }
1259 1259
1260 BT_DBG("%s key for %s type %u", hdev->name, batostr(bdaddr), type); 1260 BT_DBG("%s key for %pMR type %u", hdev->name, bdaddr, type);
1261 1261
1262 /* Some buggy controller combinations generate a changed 1262 /* Some buggy controller combinations generate a changed
1263 * combination key for legacy pairing even when there's no 1263 * combination key for legacy pairing even when there's no
@@ -1336,7 +1336,7 @@ int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr)
1336 if (!key) 1336 if (!key)
1337 return -ENOENT; 1337 return -ENOENT;
1338 1338
1339 BT_DBG("%s removing %s", hdev->name, batostr(bdaddr)); 1339 BT_DBG("%s removing %pMR", hdev->name, bdaddr);
1340 1340
1341 list_del(&key->list); 1341 list_del(&key->list);
1342 kfree(key); 1342 kfree(key);
@@ -1352,7 +1352,7 @@ int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr)
1352 if (bacmp(bdaddr, &k->bdaddr)) 1352 if (bacmp(bdaddr, &k->bdaddr))
1353 continue; 1353 continue;
1354 1354
1355 BT_DBG("%s removing %s", hdev->name, batostr(bdaddr)); 1355 BT_DBG("%s removing %pMR", hdev->name, bdaddr);
1356 1356
1357 list_del(&k->list); 1357 list_del(&k->list);
1358 kfree(k); 1358 kfree(k);
@@ -1399,7 +1399,7 @@ int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr)
1399 if (!data) 1399 if (!data)
1400 return -ENOENT; 1400 return -ENOENT;
1401 1401
1402 BT_DBG("%s removing %s", hdev->name, batostr(bdaddr)); 1402 BT_DBG("%s removing %pMR", hdev->name, bdaddr);
1403 1403
1404 list_del(&data->list); 1404 list_del(&data->list);
1405 kfree(data); 1405 kfree(data);
@@ -1438,7 +1438,7 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
1438 memcpy(data->hash, hash, sizeof(data->hash)); 1438 memcpy(data->hash, hash, sizeof(data->hash));
1439 memcpy(data->randomizer, randomizer, sizeof(data->randomizer)); 1439 memcpy(data->randomizer, randomizer, sizeof(data->randomizer));
1440 1440
1441 BT_DBG("%s for %s", hdev->name, batostr(bdaddr)); 1441 BT_DBG("%s for %pMR", hdev->name, bdaddr);
1442 1442
1443 return 0; 1443 return 0;
1444} 1444}
@@ -2309,8 +2309,8 @@ static void hci_link_tx_to(struct hci_dev *hdev, __u8 type)
2309 /* Kill stalled connections */ 2309 /* Kill stalled connections */
2310 list_for_each_entry_rcu(c, &h->list, list) { 2310 list_for_each_entry_rcu(c, &h->list, list) {
2311 if (c->type == type && c->sent) { 2311 if (c->type == type && c->sent) {
2312 BT_ERR("%s killing stalled connection %s", 2312 BT_ERR("%s killing stalled connection %pMR",
2313 hdev->name, batostr(&c->dst)); 2313 hdev->name, &c->dst);
2314 hci_acl_disconn(c, HCI_ERROR_REMOTE_USER_TERM); 2314 hci_acl_disconn(c, HCI_ERROR_REMOTE_USER_TERM);
2315 } 2315 }
2316 } 2316 }
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 2551c4b9d65..3151d858173 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1266,7 +1266,7 @@ static void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
1266 1266
1267 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); 1267 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
1268 1268
1269 BT_DBG("%s bdaddr %s hcon %p", hdev->name, batostr(&cp->bdaddr), conn); 1269 BT_DBG("%s bdaddr %pMR hcon %p", hdev->name, &cp->bdaddr, conn);
1270 1270
1271 if (status) { 1271 if (status) {
1272 if (conn && conn->state == BT_CONNECT) { 1272 if (conn && conn->state == BT_CONNECT) {
@@ -1695,8 +1695,7 @@ static void hci_cs_le_create_conn(struct hci_dev *hdev, __u8 status)
1695 return; 1695 return;
1696 } 1696 }
1697 1697
1698 BT_DBG("%s bdaddr %s conn %p", hdev->name, batostr(&conn->dst), 1698 BT_DBG("%s bdaddr %pMR conn %p", hdev->name, &conn->dst, conn);
1699 conn);
1700 1699
1701 conn->state = BT_CLOSED; 1700 conn->state = BT_CLOSED;
1702 mgmt_connect_failed(hdev, &conn->dst, conn->type, 1701 mgmt_connect_failed(hdev, &conn->dst, conn->type,
@@ -1910,7 +1909,7 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
1910 struct hci_ev_conn_request *ev = (void *) skb->data; 1909 struct hci_ev_conn_request *ev = (void *) skb->data;
1911 int mask = hdev->link_mode; 1910 int mask = hdev->link_mode;
1912 1911
1913 BT_DBG("%s bdaddr %s type 0x%x", hdev->name, batostr(&ev->bdaddr), 1912 BT_DBG("%s bdaddr %pMR type 0x%x", hdev->name, &ev->bdaddr,
1914 ev->link_type); 1913 ev->link_type);
1915 1914
1916 mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type); 1915 mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type);
@@ -2809,13 +2808,13 @@ static void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
2809 2808
2810 key = hci_find_link_key(hdev, &ev->bdaddr); 2809 key = hci_find_link_key(hdev, &ev->bdaddr);
2811 if (!key) { 2810 if (!key) {
2812 BT_DBG("%s link key not found for %s", hdev->name, 2811 BT_DBG("%s link key not found for %pMR", hdev->name,
2813 batostr(&ev->bdaddr)); 2812 &ev->bdaddr);
2814 goto not_found; 2813 goto not_found;
2815 } 2814 }
2816 2815
2817 BT_DBG("%s found key type %u for %s", hdev->name, key->type, 2816 BT_DBG("%s found key type %u for %pMR", hdev->name, key->type,
2818 batostr(&ev->bdaddr)); 2817 &ev->bdaddr);
2819 2818
2820 if (!test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags) && 2819 if (!test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags) &&
2821 key->type == HCI_LK_DEBUG_COMBINATION) { 2820 key->type == HCI_LK_DEBUG_COMBINATION) {
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index a347522b214..bb42d95f4f4 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1471,7 +1471,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
1471 __u8 auth_type; 1471 __u8 auth_type;
1472 int err; 1472 int err;
1473 1473
1474 BT_DBG("%s -> %s (type %u) psm 0x%2.2x", batostr(src), batostr(dst), 1474 BT_DBG("%pMR -> %pMR (type %u) psm 0x%2.2x", src, dst,
1475 dst_type, __le16_to_cpu(psm)); 1475 dst_type, __le16_to_cpu(psm));
1476 1476
1477 hdev = hci_get_route(dst, src); 1477 hdev = hci_get_route(dst, src);
@@ -5346,7 +5346,7 @@ int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr)
5346 int exact = 0, lm1 = 0, lm2 = 0; 5346 int exact = 0, lm1 = 0, lm2 = 0;
5347 struct l2cap_chan *c; 5347 struct l2cap_chan *c;
5348 5348
5349 BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); 5349 BT_DBG("hdev %s, bdaddr %pMR", hdev->name, bdaddr);
5350 5350
5351 /* Find listening sockets and check their link_mode */ 5351 /* Find listening sockets and check their link_mode */
5352 read_lock(&chan_list_lock); 5352 read_lock(&chan_list_lock);
@@ -5376,7 +5376,7 @@ void l2cap_connect_cfm(struct hci_conn *hcon, u8 status)
5376{ 5376{
5377 struct l2cap_conn *conn; 5377 struct l2cap_conn *conn;
5378 5378
5379 BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); 5379 BT_DBG("hcon %p bdaddr %pMR status %d", hcon, &hcon->dst, status);
5380 5380
5381 if (!status) { 5381 if (!status) {
5382 conn = l2cap_conn_add(hcon, status); 5382 conn = l2cap_conn_add(hcon, status);
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index c75107ef892..f6d066c442e 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -377,8 +377,8 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
377 int err = 0; 377 int err = 0;
378 u8 dlci; 378 u8 dlci;
379 379
380 BT_DBG("dlc %p state %ld %s %s channel %d", 380 BT_DBG("dlc %p state %ld %pMR -> %pMR channel %d",
381 d, d->state, batostr(src), batostr(dst), channel); 381 d, d->state, src, dst, channel);
382 382
383 if (channel < 1 || channel > 30) 383 if (channel < 1 || channel > 30)
384 return -EINVAL; 384 return -EINVAL;
@@ -676,7 +676,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
676 struct socket *sock; 676 struct socket *sock;
677 struct sock *sk; 677 struct sock *sk;
678 678
679 BT_DBG("%s %s", batostr(src), batostr(dst)); 679 BT_DBG("%pMR -> %pMR", src, dst);
680 680
681 *err = rfcomm_l2sock_create(&sock); 681 *err = rfcomm_l2sock_create(&sock);
682 if (*err < 0) 682 if (*err < 0)
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 260821a2d6e..ebd2f577e81 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -334,7 +334,7 @@ static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr
334 struct sock *sk = sock->sk; 334 struct sock *sk = sock->sk;
335 int err = 0; 335 int err = 0;
336 336
337 BT_DBG("sk %p %s", sk, batostr(&sa->rc_bdaddr)); 337 BT_DBG("sk %p %pMR", sk, &sa->rc_bdaddr);
338 338
339 if (!addr || addr->sa_family != AF_BLUETOOTH) 339 if (!addr || addr->sa_family != AF_BLUETOOTH)
340 return -EINVAL; 340 return -EINVAL;
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index cb960773c00..0e487e9fe9a 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -663,8 +663,8 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)
663 if (!dev) 663 if (!dev)
664 return -ENODEV; 664 return -ENODEV;
665 665
666 BT_DBG("dev %p dst %s channel %d opened %d", dev, batostr(&dev->dst), 666 BT_DBG("dev %p dst %pMR channel %d opened %d", dev, &dev->dst,
667 dev->channel, dev->port.count); 667 dev->channel, dev->port.count);
668 668
669 spin_lock_irqsave(&dev->port.lock, flags); 669 spin_lock_irqsave(&dev->port.lock, flags);
670 if (++dev->port.count > 1) { 670 if (++dev->port.count > 1) {
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index dc42b917aaa..347d3b95431 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -172,7 +172,7 @@ static int sco_connect(struct sock *sk)
172 struct hci_dev *hdev; 172 struct hci_dev *hdev;
173 int err, type; 173 int err, type;
174 174
175 BT_DBG("%s -> %s", batostr(src), batostr(dst)); 175 BT_DBG("%pMR -> %pMR", src, dst);
176 176
177 hdev = hci_get_route(dst, src); 177 hdev = hci_get_route(dst, src);
178 if (!hdev) 178 if (!hdev)
@@ -460,7 +460,7 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
460 struct sock *sk = sock->sk; 460 struct sock *sk = sock->sk;
461 int err = 0; 461 int err = 0;
462 462
463 BT_DBG("sk %p %s", sk, batostr(&sa->sco_bdaddr)); 463 BT_DBG("sk %p %pMR", sk, &sa->sco_bdaddr);
464 464
465 if (!addr || addr->sa_family != AF_BLUETOOTH) 465 if (!addr || addr->sa_family != AF_BLUETOOTH)
466 return -EINVAL; 466 return -EINVAL;
@@ -893,7 +893,7 @@ int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr)
893 struct hlist_node *node; 893 struct hlist_node *node;
894 int lm = 0; 894 int lm = 0;
895 895
896 BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); 896 BT_DBG("hdev %s, bdaddr %pMR", hdev->name, bdaddr);
897 897
898 /* Find listening sockets */ 898 /* Find listening sockets */
899 read_lock(&sco_sk_list.lock); 899 read_lock(&sco_sk_list.lock);
@@ -914,7 +914,7 @@ int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr)
914 914
915void sco_connect_cfm(struct hci_conn *hcon, __u8 status) 915void sco_connect_cfm(struct hci_conn *hcon, __u8 status)
916{ 916{
917 BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); 917 BT_DBG("hcon %p bdaddr %pMR status %d", hcon, &hcon->dst, status);
918 if (!status) { 918 if (!status) {
919 struct sco_conn *conn; 919 struct sco_conn *conn;
920 920