[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/4] chardev: src buffer const for write functions
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 2/4] chardev: src buffer const for write functions |
Date: |
Wed, 7 Sep 2022 00:41:02 +0200 |
On Wed, Sep 7, 2022 at 12:07 AM Arwed Meyer <arwed.meyer@gmx.de> wrote:
>
> Make source buffers const for char be write functions.
> This allows using buffers returned by fifo as buf parameter and source buffer
> should not be changed by write functions anyway.
>
> Signed-off-by: Arwed Meyer <arwed.meyer@gmx.de>
> ---
> chardev/char.c | 4 ++--
> include/chardev/char.h | 4 ++--
> include/sysemu/replay.h | 2 +-
> replay/replay-char.c | 2 +-
> stubs/replay-tools.c | 2 +-
> 5 files changed, 7 insertions(+), 7 deletions(-)
> diff --git a/include/chardev/char.h b/include/chardev/char.h
> index a319b5fdff..44cd82e405 100644
> --- a/include/chardev/char.h
> +++ b/include/chardev/char.h
> @@ -186,7 +186,7 @@ int qemu_chr_be_can_write(Chardev *s);
> * the caller should call @qemu_chr_be_can_write to determine how much data
> * the front end can currently accept.
> */
> -void qemu_chr_be_write(Chardev *s, uint8_t *buf, int len);
> +void qemu_chr_be_write(Chardev *s, const uint8_t *buf, int len);
>
> /**
> * qemu_chr_be_write_impl:
> @@ -195,7 +195,7 @@ void qemu_chr_be_write(Chardev *s, uint8_t *buf, int len);
> *
> * Implementation of back end writing. Used by replay module.
> */
> -void qemu_chr_be_write_impl(Chardev *s, uint8_t *buf, int len);
> +void qemu_chr_be_write_impl(Chardev *s, const uint8_t *buf, int len);
Doh this reminds me of this series:
https://lore.kernel.org/qemu-devel/20190220010232.18731-1-philmd@redhat.com/