diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-09-25 05:49:44 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-09-27 17:10:15 -0400 |
commit | fcb73338ed531dcc00cb17ca76fe3e05f774e4e9 (patch) | |
tree | 80598b5be53f9187cd290982012822d5666bc194 /net/bluetooth/hci_sysfs.c | |
parent | 6ed93dc6427d14cdfe0b272cc0a9ee4685ce9ad7 (diff) |
Bluetooth: Use %pMR in sprintf/seq_printf instead of batostr
Instead of old unsafe batostr function use %pMR print specifier
for printing Bluetooth addresses in sprintf and seq_printf
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>
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r-- | net/bluetooth/hci_sysfs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index a20e61c3653d..55cceee02a84 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c | |||
@@ -38,7 +38,7 @@ static ssize_t show_link_address(struct device *dev, | |||
38 | struct device_attribute *attr, char *buf) | 38 | struct device_attribute *attr, char *buf) |
39 | { | 39 | { |
40 | struct hci_conn *conn = to_hci_conn(dev); | 40 | struct hci_conn *conn = to_hci_conn(dev); |
41 | return sprintf(buf, "%s\n", batostr(&conn->dst)); | 41 | return sprintf(buf, "%pMR\n", &conn->dst); |
42 | } | 42 | } |
43 | 43 | ||
44 | static ssize_t show_link_features(struct device *dev, | 44 | static ssize_t show_link_features(struct device *dev, |
@@ -224,7 +224,7 @@ static ssize_t show_address(struct device *dev, | |||
224 | struct device_attribute *attr, char *buf) | 224 | struct device_attribute *attr, char *buf) |
225 | { | 225 | { |
226 | struct hci_dev *hdev = to_hci_dev(dev); | 226 | struct hci_dev *hdev = to_hci_dev(dev); |
227 | return sprintf(buf, "%s\n", batostr(&hdev->bdaddr)); | 227 | return sprintf(buf, "%pMR\n", &hdev->bdaddr); |
228 | } | 228 | } |
229 | 229 | ||
230 | static ssize_t show_features(struct device *dev, | 230 | static ssize_t show_features(struct device *dev, |
@@ -406,8 +406,8 @@ static int inquiry_cache_show(struct seq_file *f, void *p) | |||
406 | 406 | ||
407 | list_for_each_entry(e, &cache->all, all) { | 407 | list_for_each_entry(e, &cache->all, all) { |
408 | struct inquiry_data *data = &e->data; | 408 | struct inquiry_data *data = &e->data; |
409 | seq_printf(f, "%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x %d %d %u\n", | 409 | seq_printf(f, "%pMR %d %d %d 0x%.2x%.2x%.2x 0x%.4x %d %d %u\n", |
410 | batostr(&data->bdaddr), | 410 | &data->bdaddr, |
411 | data->pscan_rep_mode, data->pscan_period_mode, | 411 | data->pscan_rep_mode, data->pscan_period_mode, |
412 | data->pscan_mode, data->dev_class[2], | 412 | data->pscan_mode, data->dev_class[2], |
413 | data->dev_class[1], data->dev_class[0], | 413 | data->dev_class[1], data->dev_class[0], |
@@ -440,7 +440,7 @@ static int blacklist_show(struct seq_file *f, void *p) | |||
440 | hci_dev_lock(hdev); | 440 | hci_dev_lock(hdev); |
441 | 441 | ||
442 | list_for_each_entry(b, &hdev->blacklist, list) | 442 | list_for_each_entry(b, &hdev->blacklist, list) |
443 | seq_printf(f, "%s\n", batostr(&b->bdaddr)); | 443 | seq_printf(f, "%pMR\n", &b->bdaddr); |
444 | 444 | ||
445 | hci_dev_unlock(hdev); | 445 | hci_dev_unlock(hdev); |
446 | 446 | ||