From c06db626668705b478c33a067184265be8a09dba Mon Sep 17 00:00:00 2001 From: Karl Fessel Date: Sun, 12 Oct 2025 20:34:32 +0200 Subject: [PATCH] sys/tsrb: fix some style and linter complains --- sys/include/tsrb.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/include/tsrb.h b/sys/include/tsrb.h index 99890ad1da..45c4724115 100644 --- a/sys/include/tsrb.h +++ b/sys/include/tsrb.h @@ -33,7 +33,7 @@ extern "C" { #endif /** - * @brief thread-safe ringbuffer struct + * @brief thread-safe ringbuffer struct */ typedef struct tsrb { uint8_t *buf; /**< Buffer to operate on. */ @@ -43,22 +43,22 @@ typedef struct tsrb { } tsrb_t; /** - * @brief Static initializer + * @brief Static initializer * * @note The size of the buffer (`sizeof(@p BUF)`) must be a power of two. * - * @param[in] BUF Buffer to use by tsrb. + * @param[in] BUF Buffer to use by tsrb. */ #define TSRB_INIT(BUF) { (BUF), sizeof (BUF), 0, 0 } /** - * @brief Initialize a tsrb. + * @brief Initialize a tsrb. * * @note The size of the buffer (@p bufsize) must be a power of two. * - * @param[out] rb Datum to initialize. - * @param[in] buffer Buffer to use by tsrb. - * @param[in] bufsize Size of @p buffer. + * @param[out] rb Datum to initialize. + * @param[in] buffer Buffer to use by tsrb. + * @param[in] bufsize Size of @p buffer. */ static inline void tsrb_init(tsrb_t *rb, uint8_t *buffer, unsigned bufsize) { @@ -74,8 +74,8 @@ static inline void tsrb_init(tsrb_t *rb, uint8_t *buffer, unsigned bufsize) } /** - * @brief Clear a tsrb. - * @param[out] rb Ringbuffer to operate on + * @brief Clear a tsrb. + * @param[out] rb Ringbuffer to operate on */ static inline void tsrb_clear(tsrb_t *rb) { @@ -106,7 +106,7 @@ static inline int tsrb_empty(const tsrb_t *rb) static inline unsigned int tsrb_avail(const tsrb_t *rb) { unsigned irq_state = irq_disable(); - int retval = (rb->writes - rb->reads); + unsigned int retval = (rb->writes - rb->reads); irq_restore(irq_state); return retval; } @@ -133,7 +133,7 @@ static inline int tsrb_full(const tsrb_t *rb) static inline unsigned int tsrb_free(const tsrb_t *rb) { unsigned irq_state = irq_disable(); - int retval = (rb->size - rb->writes + rb->reads); + unsigned int retval = (rb->size - rb->writes + rb->reads); irq_restore(irq_state); return retval; }