Commit c21e613f authored by Pavel Vasilyev's avatar Pavel Vasilyev Committed by Benjamin Cabé
Browse files

bluetooth: host: mark internal functions and variables as static

Mark functions and variables as static when not used outside a unit.

Signed-off-by: default avatarPavel Vasilyev <pavel.vasilyev@nordicsemi.no>
parent c8469395
Loading
Loading
Loading
Loading
+1 −1
Changes for subsys/bluetooth/host/adv.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -888,7 +888,7 @@ static void le_adv_stop_free_conn(const struct bt_le_ext_adv *adv, uint8_t statu
	}
}

int bt_le_adv_start_legacy(struct bt_le_ext_adv *adv,
static int bt_le_adv_start_legacy(struct bt_le_ext_adv *adv,
			   const struct bt_le_adv_param *param,
			   const struct bt_data *ad, size_t ad_len,
			   const struct bt_data *sd, size_t sd_len)
+7 −7
Changes for subsys/bluetooth/host/att.c: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ NET_BUF_POOL_DEFINE(prep_pool, CONFIG_BT_ATT_PREPARE_COUNT, BT_ATT_BUF_SIZE,
		    sizeof(struct bt_attr_data), NULL);
#endif /* CONFIG_BT_ATT_PREPARE_COUNT */

K_MEM_SLAB_DEFINE(req_slab, sizeof(struct bt_att_req),
K_MEM_SLAB_DEFINE_STATIC(req_slab, sizeof(struct bt_att_req),
		  CONFIG_BT_ATT_TX_COUNT, __alignof__(struct bt_att_req));

enum {
@@ -171,9 +171,9 @@ struct bt_att {
#endif /* CONFIG_BT_EATT */
};

K_MEM_SLAB_DEFINE(att_slab, sizeof(struct bt_att),
K_MEM_SLAB_DEFINE_STATIC(att_slab, sizeof(struct bt_att),
		  CONFIG_BT_MAX_CONN, __alignof__(struct bt_att));
K_MEM_SLAB_DEFINE(chan_slab, sizeof(struct bt_att_chan),
K_MEM_SLAB_DEFINE_STATIC(chan_slab, sizeof(struct bt_att_chan),
		  CONFIG_BT_MAX_CONN * ATT_CHAN_MAX,
		  __alignof__(struct bt_att_chan));
static struct bt_att_req cancel;
@@ -194,7 +194,7 @@ static k_tid_t att_handle_rsp_thread;

static struct bt_att_tx_meta_data tx_meta_data_storage[CONFIG_BT_ATT_TX_COUNT];

struct bt_att_tx_meta_data *bt_att_get_tx_meta_data(const struct net_buf *buf);
static struct bt_att_tx_meta_data *bt_att_get_tx_meta_data(const struct net_buf *buf);
static void att_on_sent_cb(struct bt_att_tx_meta_data *meta);

#if defined(CONFIG_BT_ATT_ERR_TO_STR)
@@ -289,7 +289,7 @@ NET_BUF_POOL_DEFINE(att_pool, CONFIG_BT_ATT_TX_COUNT,
		    BT_L2CAP_SDU_BUF_SIZE(BT_ATT_BUF_SIZE),
		    CONFIG_BT_CONN_TX_USER_DATA_SIZE, att_tx_destroy);

struct bt_att_tx_meta_data *bt_att_get_tx_meta_data(const struct net_buf *buf)
static struct bt_att_tx_meta_data *bt_att_get_tx_meta_data(const struct net_buf *buf)
{
	__ASSERT_NO_MSG(net_buf_pool_get(buf->pool_id) == &att_pool);

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

struct net_buf *bt_att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op);
static struct net_buf *bt_att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op);

static void att_disconnect(struct bt_att_chan *chan)
{
@@ -3064,7 +3064,7 @@ struct net_buf *bt_att_create_pdu(struct bt_conn *conn, uint8_t op, size_t len)
	return NULL;
}

struct net_buf *bt_att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op)
static struct net_buf *bt_att_create_rsp_pdu(struct bt_att_chan *chan, uint8_t op)
{
	size_t headroom;
	struct bt_att_hdr *hdr;
+6 −6
Changes for subsys/bluetooth/host/conn.c: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ static struct bt_conn sco_conns[CONFIG_BT_MAX_SCO_CONN];
#endif /* CONFIG_BT_CONN */

#if defined(CONFIG_BT_CONN_TX)
void frag_destroy(struct net_buf *buf);
static void frag_destroy(struct net_buf *buf);

/* Storage for fragments (views) into the upper layers' PDUs. */
/* TODO: remove user-data requirements */
@@ -147,14 +147,14 @@ NET_BUF_POOL_FIXED_DEFINE(fragments, CONFIG_BT_CONN_FRAG_COUNT, 0,
struct frag_md {
	struct bt_buf_view_meta view_meta;
};
struct frag_md frag_md_pool[CONFIG_BT_CONN_FRAG_COUNT];
static struct frag_md frag_md_pool[CONFIG_BT_CONN_FRAG_COUNT];

struct frag_md *get_frag_md(struct net_buf *fragment)
static struct frag_md *get_frag_md(struct net_buf *fragment)
{
	return &frag_md_pool[net_buf_id(fragment)];
}

void frag_destroy(struct net_buf *frag)
static void frag_destroy(struct net_buf *frag)
{
	/* allow next view to be allocated (and unlock the parent buf) */
	bt_buf_destroy_view(frag, &get_frag_md(frag)->view_meta);
@@ -935,7 +935,7 @@ __maybe_unused static bool dont_have_methods(struct bt_conn *conn)
		(conn->has_data == NULL);
}

struct bt_conn *get_conn_ready(void)
static struct bt_conn *get_conn_ready(void)
{
	struct bt_conn *conn, *tmp;
	sys_snode_t *prev = NULL;
@@ -1125,7 +1125,7 @@ static void process_unack_tx(struct bt_conn *conn)
	}
}

struct bt_conn *conn_lookup_handle(struct bt_conn *conns, size_t size,
static struct bt_conn *conn_lookup_handle(struct bt_conn *conns, size_t size,
					  uint16_t handle)
{
	int i;
+14 −1
Changes for subsys/bluetooth/host/gatt.c: 14 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -1117,6 +1117,19 @@ static bool is_host_managed_ccc(const struct bt_gatt_attr *attr)
	return (attr->write == bt_gatt_attr_write_ccc);
}

#if defined(CONFIG_BT_SETTINGS)
static int bt_gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr);
#else
static int bt_gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr)
{
	/* This function shall never be used without CONFIG_BT_SETTINGS. */
	__ASSERT_NO_MSG(false);

	return -ENOTSUP;
}
#endif /* CONFIG_BT_SETTINGS */


#if defined(CONFIG_BT_SETTINGS) && defined(CONFIG_BT_SMP)
/** Struct used to store both the id and the random address of a device when replacing
 * random addresses in the ccc attribute's cfg array with the device's id address after
@@ -6153,7 +6166,7 @@ static uint8_t ccc_save(const struct bt_gatt_attr *attr, uint16_t handle,
	return BT_GATT_ITER_CONTINUE;
}

int bt_gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr)
static int bt_gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr)
{
	struct ccc_save save;
	size_t len;
+0 −2
Changes for subsys/bluetooth/host/gatt_internal.h: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -43,8 +43,6 @@ void bt_gatt_disconnected(struct bt_conn *conn);

bool bt_gatt_change_aware(struct bt_conn *conn, bool req);

int bt_gatt_store_ccc(uint8_t id, const bt_addr_le_t *addr);

int bt_gatt_clear(uint8_t id, const bt_addr_le_t *addr);

#if defined(CONFIG_BT_GATT_CLIENT)
Loading