11/*
2- * Copyright 2022, UNSW (ABN 57 195 873 179)
2+ * Copyright 2022, UNSW
33 *
44 * SPDX-License-Identifier: BSD-2-Clause
55 */
66
7- #pragma once
7+ #pragma once
88
99#include <stdint.h>
1010#include <stddef.h>
@@ -46,7 +46,7 @@ typedef struct ring_handle {
4646 * @param used pointer to 'used' ring in shared memory.
4747 * @param notify function pointer used to notify the other user.
4848 * @param buffer_init 1 indicates the read and write indices in shared memory need to be initialised.
49- * 0 inidicates they do not. Only one side of the shared memory regions needs to do this.
49+ * 0 inidicates they do not. Only one side of the shared memory regions needs to do this.
5050 */
5151void ring_init (ring_handle_t * ring , ring_buffer_t * avail , ring_buffer_t * used , notify_fn notify , int buffer_init );
5252
@@ -57,7 +57,7 @@ void ring_init(ring_handle_t *ring, ring_buffer_t *avail, ring_buffer_t *used, n
5757 *
5858 * @return true indicates the buffer is empty, false otherwise.
5959 */
60- static inline int ring_empty (ring_buffer_t * ring )
60+ static inline int ring_empty (ring_buffer_t * ring )
6161{
6262 return !((ring -> write_idx - ring -> read_idx ) % CONFIG_LIB_SHARED_RINGBUFFER_DESC_COUNT );
6363}
@@ -91,7 +91,7 @@ static inline void notify(ring_handle_t *ring)
9191 * @param ring Ring buffer to enqueue into.
9292 * @param buffer address into shared memory where data is stored.
9393 * @param len length of data inside the buffer above.
94- * @param cookie optional pointer to data required on dequeueing.
94+ * @param cookie optional pointer to data required on dequeueing.
9595 *
9696 * @return -1 when ring is empty, 0 on success.
9797 */
@@ -118,7 +118,7 @@ static inline int enqueue(ring_buffer_t *ring, uintptr_t buffer, unsigned int le
118118 * @param ring Ring buffer to Dequeue from.
119119 * @param buffer pointer to the address of where to store buffer address.
120120 * @param len pointer to variable to store length of data dequeueing.
121- * @param cookie pointer optional pointer to data required on dequeueing.
121+ * @param cookie pointer optional pointer to data required on dequeueing.
122122 *
123123 * @return -1 when ring is empty, 0 on success.
124124 */
@@ -141,16 +141,16 @@ static inline int dequeue(ring_buffer_t *ring, uintptr_t *addr, unsigned int *le
141141
142142/**
143143 * Enqueue an element into an available ring buffer.
144- * This indicates the buffer address parameter is currently available for use.
144+ * This indicates the buffer address parameter is currently available for use.
145145 *
146146 * @param ring Ring handle to enqueue into.
147147 * @param buffer address into shared memory where data is stored.
148148 * @param len length of data inside the buffer above.
149- * @param cookie optional pointer to data required on dequeueing.
149+ * @param cookie optional pointer to data required on dequeueing.
150150 *
151151 * @return -1 when ring is empty, 0 on success.
152152 */
153- static inline int enqueue_avail (ring_handle_t * ring , uintptr_t addr , unsigned int len , void * cookie )
153+ static inline int enqueue_avail (ring_handle_t * ring , uintptr_t addr , unsigned int len , void * cookie )
154154{
155155 return enqueue (ring -> avail_ring , addr , len , cookie );
156156}
@@ -162,11 +162,11 @@ static inline int enqueue_avail(ring_handle_t *ring, uintptr_t addr, unsigned in
162162 * @param ring Ring handle to enqueue into.
163163 * @param buffer address into shared memory where data is stored.
164164 * @param len length of data inside the buffer above.
165- * @param cookie optional pointer to data required on dequeueing.
165+ * @param cookie optional pointer to data required on dequeueing.
166166 *
167167 * @return -1 when ring is empty, 0 on success.
168168 */
169- static inline int enqueue_used (ring_handle_t * ring , uintptr_t addr , unsigned int len , void * cookie )
169+ static inline int enqueue_used (ring_handle_t * ring , uintptr_t addr , unsigned int len , void * cookie )
170170{
171171 return enqueue (ring -> used_ring , addr , len , cookie );
172172}
@@ -177,7 +177,7 @@ static inline int enqueue_used(ring_handle_t *ring, uintptr_t addr, unsigned int
177177 * @param ring Ring handle to dequeue from.
178178 * @param buffer pointer to the address of where to store buffer address.
179179 * @param len pointer to variable to store length of data dequeueing.
180- * @param cookie pointer optional pointer to data required on dequeueing.
180+ * @param cookie pointer optional pointer to data required on dequeueing.
181181 *
182182 * @return -1 when ring is empty, 0 on success.
183183 */
@@ -192,7 +192,7 @@ static inline int dequeue_avail(ring_handle_t *ring, uintptr_t *addr, unsigned i
192192 * @param ring Ring handle to dequeue from.
193193 * @param buffer pointer to the address of where to store buffer address.
194194 * @param len pointer to variable to store length of data dequeueing.
195- * @param cookie pointer optional pointer to data required on dequeueing.
195+ * @param cookie pointer optional pointer to data required on dequeueing.
196196 *
197197 * @return -1 when ring is empty, 0 on success.
198198 */
@@ -204,7 +204,7 @@ static inline int dequeue_used(ring_handle_t *ring, uintptr_t *addr, unsigned in
204204/**
205205 * Dequeue an element from a ring buffer.
206206 * This function is intended for use by the driver, to collect a pointer
207- * into this structure to be passed around as a cookie.
207+ * into this structure to be passed around as a cookie.
208208 *
209209 * @param ring Ring buffer to dequeue from.
210210 * @param addr pointer to the address of where to store buffer address.
@@ -230,4 +230,4 @@ static int driver_dequeue(ring_buffer_t *ring, uintptr_t *addr, unsigned int *le
230230 ring -> read_idx ++ ;
231231
232232 return 0 ;
233- }
233+ }
0 commit comments