Commit e95beb41 authored by Andre Guedes's avatar Andre Guedes Committed by Gustavo F. Padovan

Bluetooth: hci_le_adv_report_evt code refactoring

There is no reason to treat the first advertising entry differently
from the potential other ones. Besides, the current implementation
can easily leads to typos.
Signed-off-by: default avatarAndre Guedes <andre.guedes@openbossa.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent b6f98044
...@@ -2838,19 +2838,17 @@ static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff ...@@ -2838,19 +2838,17 @@ static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff
static inline void hci_le_adv_report_evt(struct hci_dev *hdev, static inline void hci_le_adv_report_evt(struct hci_dev *hdev,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct hci_ev_le_advertising_info *ev; u8 num_reports = skb->data[0];
u8 num_reports; void *ptr = &skb->data[1];
num_reports = skb->data[0];
ev = (void *) &skb->data[1];
hci_dev_lock(hdev); hci_dev_lock(hdev);
hci_add_adv_entry(hdev, ev); while (num_reports--) {
struct hci_ev_le_advertising_info *ev = ptr;
while (--num_reports) {
ev = (void *) (ev->data + ev->length + 1);
hci_add_adv_entry(hdev, ev); hci_add_adv_entry(hdev, ev);
ptr += sizeof(*ev) + ev->length + 1;
} }
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment