From: Alistair Francis <alistair23@gmail.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: philmd@linaro.org, Alistair.Francis@wdc.com, tavip@google.com,
qemu-devel@nongnu.org
Subject: Re: [PATCH 6/9] fifo8: honour do_pop argument in fifo8_peekpop_buf()
Date: Fri, 30 Aug 2024 09:57:43 +1000 [thread overview]
Message-ID: <CAKmqyKNKMK5hj5RGsb8SBTUUu5C2ysUF3SignnNPH=GULDLOxg@mail.gmail.com> (raw)
In-Reply-To: <20240828122258.928947-7-mark.cave-ayland@ilande.co.uk>
On Wed, Aug 28, 2024 at 10:25 PM Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
>
> Pass the do_pop value from fifo8_peekpop_buf() to fifo8_peekpop_bufptr() to
> allow peeks to the FIFO buffer, including adjusting the skip parameter to
> handle the case where the internal FIFO buffer wraps around.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> util/fifo8.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/util/fifo8.c b/util/fifo8.c
> index 5453cbc1b0..1031ffbe7e 100644
> --- a/util/fifo8.c
> +++ b/util/fifo8.c
> @@ -117,7 +117,7 @@ static uint32_t fifo8_peekpop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen,
> }
>
> len = destlen;
> - buf = fifo8_peekpop_bufptr(fifo, len, 0, &n1, true);
> + buf = fifo8_peekpop_bufptr(fifo, len, 0, &n1, do_pop);
> if (dest) {
> memcpy(dest, buf, n1);
> }
> @@ -126,7 +126,7 @@ static uint32_t fifo8_peekpop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen,
> len -= n1;
> len = MIN(len, fifo8_num_used(fifo));
> if (len) {
> - buf = fifo8_peekpop_bufptr(fifo, len, 0, &n2, true);
> + buf = fifo8_peekpop_bufptr(fifo, len, do_pop ? 0 : n1, &n2, do_pop);
> if (dest) {
> memcpy(&dest[n1], buf, n2);
> }
> --
> 2.39.2
>
>
next prev parent reply other threads:[~2024-08-29 23:58 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 12:22 [PATCH 0/9] fifo8: add fifo8_peek(), fifo8_peek_buf() and tests Mark Cave-Ayland
2024-08-28 12:22 ` [PATCH 1/9] fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr() Mark Cave-Ayland
2024-08-29 23:47 ` Alistair Francis
2024-08-31 0:02 ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 2/9] fifo8: introduce head variable for fifo8_peekpop_bufptr() Mark Cave-Ayland
2024-08-29 23:47 ` Alistair Francis
2024-08-31 0:05 ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 3/9] fifo8: add skip parameter to fifo8_peekpop_bufptr() Mark Cave-Ayland
2024-08-29 23:51 ` Alistair Francis
2024-08-31 0:13 ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 4/9] fifo8: replace fifo8_pop_bufptr() with fifo8_peekpop_bufptr() in fifo8_pop_buf() Mark Cave-Ayland
2024-08-29 23:52 ` Alistair Francis
2024-08-31 0:15 ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 5/9] fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf() Mark Cave-Ayland
2024-08-29 23:55 ` Alistair Francis
2024-08-31 0:17 ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 6/9] fifo8: honour do_pop argument in fifo8_peekpop_buf() Mark Cave-Ayland
2024-08-29 23:57 ` Alistair Francis [this message]
2024-08-31 0:41 ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 7/9] fifo8: add fifo8_peek_buf() function Mark Cave-Ayland
2024-08-29 23:58 ` Alistair Francis
2024-08-31 0:42 ` Octavian Purdila
2024-09-06 20:39 ` Mark Cave-Ayland
2024-08-28 12:22 ` [PATCH 8/9] fifo8: introduce fifo8_peek() function Mark Cave-Ayland
2024-08-29 23:59 ` Alistair Francis
2024-08-31 0:44 ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 9/9] tests/unit: add test-fifo unit test Mark Cave-Ayland
2024-08-30 0:01 ` Alistair Francis
2024-08-31 1:18 ` Octavian Purdila
2024-09-06 20:49 ` Mark Cave-Ayland
2024-09-06 13:14 ` [PATCH 0/9] fifo8: add fifo8_peek(), fifo8_peek_buf() and tests Philippe Mathieu-Daudé
2024-09-06 20:51 ` Mark Cave-Ayland
2024-09-07 4:51 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKmqyKNKMK5hj5RGsb8SBTUUu5C2ysUF3SignnNPH=GULDLOxg@mail.gmail.com' \
--to=alistair23@gmail.com \
--cc=Alistair.Francis@wdc.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=tavip@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).