diff mbox series

[1/9] fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr()

Message ID 20240828122258.928947-2-mark.cave-ayland@ilande.co.uk (mailing list archive)
State New, archived
Headers show
Series fifo8: add fifo8_peek(), fifo8_peek_buf() and tests | expand

Commit Message

Mark Cave-Ayland Aug. 28, 2024, 12:22 p.m. UTC
This is to emphasise that the function returns a pointer to the internal FIFO
buffer.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 util/fifo8.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Alistair Francis Aug. 29, 2024, 11:47 p.m. UTC | #1
On Wed, Aug 28, 2024 at 10:25 PM Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
>
> This is to emphasise that the function returns a pointer to the internal FIFO
> buffer.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  util/fifo8.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/util/fifo8.c b/util/fifo8.c
> index 1ffa19d900..61bce9d9a0 100644
> --- a/util/fifo8.c
> +++ b/util/fifo8.c
> @@ -71,8 +71,8 @@ uint8_t fifo8_pop(Fifo8 *fifo)
>      return ret;
>  }
>
> -static const uint8_t *fifo8_peekpop_buf(Fifo8 *fifo, uint32_t max,
> -                                        uint32_t *numptr, bool do_pop)
> +static const uint8_t *fifo8_peekpop_bufptr(Fifo8 *fifo, uint32_t max,
> +                                           uint32_t *numptr, bool do_pop)
>  {
>      uint8_t *ret;
>      uint32_t num;
> @@ -94,12 +94,12 @@ static const uint8_t *fifo8_peekpop_buf(Fifo8 *fifo, uint32_t max,
>
>  const uint8_t *fifo8_peek_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr)
>  {
> -    return fifo8_peekpop_buf(fifo, max, numptr, false);
> +    return fifo8_peekpop_bufptr(fifo, max, numptr, false);
>  }
>
>  const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr)
>  {
> -    return fifo8_peekpop_buf(fifo, max, numptr, true);
> +    return fifo8_peekpop_bufptr(fifo, max, numptr, true);
>  }
>
>  uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen)
> --
> 2.39.2
>
>
Octavian Purdila Aug. 31, 2024, 12:02 a.m. UTC | #2
On Wed, Aug 28, 2024 at 5:23 AM Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
>
> This is to emphasise that the function returns a pointer to the internal FIFO
> buffer.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Reviewed-by: Octavian Purdila <tavip@google.com>

> ---
>  util/fifo8.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/util/fifo8.c b/util/fifo8.c
> index 1ffa19d900..61bce9d9a0 100644
> --- a/util/fifo8.c
> +++ b/util/fifo8.c
> @@ -71,8 +71,8 @@ uint8_t fifo8_pop(Fifo8 *fifo)
>      return ret;
>  }
>
> -static const uint8_t *fifo8_peekpop_buf(Fifo8 *fifo, uint32_t max,
> -                                        uint32_t *numptr, bool do_pop)
> +static const uint8_t *fifo8_peekpop_bufptr(Fifo8 *fifo, uint32_t max,
> +                                           uint32_t *numptr, bool do_pop)
>  {
>      uint8_t *ret;
>      uint32_t num;
> @@ -94,12 +94,12 @@ static const uint8_t *fifo8_peekpop_buf(Fifo8 *fifo, uint32_t max,
>
>  const uint8_t *fifo8_peek_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr)
>  {
> -    return fifo8_peekpop_buf(fifo, max, numptr, false);
> +    return fifo8_peekpop_bufptr(fifo, max, numptr, false);
>  }
>
>  const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr)
>  {
> -    return fifo8_peekpop_buf(fifo, max, numptr, true);
> +    return fifo8_peekpop_bufptr(fifo, max, numptr, true);
>  }
>
>  uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen)
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/util/fifo8.c b/util/fifo8.c
index 1ffa19d900..61bce9d9a0 100644
--- a/util/fifo8.c
+++ b/util/fifo8.c
@@ -71,8 +71,8 @@  uint8_t fifo8_pop(Fifo8 *fifo)
     return ret;
 }
 
-static const uint8_t *fifo8_peekpop_buf(Fifo8 *fifo, uint32_t max,
-                                        uint32_t *numptr, bool do_pop)
+static const uint8_t *fifo8_peekpop_bufptr(Fifo8 *fifo, uint32_t max,
+                                           uint32_t *numptr, bool do_pop)
 {
     uint8_t *ret;
     uint32_t num;
@@ -94,12 +94,12 @@  static const uint8_t *fifo8_peekpop_buf(Fifo8 *fifo, uint32_t max,
 
 const uint8_t *fifo8_peek_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr)
 {
-    return fifo8_peekpop_buf(fifo, max, numptr, false);
+    return fifo8_peekpop_bufptr(fifo, max, numptr, false);
 }
 
 const uint8_t *fifo8_pop_bufptr(Fifo8 *fifo, uint32_t max, uint32_t *numptr)
 {
-    return fifo8_peekpop_buf(fifo, max, numptr, true);
+    return fifo8_peekpop_bufptr(fifo, max, numptr, true);
 }
 
 uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen)