mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
util/fifo8: Introduce fifo8_drop()
Add the fifo8_drop() helper for clarity. It is a simple wrapper over fifo8_pop_buf(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20240722160745.67904-8-philmd@linaro.org>
This commit is contained in:
parent
23ad571173
commit
e4e9db2562
3 changed files with 16 additions and 1 deletions
|
@ -131,6 +131,12 @@ uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen)
|
|||
return n1 + n2;
|
||||
}
|
||||
|
||||
void fifo8_drop(Fifo8 *fifo, uint32_t len)
|
||||
{
|
||||
len -= fifo8_pop_buf(fifo, NULL, len);
|
||||
assert(len == 0);
|
||||
}
|
||||
|
||||
bool fifo8_is_empty(Fifo8 *fifo)
|
||||
{
|
||||
return (fifo->num == 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue