@@ -209,7 +209,7 @@ static inline void ring_buf_item_init(struct ring_buf *buf,
209
209
*
210
210
* @return true if the ring buffer is empty, or false if not.
211
211
*/
212
- static inline bool ring_buf_is_empty (struct ring_buf * buf )
212
+ static inline bool ring_buf_is_empty (const struct ring_buf * buf )
213
213
{
214
214
return buf -> get .head == buf -> put .tail ;
215
215
}
@@ -231,7 +231,7 @@ static inline void ring_buf_reset(struct ring_buf *buf)
231
231
*
232
232
* @return Ring buffer free space (in bytes).
233
233
*/
234
- static inline uint32_t ring_buf_space_get (struct ring_buf * buf )
234
+ static inline uint32_t ring_buf_space_get (const struct ring_buf * buf )
235
235
{
236
236
ring_buf_idx_t allocated = buf -> put .head - buf -> get .tail ;
237
237
@@ -245,7 +245,7 @@ static inline uint32_t ring_buf_space_get(struct ring_buf *buf)
245
245
*
246
246
* @return Ring buffer free space (in 32-bit words).
247
247
*/
248
- static inline uint32_t ring_buf_item_space_get (struct ring_buf * buf )
248
+ static inline uint32_t ring_buf_item_space_get (const struct ring_buf * buf )
249
249
{
250
250
return ring_buf_space_get (buf ) / 4 ;
251
251
}
@@ -257,7 +257,7 @@ static inline uint32_t ring_buf_item_space_get(struct ring_buf *buf)
257
257
*
258
258
* @return Ring buffer capacity (in bytes).
259
259
*/
260
- static inline uint32_t ring_buf_capacity_get (struct ring_buf * buf )
260
+ static inline uint32_t ring_buf_capacity_get (const struct ring_buf * buf )
261
261
{
262
262
return buf -> size ;
263
263
}
@@ -269,7 +269,7 @@ static inline uint32_t ring_buf_capacity_get(struct ring_buf *buf)
269
269
*
270
270
* @return Ring buffer data size (in bytes).
271
271
*/
272
- static inline uint32_t ring_buf_size_get (struct ring_buf * buf )
272
+ static inline uint32_t ring_buf_size_get (const struct ring_buf * buf )
273
273
{
274
274
ring_buf_idx_t available = buf -> put .tail - buf -> get .head ;
275
275
0 commit comments