bt: remove dead assignments, spotted by clang analyzer
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
2cc2026063
commit
7300c07991
@ -50,19 +50,19 @@ static void bt_host_send(struct HCIInfo *hci,
|
|||||||
struct bt_host_hci_s *s = (struct bt_host_hci_s *) hci;
|
struct bt_host_hci_s *s = (struct bt_host_hci_s *) hci;
|
||||||
uint8_t pkt = type;
|
uint8_t pkt = type;
|
||||||
struct iovec iv[2];
|
struct iovec iv[2];
|
||||||
int ret;
|
|
||||||
|
|
||||||
iv[0].iov_base = (void *)&pkt;
|
iv[0].iov_base = (void *)&pkt;
|
||||||
iv[0].iov_len = 1;
|
iv[0].iov_len = 1;
|
||||||
iv[1].iov_base = (void *) data;
|
iv[1].iov_base = (void *) data;
|
||||||
iv[1].iov_len = len;
|
iv[1].iov_len = len;
|
||||||
|
|
||||||
while ((ret = writev(s->fd, iv, 2)) < 0)
|
while (writev(s->fd, iv, 2) < 0) {
|
||||||
if (errno != EAGAIN && errno != EINTR) {
|
if (errno != EAGAIN && errno != EINTR) {
|
||||||
fprintf(stderr, "qemu: error %i writing bluetooth packet.\n",
|
fprintf(stderr, "qemu: error %i writing bluetooth packet.\n",
|
||||||
errno);
|
errno);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bt_host_cmd(struct HCIInfo *hci, const uint8_t *data, int len)
|
static void bt_host_cmd(struct HCIInfo *hci, const uint8_t *data, int len)
|
||||||
|
@ -226,7 +226,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt)
|
|||||||
*rpkt ++ = 0x20; /* Operational settings negotation Ok */
|
*rpkt ++ = 0x20; /* Operational settings negotation Ok */
|
||||||
memcpy(rpkt, pkt, 7); rpkt += 7;
|
memcpy(rpkt, pkt, 7); rpkt += 7;
|
||||||
*rpkt ++ = 0xff;
|
*rpkt ++ = 0xff;
|
||||||
*rpkt ++ = 0xff;
|
*rpkt = 0xff;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case H4_ALIVE_PKT:
|
case H4_ALIVE_PKT:
|
||||||
@ -238,7 +238,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt)
|
|||||||
rpkt = csrhci_out_packet_csr(s, H4_ALIVE_PKT, 2);
|
rpkt = csrhci_out_packet_csr(s, H4_ALIVE_PKT, 2);
|
||||||
|
|
||||||
*rpkt ++ = 0xcc;
|
*rpkt ++ = 0xcc;
|
||||||
*rpkt ++ = 0x00;
|
*rpkt = 0x00;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -994,13 +994,12 @@ static int bt_hci_features_req(struct bt_hci_s *hci, uint16_t handle)
|
|||||||
|
|
||||||
static int bt_hci_version_req(struct bt_hci_s *hci, uint16_t handle)
|
static int bt_hci_version_req(struct bt_hci_s *hci, uint16_t handle)
|
||||||
{
|
{
|
||||||
struct bt_device_s *slave;
|
|
||||||
evt_read_remote_version_complete params;
|
evt_read_remote_version_complete params;
|
||||||
|
|
||||||
if (bt_hci_handle_bad(hci, handle))
|
if (bt_hci_handle_bad(hci, handle))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
slave = bt_hci_remote_dev(hci, handle);
|
bt_hci_remote_dev(hci, handle);
|
||||||
|
|
||||||
bt_hci_event_status(hci, HCI_SUCCESS);
|
bt_hci_event_status(hci, HCI_SUCCESS);
|
||||||
|
|
||||||
@ -2080,7 +2079,6 @@ static void bt_submit_sco(struct HCIInfo *info,
|
|||||||
const uint8_t *data, int length)
|
const uint8_t *data, int length)
|
||||||
{
|
{
|
||||||
struct bt_hci_s *hci = hci_from_info(info);
|
struct bt_hci_s *hci = hci_from_info(info);
|
||||||
struct bt_link_s *link;
|
|
||||||
uint16_t handle;
|
uint16_t handle;
|
||||||
int datalen;
|
int datalen;
|
||||||
|
|
||||||
@ -2089,7 +2087,6 @@ static void bt_submit_sco(struct HCIInfo *info,
|
|||||||
|
|
||||||
handle = acl_handle((data[1] << 8) | data[0]);
|
handle = acl_handle((data[1] << 8) | data[0]);
|
||||||
datalen = data[2];
|
datalen = data[2];
|
||||||
data += 3;
|
|
||||||
length -= 3;
|
length -= 3;
|
||||||
|
|
||||||
if (bt_hci_handle_bad(hci, handle)) {
|
if (bt_hci_handle_bad(hci, handle)) {
|
||||||
@ -2097,7 +2094,6 @@ static void bt_submit_sco(struct HCIInfo *info,
|
|||||||
__FUNCTION__, handle);
|
__FUNCTION__, handle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
handle &= ~HCI_HANDLE_OFFSET;
|
|
||||||
|
|
||||||
if (datalen > length) {
|
if (datalen > length) {
|
||||||
fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n",
|
fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n",
|
||||||
@ -2105,7 +2101,6 @@ static void bt_submit_sco(struct HCIInfo *info,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
link = hci->lm.handle[handle].link;
|
|
||||||
/* TODO */
|
/* TODO */
|
||||||
|
|
||||||
/* TODO: increase counter and send EVT_NUM_COMP_PKTS if synchronous
|
/* TODO: increase counter and send EVT_NUM_COMP_PKTS if synchronous
|
||||||
|
Loading…
Reference in New Issue
Block a user