[Qemu-devel] [PATCH v3 22/25] s390x/sclp: Let write_console_data() take a size_t

Philippe Mathieu-Daudé posted 25 patches 6 years, 8 months ago
Maintainers: Anthony Perard <anthony.perard@citrix.com>, Li Zhijian <lizhijian@cn.fujitsu.com>, Jason Wang <jasowang@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Amit Shah <amit@kernel.org>, "Michael S. Tsirkin" <mst@redhat.com>, Paul Durrant <paul.durrant@citrix.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@de.ibm.com>, David Gibson <david@gibson.dropbear.id.au>, Zhang Chen <zhangckid@gmail.com>, Corey Minyard <minyard@acm.org>, Gerd Hoffmann <kraxel@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Berger <stefanb@linux.ibm.com>, Samuel Thibault <samuel.thibault@ens-lyon.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
[Qemu-devel] [PATCH v3 22/25] s390x/sclp: Let write_console_data() take a size_t
Posted by Philippe Mathieu-Daudé 6 years, 8 months ago
Since all callers provide an unsigned value, we can safely
use a size_t argument.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/char/sclpconsole-lm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index 48c76d863e..290d3118a5 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -191,7 +191,7 @@ static int read_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr,
  *  - write console data to character layer
  *  returns < 0 if an error occurred
  */
-static int write_console_data(SCLPEvent *event, const uint8_t *buf, int len)
+static int write_console_data(SCLPEvent *event, const uint8_t *buf, size_t len)
 {
     SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
 
-- 
2.20.1


Re: [Qemu-devel] [PATCH v3 22/25] s390x/sclp: Let write_console_data() take a size_t
Posted by Cornelia Huck 6 years, 8 months ago
On Wed, 20 Feb 2019 02:02:29 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> Since all callers provide an unsigned value, we can safely
> use a size_t argument.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/char/sclpconsole-lm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>