Bluetooth: Remove unnecessary bt_buf_add type casts

Now that bt_buf_add() returns 'void *' there's no need to explicitly
type cast its return value anymore.

Change-Id: I6d5c9d323dc08cb5a2b928977c1bbf3d741e5d8e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2015-05-18 10:18:21 +03:00 committed by Anas Nashif
commit 90b27c478d
4 changed files with 22 additions and 22 deletions

View file

@ -62,7 +62,7 @@ static void send_err_rsp(struct bt_conn *conn, uint8_t req, uint16_t handle,
return;
}
rsp = (void *)bt_buf_add(buf, sizeof(*rsp));
rsp = bt_buf_add(buf, sizeof(*rsp));
rsp->request = req;
rsp->handle = sys_cpu_to_le16(handle);
rsp->error = err;
@ -109,7 +109,7 @@ static void att_mtu_req(struct bt_conn *conn, struct bt_buf *data)
/* TODO: Store the MTU negotiated */
rsp = (void *)bt_buf_add(buf, sizeof(*rsp));
rsp = bt_buf_add(buf, sizeof(*rsp));
rsp->mtu = sys_cpu_to_le16(mtu);
bt_conn_send(conn, buf);
@ -578,7 +578,7 @@ struct bt_buf *bt_att_create_pdu(struct bt_conn *conn, uint8_t op, size_t len)
return NULL;
}
hdr = (void *)bt_buf_add(buf, sizeof(*hdr));
hdr = bt_buf_add(buf, sizeof(*hdr));
hdr->code = op;
return buf;

View file

@ -88,7 +88,7 @@ struct bt_buf *bt_hci_cmd_create(uint16_t opcode, uint8_t param_len)
buf->hci.opcode = opcode;
buf->hci.sync = NULL;
hdr = (void *)bt_buf_add(buf, sizeof(*hdr));
hdr = bt_buf_add(buf, sizeof(*hdr));
hdr->opcode = sys_cpu_to_le16(opcode);
hdr->param_len = param_len;
@ -617,7 +617,7 @@ static int hci_init(void)
return -ENOBUFS;
}
ev = (void *)bt_buf_add(buf, sizeof(*ev));
ev = bt_buf_add(buf, sizeof(*ev));
memset(ev, 0, sizeof(*ev));
ev->events[0] |= 0x10; /* Disconnection Complete */
ev->events[1] |= 0x08; /* Read Remote Version Information Complete */
@ -640,7 +640,7 @@ static int hci_init(void)
return -ENOBUFS;
}
hbs = (void *)bt_buf_add(buf, sizeof(*hbs));
hbs = bt_buf_add(buf, sizeof(*hbs));
memset(hbs, 0, sizeof(*hbs));
hbs->acl_mtu = sys_cpu_to_le16(BT_BUF_MAX_DATA -
sizeof(struct bt_hci_acl_hdr));
@ -658,7 +658,7 @@ static int hci_init(void)
return -ENOBUFS;
}
enable = (void *)bt_buf_add(buf, sizeof(*enable));
enable = bt_buf_add(buf, sizeof(*enable));
*enable = 0x01;
bt_hci_cmd_send(BT_HCI_OP_SET_CTL_TO_HOST_FLOW, buf);
@ -676,7 +676,7 @@ static int hci_init(void)
return -ENOBUFS;
}
cp = (void *)bt_buf_add(buf, sizeof*cp);
cp = bt_buf_add(buf, sizeof*cp);
/* Excplicitly enable LE for dual-mode controllers */
cp->le = 0x01;
@ -795,7 +795,7 @@ int bt_start_advertising(uint8_t type, const struct bt_eir *ad,
return -ENOBUFS;
}
set_data = (void *)bt_buf_add(buf, sizeof(*set_data));
set_data = bt_buf_add(buf, sizeof(*set_data));
memset(set_data, 0, sizeof(*set_data));
@ -822,7 +822,7 @@ send_scan_rsp:
return -ENOBUFS;
}
scan_rsp = (void *)bt_buf_add(buf, sizeof(*scan_rsp));
scan_rsp = bt_buf_add(buf, sizeof(*scan_rsp));
memset(scan_rsp, 0, sizeof(*scan_rsp));
@ -845,7 +845,7 @@ send_set_param:
return -ENOBUFS;
}
set_param = (void *)bt_buf_add(buf, sizeof(*set_param));
set_param = bt_buf_add(buf, sizeof(*set_param));
memset(set_param, 0, sizeof(*set_param));
set_param->min_interval = sys_cpu_to_le16(0x0800);
@ -882,7 +882,7 @@ int bt_start_scanning(uint8_t scan_type, uint8_t scan_filter)
return -ENOBUFS;
}
set_param = (void *)bt_buf_add(buf, sizeof(*set_param));
set_param = bt_buf_add(buf, sizeof(*set_param));
memset(set_param, 0, sizeof(*set_param));
set_param->scan_type = scan_type;
@ -900,7 +900,7 @@ int bt_start_scanning(uint8_t scan_type, uint8_t scan_filter)
return -ENOBUFS;
}
scan_enable = (void *)bt_buf_add(buf, sizeof(*scan_enable));
scan_enable = bt_buf_add(buf, sizeof(*scan_enable));
memset(scan_enable, 0, sizeof(*scan_enable));
scan_enable->filter_dup = scan_filter;
scan_enable->enable = BT_LE_SCAN_ENABLE;
@ -935,7 +935,7 @@ int bt_stop_scanning()
return -ENOBUFS;
}
scan_enable = (void *)bt_buf_add(buf, sizeof(*scan_enable));
scan_enable = bt_buf_add(buf, sizeof(*scan_enable));
memset(scan_enable, 0x0, sizeof(*scan_enable));
scan_enable->filter_dup = 0x00;
scan_enable->enable = BT_LE_SCAN_DISABLE;

View file

@ -85,7 +85,7 @@ struct bt_buf *bt_l2cap_create_pdu(struct bt_conn *conn, uint16_t cid,
return NULL;
}
hdr = (void *)bt_buf_add(buf, sizeof(*hdr));
hdr = bt_buf_add(buf, sizeof(*hdr));
hdr->len = sys_cpu_to_le16(len);
hdr->cid = sys_cpu_to_le16(cid);
@ -104,12 +104,12 @@ static void rej_not_understood(struct bt_conn *conn, uint8_t ident)
return;
}
hdr = (void *)bt_buf_add(buf, sizeof(*hdr));
hdr = bt_buf_add(buf, sizeof(*hdr));
hdr->code = BT_L2CAP_CMD_REJECT;
hdr->ident = ident;
hdr->len = sys_cpu_to_le16(sizeof(*rej));
rej = (void *)bt_buf_add(buf, sizeof(*rej));
rej = bt_buf_add(buf, sizeof(*rej));
rej->reason = sys_cpu_to_le16(BT_L2CAP_REJ_NOT_UNDERSTOOD);
bt_conn_send(conn, buf);
@ -218,12 +218,12 @@ void bt_l2cap_update_conn_param(struct bt_conn *conn)
return;
}
hdr = (void *)bt_buf_add(buf, sizeof(*hdr));
hdr = bt_buf_add(buf, sizeof(*hdr));
hdr->code = BT_L2CAP_CONN_PARAM_REQ;
hdr->ident = get_ident(conn);
hdr->len = sys_cpu_to_le16(sizeof(*req));
req = (void *)bt_buf_add(buf, sizeof(*req));
req = bt_buf_add(buf, sizeof(*req));
req->min_interval = sys_cpu_to_le16(LE_CONN_MIN_INTERVAL);
req->max_interval = sys_cpu_to_le16(LE_CONN_MAX_INTERVAL);
req->latency = sys_cpu_to_le16(LE_CONN_LATENCY);

View file

@ -58,7 +58,7 @@ struct bt_buf *bt_smp_create_pdu(struct bt_conn *conn, uint8_t op, size_t len)
if (!buf)
return NULL;
hdr = (void *)bt_buf_add(buf, sizeof(*hdr));
hdr = bt_buf_add(buf, sizeof(*hdr));
hdr->code = op;
return buf;
@ -73,7 +73,7 @@ static void send_err_rsp(struct bt_conn *conn, uint8_t reason)
if (!buf)
return;
rsp = (void *)bt_buf_add(buf, sizeof(*rsp));
rsp = bt_buf_add(buf, sizeof(*rsp));
rsp->reason = reason;
bt_conn_send(conn, buf);
@ -99,7 +99,7 @@ static int smp_pairing_req(struct bt_conn *conn, struct bt_buf *buf)
return BT_SMP_ERR_ENC_KEY_SIZE;
}
rsp = (void *)bt_buf_add(rsp_buf, sizeof(*rsp));
rsp = bt_buf_add(rsp_buf, sizeof(*rsp));
/* For JustWorks pairing simplify rsp parameters.
* TODO: needs to be reworked later on