Skip to contentSkip to conversation

Bluetooth: remove __le16_to_cpu() from u8 var

PATCH In review Gustavo Padovan 2 participants 3 messages Mar 18, 2013

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

PATCH 1/1 Bluetooth: remove __le16_to_cpu() from u8 var

From: Gustavo Padovan <[email protected]>

We don't any endianness conversion in a single byte variable.

---
 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.8.1.4
maintainer
#1 lore raw

Hi Gustavo,

Quoted 12 lines

We don't any endianness conversion in a single byte variable.

---
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 645

Quoted 6 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;
 }

we could also just fix up the patch with this mistake. Since it has not gotten into wireless-next yet.

Regards

Marcel

#2 lore raw

Hi Marcel,

Quoted 16 lines · Marcel Holtmann

Hi Gustavo,

Quoted 14 lines

We don't any endianness conversion in a single byte variable.

---
net/bluetooth/hci_event.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_event.c +0 -0
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);
 
Quoted 6 lines

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

Quoted 4 lines
net/bluetooth/hci_event.c +1 -1
 	if (test_bit(HCI_INIT, &hdev->flags) && !rp->status)
-		hdev->page_scan_type = __le16_to_cpu(rp->type);
+		hdev->page_scan_type = rp->type;
 }

we could also just fix up the patch with this mistake. Since it has not gotten into wireless-next yet.

Yes, the broken patch is now fixed in bluetooth-next.

Gustavo