[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.1 v2 1/2] util/fifo: s/fifo8/fifo globally
From: |
Beniamino Galvani |
Subject: |
Re: [Qemu-devel] [PATCH for-2.1 v2 1/2] util/fifo: s/fifo8/fifo globally |
Date: |
Tue, 8 Apr 2014 20:48:22 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Apr 07, 2014 at 07:04:43PM -0700, Peter Crosthwaite wrote:
> This prepares support for generalising FIFO support to more integer
> widths.
>
> Signed-off-by: Peter Crosthwaite <address@hidden>
>
> [...]
>
> --- a/include/qemu/fifo8.h
> +++ b/include/qemu/fifo.h
> @@ -9,102 +9,103 @@ typedef struct {
> uint32_t capacity;
> uint32_t head;
> uint32_t num;
> -} Fifo8;
> +} Fifo;
>
> /**
> - * fifo8_create:
> - * @fifo: struct Fifo8 to initialise with new FIFO
> + * fifo_create:
> + * @fifo: struct Fifo to initialise with new FIFO
> * @capacity: capacity of the newly created FIFO
> *
> - * Create a FIFO of the specified size. Clients should call fifo8_destroy()
> + * Create a FIFO of the specified size. Clients should call fifo_destroy()
> * when finished using the fifo. The FIFO is initially empty.
> */
>
> -void fifo8_create(Fifo8 *fifo, uint32_t capacity);
> +void fifo_create(Fifo *fifo, uint32_t capacity);
>
> /**
> - * fifo8_destroy:
> + * fifo_destroy:
> * @fifo: FIFO to cleanup
> *
> - * Cleanup a FIFO created with fifo8_create(). Frees memory created for FIFO
> + * Cleanup a FIFO created with fifo_create(). Frees memory created for FIFO
> *storage. The FIFO is no longer usable after this has been called.
> */
>
> -void fifo8_destroy(Fifo8 *fifo);
> +void fifo_destroy(Fifo *fifo);
>
> /**
> - * fifo8_push:
> + * fifo_push:
> * @fifo: FIFO to push to
> - * @data: data byte to push
> + * @data: data value to push
> *
> - * Push a data byte to the FIFO. Behaviour is undefined if the FIFO is full.
> - * Clients are responsible for checking for fullness using fifo8_is_full().
> + * Push a data value to the FIFO. Behaviour is undefined if the FIFO is full.
> + * Clients are responsible for checking for fullness using fifo_is_full().
> */
>
> -void fifo8_push(Fifo8 *fifo, uint8_t data);
> +void fifo_push(Fifo *fifo, uint8_t data);
>
> /**
> - * fifo8_push_all:
> + * fifo_push_all:
> * @fifo: FIFO to push to
> * @data: data to push
> - * @size: number of bytes to push
> + * @size: number of entries to push
> *
> - * Push a byte array to the FIFO. Behaviour is undefined if the FIFO is full.
> + * Push a buffer to the FIFO. Behaviour is undefined if the FIFO is full.
> * Clients are responsible for checking the space left in the FIFO using
> - * fifo8_num_free().
> + * fifo_num_free().
> */
>
> -void fifo8_push_all(Fifo8 *fifo, const uint8_t *data, uint32_t num);
> +void fifo_push_all(Fifo *fifo, const uint8_t *data, uint32_t num);
>
> /**
> - * fifo8_pop:
> + * fifo_pop:
> * @fifo: fifo to pop from
> *
> - * Pop a data byte from the FIFO. Behaviour is undefined if the FIFO is
> empty.
> - * Clients are responsible for checking for emptyness using fifo8_is_empty().
> + * Pop a data value from the FIFO. Behaviour is undefined if the FIFO is
> empty.
> + * Clients are responsible for checking for emptyness using fifo_is_empty().
> *
> - * Returns: The popped data byte.
> + * Returns: The popped data value.
> */
>
> -uint8_t fifo8_pop(Fifo8 *fifo);
> +uint8_t fifo_pop(Fifo *fifo);
>
> /**
> - * fifo8_pop_buf:
> + * fifo_pop_buf:
> * @fifo: FIFO to pop from
> * @max: maximum number of bytes to pop
> * @num: actual number of returned bytes
Perhaps these and the remaining occurrences of 'bytes' should be
replaced as well.
Otherwise:
Reviewed-by: Beniamino Galvani <address@hidden>