Skip to content

Commit e63eedc

Browse files
finikorgcarlescufi
authored andcommitted
lib: ring_buf: Fix unused-but-set compilation warnings
For the error codes used only in __ASSERT() statements fix compilation warnings like: ... warning: variable 'err' set but not used [-Wunused-but-set-variable] int err; ^ ... Signed-off-by: Andrei Emeltchenko <[email protected]>
1 parent 14b6f49 commit e63eedc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/os/ring_buffer.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ uint32_t ring_buf_put(struct ring_buf *buf, const uint8_t *data, uint32_t size)
7171

7272
err = ring_buf_put_finish(buf, total_size);
7373
__ASSERT_NO_MSG(err == 0);
74+
ARG_UNUSED(err);
7475

7576
return total_size;
7677
}
@@ -139,6 +140,7 @@ uint32_t ring_buf_get(struct ring_buf *buf, uint8_t *data, uint32_t size)
139140

140141
err = ring_buf_get_finish(buf, total_size);
141142
__ASSERT_NO_MSG(err == 0);
143+
ARG_UNUSED(err);
142144

143145
return total_size;
144146
}
@@ -164,6 +166,7 @@ uint32_t ring_buf_peek(struct ring_buf *buf, uint8_t *data, uint32_t size)
164166
/* effectively unclaim total_size bytes */
165167
err = ring_buf_get_finish(buf, 0);
166168
__ASSERT_NO_MSG(err == 0);
169+
ARG_UNUSED(err);
167170

168171
return total_size;
169172
}
@@ -214,6 +217,7 @@ int ring_buf_item_put(struct ring_buf *buf, uint16_t type, uint8_t value,
214217

215218
ret = ring_buf_put_finish(buf, total_size);
216219
__ASSERT_NO_MSG(ret == 0);
220+
ARG_UNUSED(ret);
217221

218222
return 0;
219223
}
@@ -260,6 +264,7 @@ int ring_buf_item_get(struct ring_buf *buf, uint16_t *type, uint8_t *value,
260264

261265
ret = ring_buf_get_finish(buf, total_size);
262266
__ASSERT_NO_MSG(ret == 0);
267+
ARG_UNUSED(ret);
263268

264269
return 0;
265270
}

0 commit comments

Comments
 (0)