Skip to contentSkip to conversation

Bluetooth: Fix bogus __le16_to_cpu call

PATCH In review Johan Hedberg 1 participant 2 messages Mar 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Fix bogus __le16_to_cpu call

From: Johan Hedberg <[email protected]>

The type member of struct hci_rp_read_page_scan_type is u8 so no byte order conversion is necessary for it. This patch removes a bogus call to __le16_to_cpu on it.

---
 net/bluetooth/hci_event.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_event.c +1 -1
index 8a1f511..1385807 100644
@@ -641,7 +641,7 @@ static void hci_cc_read_page_scan_type(struct hci_dev *hdev,
 	BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
 
 	if (test_bit(HCI_INIT, &hdev->flags) && !rp->status)
-		hdev->page_scan_type = __le16_to_cpu(rp->type);
+		hdev->page_scan_type = rp->type;
 }
 
 static void hci_cc_write_page_scan_type(struct hci_dev *hdev,
Signature · 1 line
1.7.10.4
#1 lore raw

Hi,

Quoted 14 lines · Johan Hedberg

The type member of struct hci_rp_read_page_scan_type is u8 so no byte order conversion is necessary for it. This patch removes a bogus call to __le16_to_cpu on it.

---
 net/bluetooth/hci_event.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_event.c +0 -0
index 8a1f511..1385807 100644

net/bluetooth/hci_event.c static void hci_cc_read_page_scan_type(struct hci_dev *hdev, · line 647

Quoted 8 lines
net/bluetooth/hci_event.c +1 -1
@@ -641,7 +641,7 @@ static void hci_cc_read_page_scan_type(struct hci_dev *hdev,
 	BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
 
 	if (test_bit(HCI_INIT, &hdev->flags) && !rp->status)
-		hdev->page_scan_type = __le16_to_cpu(rp->type);
+		hdev->page_scan_type = rp->type;
 }
 
 static void hci_cc_write_page_scan_type(struct hci_dev *hdev,

Just ignore this one. I should have checked for new emails on linux-bluetooth before creating it since this was already taken care of.

Johan