[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 36/56] fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 36/56] fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf() |
Date: |
Wed, 11 Sep 2024 14:14:01 +0200 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
The fifo8_pop_buf() function will soon also be used for peek
operations, so rename the function accordingly. Create a new
fifo8_pop_buf() wrapper function that can be used by existing
callers.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Octavian Purdila <tavip@google.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240828122258.928947-6-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
util/fifo8.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/util/fifo8.c b/util/fifo8.c
index efe0117b1f..5453cbc1b0 100644
--- a/util/fifo8.c
+++ b/util/fifo8.c
@@ -105,7 +105,8 @@ const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max,
uint32_t *numptr)
return fifo8_peekpop_bufptr(fifo, max, 0, numptr, true);
}
-uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen)
+static uint32_t fifo8_peekpop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen,
+ bool do_pop)
{
const uint8_t *buf;
uint32_t n1, n2 = 0;
@@ -134,6 +135,11 @@ uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest,
uint32_t destlen)
return n1 + n2;
}
+uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen)
+{
+ return fifo8_peekpop_buf(fifo, dest, destlen, true);
+}
+
void fifo8_drop(Fifo8 *fifo, uint32_t len)
{
len -= fifo8_pop_buf(fifo, NULL, len);
--
2.45.2
- [PULL 32/56] fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr(), (continued)
- [PULL 32/56] fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr(), Philippe Mathieu-Daudé, 2024/09/11
- [PULL 20/56] seccomp: Remove check for CRIS host, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 29/56] hw/char/pl011: Warn when using disabled transmitter, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 34/56] fifo8: add skip parameter to fifo8_peekpop_bufptr(), Philippe Mathieu-Daudé, 2024/09/11
- [PULL 23/56] hw/char/pl011: Remove unused 'readbuff' field, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 26/56] hw/char/pl011: Split RX/TX path of pl011_reset_fifo(), Philippe Mathieu-Daudé, 2024/09/11
- [PULL 27/56] hw/char/pl011: Extract pl011_write_txdata() from pl011_write(), Philippe Mathieu-Daudé, 2024/09/11
- [PULL 33/56] fifo8: introduce head variable for fifo8_peekpop_bufptr(), Philippe Mathieu-Daudé, 2024/09/11
- [PULL 28/56] hw/char/pl011: Extract pl011_read_rxdata() from pl011_read(), Philippe Mathieu-Daudé, 2024/09/11
- [PULL 38/56] fifo8: add fifo8_peek_buf() function, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 36/56] fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf(),
Philippe Mathieu-Daudé <=
- [PULL 42/56] tests/unit: Expand test_fifo8_peek_buf_wrap() coverage, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 37/56] fifo8: honour do_pop argument in fifo8_peekpop_buf(), Philippe Mathieu-Daudé, 2024/09/11
- [PULL 39/56] fifo8: introduce fifo8_peek() function, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 43/56] tests/unit: Comment FIFO8 tests, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 44/56] hw/char/escc: convert Sun mouse to use QemuInputHandler, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 35/56] fifo8: replace fifo8_pop_bufptr() with fifo8_peekpop_bufptr() in fifo8_pop_buf(), Philippe Mathieu-Daudé, 2024/09/11
- [PULL 40/56] tests/unit: add test-fifo unit test, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 41/56] tests/unit: Strengthen FIFO8 tests, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 45/56] hw/input/adb-mouse: convert to use QemuInputHandler, Philippe Mathieu-Daudé, 2024/09/11
- [PULL 46/56] hw/char: replace assert(0) with g_assert_not_reached(), Philippe Mathieu-Daudé, 2024/09/11