Skip to content

Commit 07af3a0

Browse files
committed
Trivial: Style
Signed-off-by: Lucy <[email protected]>
1 parent 04d2836 commit 07af3a0

File tree

5 files changed

+6
-24
lines changed

5 files changed

+6
-24
lines changed

libsharedringbuffer/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ memory regions and notification/signalling handlers to this library.
1616
To use this library in a project you can link `shared_ringbuffer` in your
1717
target applications CMake configuration.
1818

19-
This libary is intented to be used by both a producer and consumer. For
19+
This libary is intended to be used by both a producer and consumer. For
2020
example, an ethernet driver produces data for a network stack to consume.
21-
2 seperate shared memory regions are required for each ring handle; one
21+
2 separate shared memory regions are required for each ring handle; one
2222
to store available buffers and one to store used buffers. Each ring buffer
2323
contains a separate read index and write index. The reader only ever
2424
increments the read index, and the writer the write index. As read and
@@ -36,7 +36,7 @@ This library is intended to be used with a separate shared memory region,
3636
usually allocated for DMA for a driver. The ring buffers can then contain
3737
pointers into this shared memory, indicating which buffers are in use or
3838
available to be used by either component.
39-
Typically, 2 shared ring buffers are required, with seperate structures
39+
Typically, 2 shared ring buffers are required, with separate structures
4040
required on the recieve path and transmit path. Thus there are 4 regions
4141
of shared memory required: 1 storing pointers to available RX buffers,
4242
1 storing pointers to used RX buffers, 1 storing pointers to TX

libsharedringbuffer/include/shared_ringbuffer/shared_ringbuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ typedef struct buff_desc {
2222

2323
/* Circular buffer containing descriptors */
2424
typedef struct ring_buffer {
25-
buff_desc_t buffers[CONFIG_LIB_SHARED_RINGBUFFER_DESC_COUNT];
2625
uint32_t write_idx;
2726
uint32_t read_idx;
27+
buff_desc_t buffers[CONFIG_LIB_SHARED_RINGBUFFER_DESC_COUNT];
2828
} ring_buffer_t;
2929

3030
/* A ring handle for enqueing/dequeuing into */

libvirtqueue/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ libvirtqueue
1010
**_This implementation is currently a work in progress_**
1111

1212
This directory contains a library implementation of a virtqueue inspired from
13-
the specification. This is intended to be used as a communication
13+
the virtio specification. This is intended to be used as a communication
1414
mechanism between system components for bulk data transfer.
1515
The goal of this implementation is to provide a generic interface for manipulating
1616
and managing a 'virtqueue' connection. This library doesn't contain any code that

libvirtqueue/include/virtqueue.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,4 @@ int virtqueue_gather_available(virtqueue_device_t *vq, virtqueue_ring_object_t *
188188
* @return 1 on success, 0 on failure (no more buffer available)
189189
*/
190190
int virtqueue_gather_used(virtqueue_driver_t *vq, virtqueue_ring_object_t *robj,
191-
void **buf, unsigned *len, vq_flags_t *flag);
192-
193-
int virtqueue_get_num_used();
194-
void add_rx_used_count();
195-
void decrement_rx_used_count();
191+
void **buf, unsigned *len, vq_flags_t *flag);

libvirtqueue/src/virtqueue.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include <utils/util.h>
88
#include <virtqueue.h>
99

10-
int num_used_buffs = 0;
11-
1210
void virtqueue_init_driver(virtqueue_driver_t *vq, unsigned queue_len, vq_vring_avail_t *avail_ring,
1311
vq_vring_used_t *used_ring, vq_vring_desc_t *desc, void (*notify)(void),
1412
void *cookie)
@@ -218,16 +216,4 @@ int virtqueue_gather_used(virtqueue_driver_t *vq, virtqueue_ring_object_t *robj,
218216
}
219217
robj->cur = vq_pop_desc(vq, robj->cur, buf, len, flag);
220218
return 1;
221-
}
222-
223-
int virtqueue_get_num_used() {
224-
return num_used_buffs;
225-
}
226-
227-
void add_rx_used_count() {
228-
num_used_buffs++;
229-
}
230-
231-
void decrement_rx_used_count() {
232-
num_used_buffs--;
233219
}

0 commit comments

Comments
 (0)