Skip to content

Commit 070ea84

Browse files
committed
Remove unused variable and check
1 parent bd3e192 commit 070ea84

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

virtio-snd.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ typedef struct {
296296
uint32_t stream_id;
297297
} vsnd_stream_sel_t;
298298

299+
typedef struct {
300+
uint32_t addr;
301+
uint32_t len;
302+
struct list_head q;
303+
} vsnd_buf_queue_node_t;
304+
299305
/* hold the settings of each stream */
300306
typedef struct {
301307
virtio_snd_jack_info_t j;
@@ -307,6 +313,8 @@ typedef struct {
307313

308314
// PCM frame ring buffer
309315
virtio_snd_ring_buffer_t ring;
316+
// PCM frame doubly-ended queue
317+
vsnd_buf_queue_node_t buf;
310318

311319
// playback control
312320
vsnd_stream_sel_t v;
@@ -921,7 +929,6 @@ static int virtio_snd_tx_desc_handler(virtio_snd_state_t *vsnd,
921929
virtq_desc_queue_node_t *node;
922930
struct list_head q;
923931
INIT_LIST_HEAD(&q);
924-
assert(list_empty(&q));
925932

926933
/* Collect the descriptors */
927934
int cnt = 0;
@@ -975,13 +982,10 @@ static int virtio_snd_tx_desc_handler(virtio_snd_state_t *vsnd,
975982
}
976983

977984
/* Tear down the descriptor list and free space. */
978-
/* TODO: remove this part as we are going to use ring buffer */
979-
idx = 0;
980985
virtq_desc_queue_node_t *tmp = NULL;
981986
list_for_each_entry_safe (node, tmp, &q, q) {
982987
list_del(&node->q);
983988
free(node);
984-
idx++;
985989
}
986990

987991
return 0;

0 commit comments

Comments
 (0)