diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-01-10 03:06:29 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-01-10 13:32:35 -0500 |
commit | 52e0b011e29f36bc5c02ea3adbf4d864a38373de (patch) | |
tree | 343cb23579f06f2feeb77c0bf6c847abb9a2c29a /net/bluetooth | |
parent | a1d704509d5b96756d3d4cfb7f10a555efeadb87 (diff) |
Bluetooth: Fix uuid output in debugfs
The uuid should be printed in the CPU endianness and not in little-endian.
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_sysfs.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index 55cceee02a84..23b4e242a31a 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | #include <linux/debugfs.h> | 3 | #include <linux/debugfs.h> |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <asm/unaligned.h> | ||
5 | 6 | ||
6 | #include <net/bluetooth/bluetooth.h> | 7 | #include <net/bluetooth/bluetooth.h> |
7 | #include <net/bluetooth/hci_core.h> | 8 | #include <net/bluetooth/hci_core.h> |
@@ -461,19 +462,18 @@ static const struct file_operations blacklist_fops = { | |||
461 | 462 | ||
462 | static void print_bt_uuid(struct seq_file *f, u8 *uuid) | 463 | static void print_bt_uuid(struct seq_file *f, u8 *uuid) |
463 | { | 464 | { |
464 | __be32 data0, data4; | 465 | u32 data0, data5; |
465 | __be16 data1, data2, data3, data5; | 466 | u16 data1, data2, data3, data4; |
466 | 467 | ||
467 | memcpy(&data0, &uuid[0], 4); | 468 | data5 = get_unaligned_le32(uuid); |
468 | memcpy(&data1, &uuid[4], 2); | 469 | data4 = get_unaligned_le16(uuid + 4); |
469 | memcpy(&data2, &uuid[6], 2); | 470 | data3 = get_unaligned_le16(uuid + 6); |
470 | memcpy(&data3, &uuid[8], 2); | 471 | data2 = get_unaligned_le16(uuid + 8); |
471 | memcpy(&data4, &uuid[10], 4); | 472 | data1 = get_unaligned_le16(uuid + 10); |
472 | memcpy(&data5, &uuid[14], 2); | 473 | data0 = get_unaligned_le32(uuid + 12); |
473 | 474 | ||
474 | seq_printf(f, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x\n", | 475 | seq_printf(f, "%.8x-%.4x-%.4x-%.4x-%.4x%.8x\n", |
475 | ntohl(data0), ntohs(data1), ntohs(data2), ntohs(data3), | 476 | data0, data1, data2, data3, data4, data5); |
476 | ntohl(data4), ntohs(data5)); | ||
477 | } | 477 | } |
478 | 478 | ||
479 | static int uuids_show(struct seq_file *f, void *p) | 479 | static int uuids_show(struct seq_file *f, void *p) |