Skip to contentSkip to conversation

Bluetooth: Move eir_append_data() function into mgmt.c

PATCH Applied Marcel Holtmann 2 participants 2 messages Oct 15, 2013

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Move eir_append_data() function into mgmt.c

The eir_append_data() function is only used from mgmt.c and so instead of having a public function move it to the location where it is used.

---
 include/net/bluetooth/hci_core.h | 11 -----------
 net/bluetooth/mgmt.c             | 11 +++++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)
include/net/bluetooth/hci_core.h +0 -11
index cf6be04..42591a4 100644
@@ -1026,17 +1026,6 @@ static inline size_t eir_get_length(u8 *eir, size_t eir_len)
 	return eir_len;
 }
 
-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;
-}
-
 int hci_register_cb(struct hci_cb *hcb);
 int hci_unregister_cb(struct hci_cb *hcb);
 
net/bluetooth/mgmt.c +11 -0
index 6fb302e..292e81f 100644
@@ -4381,6 +4381,17 @@ int mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent)
 			  NULL);
 }
 
+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;
+}
+
 void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 			   u8 addr_type, u32 flags, u8 *name, u8 name_len,
 			   u8 *dev_class)
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Marcel,

Quoted 9 lines · Marcel Holtmann

The eir_append_data() function is only used from mgmt.c and so instead of having a public function move it to the location where it is used.

---
 include/net/bluetooth/hci_core.h | 11 -----------
 net/bluetooth/mgmt.c             | 11 +++++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)

Applied to bluetooth-next. Thanks.

Johan