summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann2013-10-19 18:31:59 +0200
committerJohan Hedberg2013-10-19 19:46:12 +0200
commit58f01aa93ff590ddd6a77cde41c25b6022d93769 (patch)
treee7bb51d28951d744dc3c2c3718aed814bc69b12b /net/bluetooth/hci_core.c
parentBluetooth: Add support for setting DUT mode (diff)
downloadkernel-qcow2-linux-58f01aa93ff590ddd6a77cde41c25b6022d93769.tar.gz
kernel-qcow2-linux-58f01aa93ff590ddd6a77cde41c25b6022d93769.tar.xz
kernel-qcow2-linux-58f01aa93ff590ddd6a77cde41c25b6022d93769.zip
Bluetooth: Fix UUID values in debugfs file
The uuid entry struct is used for the UUID byte stream. That is actually the wrong value. The correct value is uuid->uuid. Besides fixing this up, use the %pUb modifier to print the UUID string. However since the UUID is stored in big endian with reversed byte order, change the byte order before printing. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index b5c8cb3c96d2..c5fb3a3a6a13 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -193,18 +193,16 @@ static int uuids_show(struct seq_file *f, void *p)
hci_dev_lock(hdev);
list_for_each_entry(uuid, &hdev->uuids, list) {
- u32 data0, data5;
- u16 data1, data2, data3, data4;
-
- data5 = get_unaligned_le32(uuid);
- data4 = get_unaligned_le16(uuid + 4);
- data3 = get_unaligned_le16(uuid + 6);
- data2 = get_unaligned_le16(uuid + 8);
- data1 = get_unaligned_le16(uuid + 10);
- data0 = get_unaligned_le32(uuid + 12);
-
- seq_printf(f, "%.8x-%.4x-%.4x-%.4x-%.4x%.8x\n",
- data0, data1, data2, data3, data4, data5);
+ u8 i, val[16];
+
+ /* The Bluetooth UUID values are stored in big endian,
+ * but with reversed byte order. So convert them into
+ * the right order for the %pUb modifier.
+ */
+ for (i = 0; i < 16; i++)
+ val[i] = uuid->uuid[15 - i];
+
+ seq_printf(f, "%pUb\n", val);
}
hci_dev_unlock(hdev);