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:
Philippe Mathieu-Daudé 2024-07-22 13:37:48 +02:00
parent 23ad571173
commit e4e9db2562
3 changed files with 16 additions and 1 deletions

View file

@ -351,7 +351,7 @@ static void do_message_phase(ESPState *s)
/* Ignore extended messages for now */
if (s->cmdfifo_cdb_offset) {
int len = MIN(s->cmdfifo_cdb_offset, fifo8_num_used(&s->cmdfifo));
fifo8_pop_buf(&s->cmdfifo, NULL, len);
fifo8_drop(&s->cmdfifo, len);
s->cmdfifo_cdb_offset = 0;
}
}