diff mbox series

[1/3] chardev/char-fe: Document returned value on error

Message ID 20240719151628.46253-2-philmd@linaro.org
State Superseded
Headers show
Series util/fifo8: Introduce fifo8_change_capacity() | expand

Commit Message

Philippe Mathieu-Daudé July 19, 2024, 3:16 p.m. UTC
qemu_chr_fe_add_watch() and qemu_chr_fe_write[_all]()
return -1 on error. Mention it in the documentation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/chardev/char-fe.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Mark Cave-Ayland July 19, 2024, 8:18 p.m. UTC | #1
On 19/07/2024 16:16, Philippe Mathieu-Daudé wrote:

> qemu_chr_fe_add_watch() and qemu_chr_fe_write[_all]()
> return -1 on error. Mention it in the documentation.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/chardev/char-fe.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h
> index ecef182835..3310449eaf 100644
> --- a/include/chardev/char-fe.h
> +++ b/include/chardev/char-fe.h
> @@ -228,6 +228,7 @@ guint qemu_chr_fe_add_watch(CharBackend *be, GIOCondition cond,
>    * is thread-safe.
>    *
>    * Returns: the number of bytes consumed (0 if no associated Chardev)
> + *          or -1 on error.
>    */
>   int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len);
>   
> @@ -242,6 +243,7 @@ int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len);
>    * attempted to be written.  This function is thread-safe.
>    *
>    * Returns: the number of bytes consumed (0 if no associated Chardev)
> + *          or -1 on error.
>    */
>   int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len);
>   
> @@ -253,6 +255,7 @@ int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len);
>    * Read data to a buffer from the back end.
>    *
>    * Returns: the number of bytes read (0 if no associated Chardev)
> + *          or -1 on error.
>    */
>   int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len);

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.
diff mbox series

Patch

diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h
index ecef182835..3310449eaf 100644
--- a/include/chardev/char-fe.h
+++ b/include/chardev/char-fe.h
@@ -228,6 +228,7 @@  guint qemu_chr_fe_add_watch(CharBackend *be, GIOCondition cond,
  * is thread-safe.
  *
  * Returns: the number of bytes consumed (0 if no associated Chardev)
+ *          or -1 on error.
  */
 int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len);
 
@@ -242,6 +243,7 @@  int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len);
  * attempted to be written.  This function is thread-safe.
  *
  * Returns: the number of bytes consumed (0 if no associated Chardev)
+ *          or -1 on error.
  */
 int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len);
 
@@ -253,6 +255,7 @@  int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len);
  * Read data to a buffer from the back end.
  *
  * Returns: the number of bytes read (0 if no associated Chardev)
+ *          or -1 on error.
  */
 int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len);