Skip to content

Commit 50928fc

Browse files
PavelVPVkartben
authored andcommitted
bluetooth: host: remove bt_ prefix from internal functions
Remove the bt_ prefix from internal functions to avoid confusion when reading code. Signed-off-by: Pavel Vasilyev <[email protected]>
1 parent dfe05dd commit 50928fc

File tree

4 files changed

+59
-61
lines changed

4 files changed

+59
-61
lines changed

subsys/bluetooth/host/adv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ static void le_adv_stop_free_conn(const struct bt_le_ext_adv *adv, uint8_t statu
888888
}
889889
}
890890

891-
static int bt_le_adv_start_legacy(struct bt_le_ext_adv *adv,
891+
static int adv_start_legacy(struct bt_le_ext_adv *adv,
892892
const struct bt_le_adv_param *param,
893893
const struct bt_data *ad, size_t ad_len,
894894
const struct bt_data *sd, size_t sd_len)
@@ -1309,7 +1309,7 @@ int bt_le_adv_start(const struct bt_le_adv_param *param,
13091309
BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) {
13101310
err = bt_le_adv_start_ext(adv, param, ad, ad_len, sd, sd_len);
13111311
} else {
1312-
err = bt_le_adv_start_legacy(adv, param, ad, ad_len, sd, sd_len);
1312+
err = adv_start_legacy(adv, param, ad, ad_len, sd, sd_len);
13131313
}
13141314

13151315
if (err) {

subsys/bluetooth/host/att.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static k_tid_t att_handle_rsp_thread;
194194

195195
static struct bt_att_tx_meta_data tx_meta_data_storage[CONFIG_BT_ATT_TX_COUNT];
196196

197-
static struct bt_att_tx_meta_data *bt_att_get_tx_meta_data(const struct net_buf *buf);
197+
static struct bt_att_tx_meta_data *att_get_tx_meta_data(const struct net_buf *buf);
198198
static void att_on_sent_cb(struct bt_att_tx_meta_data *meta);
199199

200200
#if defined(CONFIG_BT_ATT_ERR_TO_STR)
@@ -255,7 +255,7 @@ const char *bt_att_err_to_str(uint8_t att_err)
255255

256256
static void att_tx_destroy(struct net_buf *buf)
257257
{
258-
struct bt_att_tx_meta_data *p_meta = bt_att_get_tx_meta_data(buf);
258+
struct bt_att_tx_meta_data *p_meta = att_get_tx_meta_data(buf);
259259
struct bt_att_tx_meta_data meta;
260260

261261
LOG_DBG("%p", buf);
@@ -289,7 +289,7 @@ NET_BUF_POOL_DEFINE(att_pool, CONFIG_BT_ATT_TX_COUNT,
289289
BT_L2CAP_SDU_BUF_SIZE(BT_ATT_BUF_SIZE),
290290
CONFIG_BT_CONN_TX_USER_DATA_SIZE, att_tx_destroy);
291291

292-
static struct bt_att_tx_meta_data *bt_att_get_tx_meta_data(const struct net_buf *buf)
292+
static struct bt_att_tx_meta_data *att_get_tx_meta_data(const struct net_buf *buf)
293293
{
294294
__ASSERT_NO_MSG(net_buf_pool_get(buf->pool_id) == &att_pool);
295295

@@ -304,7 +304,7 @@ static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf);
304304
static void att_chan_mtu_updated(struct bt_att_chan *updated_chan);
305305
static void bt_att_disconnected(struct bt_l2cap_chan *chan);
306306

307-
static struct net_buf *bt_att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op);
307+
static struct net_buf *att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op);
308308

309309
static void att_disconnect(struct bt_att_chan *chan)
310310
{
@@ -340,7 +340,7 @@ static int chan_send(struct bt_att_chan *chan, struct net_buf *buf)
340340
struct bt_att_hdr *hdr;
341341
struct net_buf_simple_state state;
342342
int err;
343-
struct bt_att_tx_meta_data *data = bt_att_get_tx_meta_data(buf);
343+
struct bt_att_tx_meta_data *data = att_get_tx_meta_data(buf);
344344
struct bt_att_chan *prev_chan = data->att_chan;
345345

346346
hdr = (void *)buf->data;
@@ -461,7 +461,7 @@ static struct net_buf *get_first_buf_matching_chan(struct k_fifo *fifo, struct b
461461
k_fifo_init(&skipped);
462462

463463
while ((buf = k_fifo_get(fifo, K_NO_WAIT))) {
464-
meta = bt_att_get_tx_meta_data(buf);
464+
meta = att_get_tx_meta_data(buf);
465465
if (!ret &&
466466
att_chan_matches_chan_opt(chan, meta->chan_opt)) {
467467
ret = buf;
@@ -491,7 +491,7 @@ static struct bt_att_req *get_first_req_matching_chan(sys_slist_t *reqs, struct
491491
struct bt_att_tx_meta_data *meta = NULL;
492492

493493
SYS_SLIST_FOR_EACH_NODE(reqs, curr) {
494-
meta = bt_att_get_tx_meta_data(ATT_REQ(curr)->buf);
494+
meta = att_get_tx_meta_data(ATT_REQ(curr)->buf);
495495
if (att_chan_matches_chan_opt(chan, meta->chan_opt)) {
496496
break;
497497
}
@@ -755,7 +755,7 @@ static struct net_buf *bt_att_chan_create_pdu(struct bt_att_chan *chan, uint8_t
755755
/* If we got a buf from `att_pool`, then the metadata slot at its index
756756
* is officially ours to use.
757757
*/
758-
data = bt_att_get_tx_meta_data(buf);
758+
data = att_get_tx_meta_data(buf);
759759

760760
if (IS_ENABLED(CONFIG_BT_EATT)) {
761761
net_buf_reserve(buf, BT_L2CAP_SDU_BUF_SIZE(0));
@@ -775,7 +775,7 @@ static int bt_att_chan_send(struct bt_att_chan *chan, struct net_buf *buf)
775775
((struct bt_att_hdr *)buf->data)->code);
776776

777777
if (IS_ENABLED(CONFIG_BT_EATT) &&
778-
!att_chan_matches_chan_opt(chan, bt_att_get_tx_meta_data(buf)->chan_opt)) {
778+
!att_chan_matches_chan_opt(chan, att_get_tx_meta_data(buf)->chan_opt)) {
779779
return -EINVAL;
780780
}
781781

@@ -867,7 +867,7 @@ static uint8_t att_mtu_req(struct bt_att_chan *chan, struct net_buf *buf)
867867
return BT_ATT_ERR_INVALID_PDU;
868868
}
869869

870-
pdu = bt_att_create_rsp_pdu(chan, BT_ATT_OP_MTU_RSP);
870+
pdu = att_create_rsp_pdu(chan, BT_ATT_OP_MTU_RSP);
871871
if (!pdu) {
872872
return BT_ATT_ERR_UNLIKELY;
873873
}
@@ -1107,7 +1107,7 @@ static uint8_t att_find_info_rsp(struct bt_att_chan *chan, uint16_t start_handle
11071107

11081108
(void)memset(&data, 0, sizeof(data));
11091109

1110-
data.buf = bt_att_create_rsp_pdu(chan, BT_ATT_OP_FIND_INFO_RSP);
1110+
data.buf = att_create_rsp_pdu(chan, BT_ATT_OP_FIND_INFO_RSP);
11111111
if (!data.buf) {
11121112
return BT_ATT_ERR_INSUFFICIENT_RESOURCES;
11131113
}
@@ -1261,7 +1261,7 @@ static uint8_t att_find_type_rsp(struct bt_att_chan *chan, uint16_t start_handle
12611261

12621262
(void)memset(&data, 0, sizeof(data));
12631263

1264-
data.buf = bt_att_create_rsp_pdu(chan, BT_ATT_OP_FIND_TYPE_RSP);
1264+
data.buf = att_create_rsp_pdu(chan, BT_ATT_OP_FIND_TYPE_RSP);
12651265
if (!data.buf) {
12661266
return BT_ATT_ERR_INSUFFICIENT_RESOURCES;
12671267
}
@@ -1511,7 +1511,7 @@ static uint8_t att_read_type_rsp(struct bt_att_chan *chan, struct bt_uuid *uuid,
15111511

15121512
(void)memset(&data, 0, sizeof(data));
15131513

1514-
data.buf = bt_att_create_rsp_pdu(chan, BT_ATT_OP_READ_TYPE_RSP);
1514+
data.buf = att_create_rsp_pdu(chan, BT_ATT_OP_READ_TYPE_RSP);
15151515
if (!data.buf) {
15161516
return BT_ATT_ERR_INSUFFICIENT_RESOURCES;
15171517
}
@@ -1663,7 +1663,7 @@ static uint8_t att_read_rsp(struct bt_att_chan *chan, uint8_t op, uint8_t rsp,
16631663

16641664
(void)memset(&data, 0, sizeof(data));
16651665

1666-
data.buf = bt_att_create_rsp_pdu(chan, rsp);
1666+
data.buf = att_create_rsp_pdu(chan, rsp);
16671667
if (!data.buf) {
16681668
return BT_ATT_ERR_INSUFFICIENT_RESOURCES;
16691669
}
@@ -1736,7 +1736,7 @@ static uint8_t att_read_mult_req(struct bt_att_chan *chan, struct net_buf *buf)
17361736

17371737
(void)memset(&data, 0, sizeof(data));
17381738

1739-
data.buf = bt_att_create_rsp_pdu(chan, BT_ATT_OP_READ_MULT_RSP);
1739+
data.buf = att_create_rsp_pdu(chan, BT_ATT_OP_READ_MULT_RSP);
17401740
if (!data.buf) {
17411741
return BT_ATT_ERR_INSUFFICIENT_RESOURCES;
17421742
}
@@ -1840,7 +1840,7 @@ static uint8_t att_read_mult_vl_req(struct bt_att_chan *chan, struct net_buf *bu
18401840

18411841
(void)memset(&data, 0, sizeof(data));
18421842

1843-
data.buf = bt_att_create_rsp_pdu(chan, BT_ATT_OP_READ_MULT_VL_RSP);
1843+
data.buf = att_create_rsp_pdu(chan, BT_ATT_OP_READ_MULT_VL_RSP);
18441844
if (!data.buf) {
18451845
return BT_ATT_ERR_INSUFFICIENT_RESOURCES;
18461846
}
@@ -1962,7 +1962,7 @@ static uint8_t att_read_group_rsp(struct bt_att_chan *chan, struct bt_uuid *uuid
19621962

19631963
(void)memset(&data, 0, sizeof(data));
19641964

1965-
data.buf = bt_att_create_rsp_pdu(chan, BT_ATT_OP_READ_GROUP_RSP);
1965+
data.buf = att_create_rsp_pdu(chan, BT_ATT_OP_READ_GROUP_RSP);
19661966
if (!data.buf) {
19671967
return BT_ATT_ERR_INSUFFICIENT_RESOURCES;
19681968
}
@@ -2276,7 +2276,7 @@ static uint8_t att_prep_write_rsp(struct bt_att_chan *chan, uint16_t handle,
22762276
net_buf_slist_put(&chan->att->prep_queue, data.buf);
22772277

22782278
/* Generate response */
2279-
data.buf = bt_att_create_rsp_pdu(chan, BT_ATT_OP_PREPARE_WRITE_RSP);
2279+
data.buf = att_create_rsp_pdu(chan, BT_ATT_OP_PREPARE_WRITE_RSP);
22802280
if (!data.buf) {
22812281
return BT_ATT_ERR_INSUFFICIENT_RESOURCES;
22822282
}
@@ -2423,7 +2423,7 @@ static uint8_t att_exec_write_rsp(struct bt_att_chan *chan, uint8_t flags)
24232423
}
24242424

24252425
/* Generate response */
2426-
buf = bt_att_create_rsp_pdu(chan, BT_ATT_OP_EXEC_WRITE_RSP);
2426+
buf = att_create_rsp_pdu(chan, BT_ATT_OP_EXEC_WRITE_RSP);
24272427
if (!buf) {
24282428
return BT_ATT_ERR_UNLIKELY;
24292429
}
@@ -3064,7 +3064,7 @@ struct net_buf *bt_att_create_pdu(struct bt_conn *conn, uint8_t op, size_t len)
30643064
return NULL;
30653065
}
30663066

3067-
static struct net_buf *bt_att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op)
3067+
static struct net_buf *att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op)
30683068
{
30693069
size_t headroom;
30703070
struct bt_att_hdr *hdr;
@@ -3085,7 +3085,7 @@ static struct net_buf *bt_att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t o
30853085

30863086
net_buf_reserve(buf, headroom);
30873087

3088-
data = bt_att_get_tx_meta_data(buf);
3088+
data = att_get_tx_meta_data(buf);
30893089
data->att_chan = chan;
30903090

30913091
hdr = net_buf_add(buf, sizeof(*hdr));
@@ -4133,7 +4133,7 @@ bool bt_att_out_of_sync_sent_on_fixed(struct bt_conn *conn)
41334133
void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func, void *user_data,
41344134
enum bt_att_chan_opt chan_opt)
41354135
{
4136-
struct bt_att_tx_meta_data *data = bt_att_get_tx_meta_data(buf);
4136+
struct bt_att_tx_meta_data *data = att_get_tx_meta_data(buf);
41374137

41384138
data->func = func;
41394139
data->user_data = user_data;
@@ -4143,15 +4143,15 @@ void bt_att_set_tx_meta_data(struct net_buf *buf, bt_gatt_complete_func_t func,
41434143

41444144
void bt_att_increment_tx_meta_data_attr_count(struct net_buf *buf, uint16_t attr_count)
41454145
{
4146-
struct bt_att_tx_meta_data *data = bt_att_get_tx_meta_data(buf);
4146+
struct bt_att_tx_meta_data *data = att_get_tx_meta_data(buf);
41474147

41484148
data->attr_count += attr_count;
41494149
}
41504150

41514151
bool bt_att_tx_meta_data_match(const struct net_buf *buf, bt_gatt_complete_func_t func,
41524152
const void *user_data, enum bt_att_chan_opt chan_opt)
41534153
{
4154-
const struct bt_att_tx_meta_data *meta = bt_att_get_tx_meta_data(buf);
4154+
const struct bt_att_tx_meta_data *meta = att_get_tx_meta_data(buf);
41554155

41564156
return ((meta->func == func) &&
41574157
(meta->user_data == user_data) &&

subsys/bluetooth/host/gatt.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,9 +1118,9 @@ static bool is_host_managed_ccc(const struct bt_gatt_attr *attr)
11181118
}
11191119

11201120
#if defined(CONFIG_BT_SETTINGS)
1121-
static int bt_gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr);
1121+
static int gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr);
11221122
#else
1123-
static int bt_gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr)
1123+
static int gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr)
11241124
{
11251125
/* This function shall never be used without CONFIG_BT_SETTINGS. */
11261126
__ASSERT_NO_MSG(false);
@@ -1178,7 +1178,7 @@ static void bt_gatt_identity_resolved(struct bt_conn *conn, const bt_addr_le_t *
11781178

11791179
/* Store the ccc */
11801180
if (is_bonded) {
1181-
bt_gatt_store_ccc(conn->id, &conn->le.dst);
1181+
gatt_store_ccc(conn->id, &conn->le.dst);
11821182
}
11831183

11841184
/* Update the cf addresses and store it if we get a match */
@@ -1196,7 +1196,7 @@ static void bt_gatt_pairing_complete(struct bt_conn *conn, bool bonded)
11961196
{
11971197
if (bonded) {
11981198
/* Store the ccc and cf data */
1199-
bt_gatt_store_ccc(conn->id, &(conn->le.dst));
1199+
gatt_store_ccc(conn->id, &(conn->le.dst));
12001200
bt_gatt_store_cf(conn->id, &conn->le.dst);
12011201
}
12021202
}
@@ -1511,7 +1511,7 @@ static void gatt_store_ccc_cf(uint8_t id, const bt_addr_le_t *peer_addr)
15111511
if (!IS_ENABLED(CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE) ||
15121512
(IS_ENABLED(CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE) && el &&
15131513
atomic_test_and_clear_bit(el->flags, DELAYED_STORE_CCC))) {
1514-
bt_gatt_store_ccc(id, peer_addr);
1514+
gatt_store_ccc(id, peer_addr);
15151515
}
15161516

15171517
if (!IS_ENABLED(CONFIG_BT_SETTINGS_CF_STORE_ON_WRITE) ||
@@ -1696,7 +1696,7 @@ static void gatt_unregister_ccc(struct bt_gatt_ccc_managed_user_data *ccc)
16961696

16971697
if (IS_ENABLED(CONFIG_BT_SETTINGS) && store &&
16981698
bt_le_bond_exists(cfg->id, &cfg->peer)) {
1699-
bt_gatt_store_ccc(cfg->id, &cfg->peer);
1699+
gatt_store_ccc(cfg->id, &cfg->peer);
17001700
}
17011701

17021702
clear_ccc_cfg(cfg);
@@ -6166,7 +6166,7 @@ static uint8_t ccc_save(const struct bt_gatt_attr *attr, uint16_t handle,
61666166
return BT_GATT_ITER_CONTINUE;
61676167
}
61686168

6169-
static int bt_gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr)
6169+
static int gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr)
61706170
{
61716171
struct ccc_save save;
61726172
size_t len;

0 commit comments

Comments
 (0)