diff options
author | Michał Narajowski <michal.narajowski@codecoup.pl> | 2016-10-05 12:28:27 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-10-06 11:52:29 +0200 |
commit | 1b422066658b7cc985fa020066b72d28159d858f (patch) | |
tree | 3a09eedeb83122cfaefcaa5a17fc41d3f0205261 /net/bluetooth/mgmt.c | |
parent | Bluetooth: Add appearance to default scan rsp data (diff) | |
download | linux-1b422066658b7cc985fa020066b72d28159d858f.tar.xz linux-1b422066658b7cc985fa020066b72d28159d858f.zip |
Bluetooth: Refactor append name and appearance
Use eir_append_data to remove code duplication.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 19b8a5e9420d..736038085feb 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -867,27 +867,6 @@ static int read_controller_info(struct sock *sk, struct hci_dev *hdev, sizeof(rp)); } -static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data, - u8 data_len) -{ - eir[eir_len++] = sizeof(type) + data_len; - eir[eir_len++] = type; - memcpy(&eir[eir_len], data, data_len); - eir_len += data_len; - - return eir_len; -} - -static inline u16 eir_append_le16(u8 *eir, u16 eir_len, u8 type, u16 data) -{ - eir[eir_len++] = sizeof(type) + sizeof(data); - eir[eir_len++] = type; - put_unaligned_le16(data, &eir[eir_len]); - eir_len += sizeof(data); - - return eir_len; -} - static u16 append_eir_data_to_buf(struct hci_dev *hdev, u8 *eir) { u16 eir_len = 0; |