[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/11] chardev: Let chr_sync_read() use unsigned
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v2 05/11] chardev: Let chr_sync_read() use unsigned type |
Date: |
Fri, 12 Oct 2018 02:22:11 +0200 |
Note than tcp_chr_recv() already use size_t.
Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
chardev/char-socket.c | 2 +-
include/chardev/char.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 76cc3c48b0..7e627b243e 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -494,7 +494,7 @@ static gboolean tcp_chr_hup(QIOChannel *channel,
return G_SOURCE_REMOVE;
}
-static int tcp_chr_sync_read(Chardev *chr, const uint8_t *buf, int len)
+static size_t tcp_chr_sync_read(Chardev *chr, const uint8_t *buf, size_t len)
{
SocketChardev *s = SOCKET_CHARDEV(chr);
int size;
diff --git a/include/chardev/char.h b/include/chardev/char.h
index 7becd8c80c..ef4509bfa3 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -251,7 +251,7 @@ typedef struct ChardevClass {
bool *be_opened, Error **errp);
int (*chr_write)(Chardev *s, const uint8_t *buf, int len);
- int (*chr_sync_read)(Chardev *s, const uint8_t *buf, int len);
+ size_t (*chr_sync_read)(Chardev *s, const uint8_t *buf, size_t len);
GSource *(*chr_add_watch)(Chardev *s, GIOCondition cond);
void (*chr_update_read_handler)(Chardev *s);
int (*chr_ioctl)(Chardev *s, int cmd, void *arg);
--
2.17.1
- [Qemu-devel] [PATCH v2 00/11] chardev: Convert IO handlers to use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 01/11] hw/ipmi: Remove unnecessary declarations, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 02/11] target/xtensa: Remove unnecessary declarations, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 03/11] chardev: Simplify IOWatchPoll::fd_can_read as a GSourceFunc, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 04/11] chardev: Assert backend's chr_can_read() is positive, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 05/11] chardev: Let chr_sync_read() use unsigned type,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v2 06/11] chardev: Let chr_write use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 07/11] chardev: Let IOReadHandler use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 09/11] chardev: Let qemu_chr_fe_* use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 08/11] chardev: Let IOCanReadHandler use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 10/11] chardev: Let qemu_chr_be_* use unsigned type, Philippe Mathieu-Daudé, 2018/10/11
- [Qemu-devel] [PATCH v2 11/11] chardev: FDChardev::max_size be unsigned, Philippe Mathieu-Daudé, 2018/10/11
- Re: [Qemu-devel] [PATCH v2 00/11] chardev: Convert IO handlers to use unsigned type, Daniel P . Berrangé, 2018/10/12