Bluetooth: Fix checkpatch error/warnings

Fixes some checkpatch's errors/warning in HCI stack code.

Change-Id: I105fb491b5509f72549ab788764b1386ce3af47f
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
Arkadiusz Lichwa 2016-03-21 14:48:40 +01:00
commit 158cdbf91a
7 changed files with 12 additions and 11 deletions

View file

@ -1040,7 +1040,7 @@ static uint8_t att_read_group_req(struct bt_att *att, struct net_buf *buf)
if (bt_uuid_cmp(&u.uuid, BT_UUID_GATT_PRIMARY) && if (bt_uuid_cmp(&u.uuid, BT_UUID_GATT_PRIMARY) &&
bt_uuid_cmp(&u.uuid, BT_UUID_GATT_SECONDARY)) { bt_uuid_cmp(&u.uuid, BT_UUID_GATT_SECONDARY)) {
send_err_rsp(conn, BT_ATT_OP_READ_GROUP_REQ, start_handle, send_err_rsp(conn, BT_ATT_OP_READ_GROUP_REQ, start_handle,
BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE); BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE);
return 0; return 0;
} }

View file

@ -932,6 +932,7 @@ static int ssp_passkey_neg_reply(struct bt_conn *conn)
static void timeout_fiber(int arg1, int arg2) static void timeout_fiber(int arg1, int arg2)
{ {
struct bt_conn *conn = (struct bt_conn *)arg1; struct bt_conn *conn = (struct bt_conn *)arg1;
ARG_UNUSED(arg2); ARG_UNUSED(arg2);
conn->timeout = NULL; conn->timeout = NULL;
@ -977,7 +978,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state)
} }
/* Actions needed for entering the new state */ /* Actions needed for entering the new state */
switch (conn->state){ switch (conn->state) {
case BT_CONN_CONNECTED: case BT_CONN_CONNECTED:
nano_fifo_init(&conn->tx_queue); nano_fifo_init(&conn->tx_queue);
fiber_start(conn->stack, sizeof(conn->stack), conn_tx_fiber, fiber_start(conn->stack, sizeof(conn->stack), conn_tx_fiber,

View file

@ -257,7 +257,7 @@ struct bt_gatt_attr *bt_gatt_attr_next(const struct bt_gatt_attr *attr)
return attr->_next; return attr->_next;
#else #else
return ((attr < db || attr > &db[attr_count - 2]) ? NULL : return ((attr < db || attr > &db[attr_count - 2]) ? NULL :
(struct bt_gatt_attr *) &attr[1]); (struct bt_gatt_attr *)&attr[1]);
#endif /* CONFIG_BLUETOOTH_GATT_DYNAMIC_DB */ #endif /* CONFIG_BLUETOOTH_GATT_DYNAMIC_DB */
} }

View file

@ -2717,7 +2717,7 @@ static int set_ad(uint16_t hci_op, const struct bt_data *ad, size_t ad_len)
set_data->data[set_data->len++] = ad[i].type; set_data->data[set_data->len++] = ad[i].type;
memcpy(&set_data->data[set_data->len], ad[i].data, memcpy(&set_data->data[set_data->len], ad[i].data,
ad[i].data_len); ad[i].data_len);
set_data->len += ad[i].data_len; set_data->len += ad[i].data_len;
} }

View file

@ -116,7 +116,7 @@ static inline bool bt_addr_le_is_rpa(const bt_addr_le_t *addr)
return false; return false;
if ((addr->val[5] & 0xc0) == 0x40) if ((addr->val[5] & 0xc0) == 0x40)
return true; return true;
return false; return false;
} }
@ -134,7 +134,7 @@ static inline bool bt_addr_le_is_identity(const bt_addr_le_t *addr)
} }
static inline bool bt_le_conn_params_valid(uint16_t min, uint16_t max, static inline bool bt_le_conn_params_valid(uint16_t min, uint16_t max,
uint16_t latency, uint16_t timeout) uint16_t latency, uint16_t timeout)
{ {
if (min > max || min < 6 || max > 3200) { if (min > max || min < 6 || max > 3200) {
return false; return false;

View file

@ -82,7 +82,7 @@ struct bt_keys *bt_keys_find(int type, const bt_addr_le_t *addr)
for (i = 0; i < ARRAY_SIZE(key_pool); i++) { for (i = 0; i < ARRAY_SIZE(key_pool); i++) {
if ((key_pool[i].keys & type) && if ((key_pool[i].keys & type) &&
!bt_addr_le_cmp(&key_pool[i].addr, addr)) { !bt_addr_le_cmp(&key_pool[i].addr, addr)) {
return &key_pool[i]; return &key_pool[i];
} }
} }

View file

@ -596,6 +596,7 @@ static void smp_reset(struct bt_smp *smp)
static void smp_timeout(int arg1, int arg2) static void smp_timeout(int arg1, int arg2)
{ {
struct bt_smp *smp = (struct bt_smp *)arg1; struct bt_smp *smp = (struct bt_smp *)arg1;
ARG_UNUSED(arg2); ARG_UNUSED(arg2);
BT_ERR("SMP Timeout"); BT_ERR("SMP Timeout");
@ -623,7 +624,7 @@ static void smp_restart_timer(struct bt_smp *smp)
} }
smp->timeout = fiber_delayed_start(smp->stack, sizeof(smp->stack), smp->timeout = fiber_delayed_start(smp->stack, sizeof(smp->stack),
smp_timeout, (int) smp, 0, 7, 0, smp_timeout, (int)smp, 0, 7, 0,
SMP_TIMEOUT); SMP_TIMEOUT);
} }
@ -1182,7 +1183,6 @@ static uint8_t smp_encrypt_info(struct bt_smp *smp, struct net_buf *buf)
memcpy(keys->ltk.val, req->ltk, 16); memcpy(keys->ltk.val, req->ltk, 16);
} }
atomic_set_bit(&smp->allowed_cmds, BT_SMP_CMD_MASTER_IDENT); atomic_set_bit(&smp->allowed_cmds, BT_SMP_CMD_MASTER_IDENT);
return 0; return 0;
@ -2733,7 +2733,7 @@ int bt_smp_sign_verify(struct bt_conn *conn, struct net_buf *buf)
h(keys->remote_csrk.val, 16), keys->remote_csrk.cnt); h(keys->remote_csrk.val, 16), keys->remote_csrk.cnt);
err = smp_sign_buf(keys->remote_csrk.val, buf->data, err = smp_sign_buf(keys->remote_csrk.val, buf->data,
buf->len - sizeof(sig)); buf->len - sizeof(sig));
if (err) { if (err) {
BT_ERR("Unable to create signature for %s", BT_ERR("Unable to create signature for %s",
bt_addr_le_str(&conn->le.dst)); bt_addr_le_str(&conn->le.dst));
@ -2880,7 +2880,7 @@ static int smp_aes_cmac_test(void)
} }
static int sign_test(const char *prefix, const uint8_t *key, const uint8_t *m, static int sign_test(const char *prefix, const uint8_t *key, const uint8_t *m,
uint16_t len, const uint8_t *sig) uint16_t len, const uint8_t *sig)
{ {
uint8_t msg[len + sizeof(uint32_t) + 8]; uint8_t msg[len + sizeof(uint32_t) + 8];
uint8_t orig[len + sizeof(uint32_t) + 8]; uint8_t orig[len + sizeof(uint32_t) + 8];