@@ -48,11 +48,11 @@ static void rng_egd_request_entropy(RngBackend *b, RngRequest *req)
}
}
-static int rng_egd_chr_can_read(void *opaque)
+static size_t rng_egd_chr_can_read(void *opaque)
{
RngEgd *s = RNG_EGD(opaque);
RngRequest *req;
- int size = 0;
+ size_t size = 0;
QSIMPLEQ_FOREACH(req, &s->parent.requests, next) {
size += req->size - req->offset;
@@ -192,7 +192,7 @@ static void mux_chr_accept_input(Chardev *chr)
}
}
-static int mux_chr_can_read(void *opaque)
+static size_t mux_chr_can_read(void *opaque)
{
MuxChardev *d = MUX_CHARDEV(opaque);
int m = d->focus;
@@ -1916,7 +1916,7 @@ void gdbserver_fork(CPUState *cpu)
cpu_watchpoint_remove_all(cpu, BP_GDB);
}
#else
-static int gdb_chr_can_receive(void *opaque)
+static size_t gdb_chr_can_receive(void *opaque)
{
/* We can handle an arbitrarily large amount of data.
Pick the maximum packet size, which is as good as anything. */
@@ -1923,7 +1923,7 @@ static const MemoryRegionOps pxa2xx_fir_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static int pxa2xx_fir_is_empty(void *opaque)
+static size_t pxa2xx_fir_is_empty(void *opaque)
{
PXA2xxFIrState *s = (PXA2xxFIrState *) opaque;
return (s->rx_len < 64);
@@ -1058,7 +1058,7 @@ static void strongarm_uart_rx_push(StrongARMUARTState *s, uint16_t c)
s->rx_fifo[(s->rx_start + 11) % 12] |= RX_FIFO_ROR;
}
-static int strongarm_uart_can_receive(void *opaque)
+static size_t strongarm_uart_can_receive(void *opaque)
{
StrongARMUARTState *s = opaque;
@@ -211,7 +211,7 @@ static void bcm2835_aux_write(void *opaque, hwaddr offset, uint64_t value,
bcm2835_aux_update(s);
}
-static int bcm2835_aux_can_receive(void *opaque)
+static size_t bcm2835_aux_can_receive(void *opaque)
{
BCM2835AuxState *s = opaque;
@@ -216,10 +216,10 @@ static void uart_parameters_setup(CadenceUARTState *s)
qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
}
-static int uart_can_receive(void *opaque)
+static size_t uart_can_receive(void *opaque)
{
CadenceUARTState *s = opaque;
- int ret = MAX(CADENCE_UART_RX_FIFO_SIZE, CADENCE_UART_TX_FIFO_SIZE);
+ size_t ret = MAX(CADENCE_UART_RX_FIFO_SIZE, CADENCE_UART_TX_FIFO_SIZE);
uint32_t ch_mode = s->r[R_MR] & UART_MR_CHMODE;
if (ch_mode == NORMAL_MODE || ch_mode == ECHO_MODE) {
@@ -108,7 +108,7 @@ static void cmsdk_apb_uart_update(CMSDKAPBUART *s)
qemu_set_irq(s->uartint, !!(s->intstatus));
}
-static int uart_can_receive(void *opaque)
+static size_t uart_can_receive(void *opaque)
{
CMSDKAPBUART *s = CMSDK_APB_UART(opaque);
@@ -112,7 +112,7 @@ static const MemoryRegionOps uart_mmio_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static int uart_can_rx(void *opaque)
+static size_t uart_can_rx(void *opaque)
{
DigicUartState *s = opaque;
@@ -166,7 +166,7 @@
#define R_EXTINT 15
static void handle_kbd_command(ESCCChannelState *s, int val);
-static int serial_can_receive(void *opaque);
+static size_t serial_can_receive(void *opaque);
static void serial_receive_byte(ESCCChannelState *s, int ch);
static void clear_queue(void *opaque)
@@ -573,10 +573,10 @@ static const MemoryRegionOps escc_mem_ops = {
},
};
-static int serial_can_receive(void *opaque)
+static size_t serial_can_receive(void *opaque)
{
ESCCChannelState *s = opaque;
- int ret;
+ size_t ret;
if (((s->wregs[W_RXCTRL] & RXCTRL_RXEN) == 0) // Rx not enabled
|| ((s->rregs[R_STATUS] & STATUS_RXAV) == STATUS_RXAV))
@@ -187,7 +187,7 @@ static void serial_receive(void *opaque, const uint8_t *buf, size_t size)
ser_update_irq(s);
}
-static int serial_can_receive(void *opaque)
+static size_t serial_can_receive(void *opaque)
{
ETRAXSerial *s = opaque;
@@ -487,7 +487,7 @@ static const MemoryRegionOps exynos4210_uart_ops = {
},
};
-static int exynos4210_uart_can_receive(void *opaque)
+static size_t exynos4210_uart_can_receive(void *opaque)
{
Exynos4210UartState *s = (Exynos4210UartState *)opaque;
@@ -130,7 +130,7 @@ static void uart_add_to_fifo(UART *uart,
uart->len += length;
}
-static int grlib_apbuart_can_receive(void *opaque)
+static size_t grlib_apbuart_can_receive(void *opaque)
{
UART *uart = opaque;
@@ -293,7 +293,7 @@ static void imx_serial_write(void *opaque, hwaddr offset,
}
}
-static int imx_can_receive(void *opaque)
+static size_t imx_can_receive(void *opaque)
{
IMXSerialState *s = (IMXSerialState *)opaque;
return !(s->usr1 & USR1_RRDY);
@@ -461,10 +461,10 @@ static void mem_write8(IPackDevice *ip, uint32_t addr, uint8_t val)
}
}
-static int hostdev_can_receive(void *opaque)
+static size_t hostdev_can_receive(void *opaque)
{
SCC2698Channel *ch = opaque;
- int available_bytes = RX_FIFO_SIZE - ch->rx_pending;
+ size_t available_bytes = RX_FIFO_SIZE - ch->rx_pending;
return ch->rx_enabled ? available_bytes : 0;
}
@@ -95,7 +95,7 @@ static void juart_rx(void *opaque, const uint8_t *buf, size_t size)
s->jrx = *buf | JRX_FULL;
}
-static int juart_can_rx(void *opaque)
+static size_t juart_can_rx(void *opaque)
{
LM32JuartState *s = opaque;
@@ -225,7 +225,7 @@ static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
uart_update_irq(s);
}
-static int uart_can_rx(void *opaque)
+static size_t uart_can_rx(void *opaque)
{
LM32UartState *s = opaque;
@@ -267,7 +267,7 @@ static void mcf_uart_event(void *opaque, int event)
}
}
-static int mcf_uart_can_receive(void *opaque)
+static size_t mcf_uart_can_receive(void *opaque)
{
mcf_uart_state *s = (mcf_uart_state *)opaque;
@@ -170,7 +170,7 @@ static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
uart_update_irq(s);
}
-static int uart_can_rx(void *opaque)
+static size_t uart_can_rx(void *opaque)
{
MilkymistUartState *s = opaque;
@@ -513,7 +513,7 @@ static const VMStateDescription vmstate_parallel_isa = {
}
};
-static int parallel_can_receive(void *opaque)
+static size_t parallel_can_receive(void *opaque)
{
return 1;
}
@@ -224,10 +224,10 @@ static void pl011_write(void *opaque, hwaddr offset,
}
}
-static int pl011_can_receive(void *opaque)
+static size_t pl011_can_receive(void *opaque)
{
PL011State *s = (PL011State *)opaque;
- int r;
+ size_t r;
if (s->lcr & 0x10) {
r = s->read_count < 16;
@@ -61,7 +61,7 @@ typedef struct SCLPConsoleLM {
* truncated to the guest in case it doesn't fit into the SCCB.
*/
-static int chr_can_read(void *opaque)
+static size_t chr_can_read(void *opaque)
{
SCLPConsoleLM *scon = opaque;
@@ -47,10 +47,10 @@ typedef struct SCLPConsole {
/* character layer call-back functions */
/* Return number of bytes that fit into iov buffer */
-static int chr_can_read(void *opaque)
+static size_t chr_can_read(void *opaque)
{
SCLPConsole *scon = opaque;
- int avail = SIZE_BUFFER_VT220 - scon->iov_data_len;
+ size_t avail = SIZE_BUFFER_VT220 - scon->iov_data_len;
if (avail == 0) {
scon->notify = true;
@@ -561,7 +561,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr addr, unsigned size)
return ret;
}
-static int serial_can_receive(SerialState *s)
+static size_t serial_can_receive(SerialState *s)
{
if(s->fcr & UART_FCR_FE) {
if (s->recv_fifo.num < UART_FIFO_LENGTH) {
@@ -600,7 +600,7 @@ static void fifo_timeout_int (void *opaque) {
}
}
-static int serial_can_receive1(void *opaque)
+static size_t serial_can_receive1(void *opaque)
{
SerialState *s = opaque;
return serial_can_receive(s);
@@ -300,7 +300,7 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs,
return ret;
}
-static int sh_serial_can_receive(sh_serial_state *s)
+static size_t sh_serial_can_receive(sh_serial_state *s)
{
return s->scr & (1 << 4);
}
@@ -311,7 +311,7 @@ static void sh_serial_receive_break(sh_serial_state *s)
s->sr |= (1 << 4);
}
-static int sh_serial_can_receive1(void *opaque)
+static size_t sh_serial_can_receive1(void *opaque)
{
sh_serial_state *s = opaque;
return sh_serial_can_receive(s);
@@ -21,7 +21,7 @@ typedef struct VIOsPAPRVTYDevice {
#define VIO_SPAPR_VTY_DEVICE(obj) \
OBJECT_CHECK(VIOsPAPRVTYDevice, (obj), TYPE_VIO_SPAPR_VTY_DEVICE)
-static int vty_can_receive(void *opaque)
+static size_t vty_can_receive(void *opaque)
{
VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(opaque);
@@ -38,7 +38,7 @@
#define DB_PRINT(fmt, args...) DB_PRINT_L(1, fmt, ## args)
-static int stm32f2xx_usart_can_receive(void *opaque)
+static size_t stm32f2xx_usart_can_receive(void *opaque)
{
STM32F2XXUsartState *s = opaque;
@@ -38,7 +38,7 @@ typedef struct Terminal3270 {
#define TERMINAL_3270(obj) \
OBJECT_CHECK(Terminal3270, (obj), TYPE_TERMINAL_3270)
-static int terminal_can_read(void *opaque)
+static size_t terminal_can_read(void *opaque)
{
Terminal3270 *t = opaque;
@@ -126,7 +126,7 @@ static void guest_writable(VirtIOSerialPort *port)
}
/* Readiness of the guest to accept data on a port */
-static int chr_can_read(void *opaque)
+static size_t chr_can_read(void *opaque)
{
VirtConsole *vcon = opaque;
@@ -116,7 +116,7 @@ static int ring_free_bytes(struct XenConsole *con)
return (sizeof(intf->in) - space);
}
-static int xencons_can_receive(void *opaque)
+static size_t xencons_can_receive(void *opaque)
{
struct XenConsole *con = opaque;
return ring_free_bytes(con);
@@ -195,7 +195,7 @@ static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
uart_update_irq(s);
}
-static int uart_can_rx(void *opaque)
+static size_t uart_can_rx(void *opaque)
{
XilinxUARTLite *s = opaque;
@@ -307,7 +307,7 @@ static void handle_msg(IPMIBmcExtern *ibe)
k->handle_rsp(ibe->parent.intf, ibe->inbuf[0], ibe->inbuf + 1, ibe->inpos - 1);
}
-static int can_receive(void *opaque)
+static size_t can_receive(void *opaque)
{
return 1;
}
@@ -620,7 +620,7 @@ static void process_msg(IVShmemState *s, int64_t msg, int fd, Error **errp)
}
}
-static int ivshmem_can_receive(void *opaque)
+static size_t ivshmem_can_receive(void *opaque)
{
IVShmemState *s = opaque;
@@ -65,7 +65,7 @@ void htif_symbol_callback(const char *st_name, int st_info, uint64_t st_value,
/*
* Called by the char dev to see if HTIF is ready to accept input.
*/
-static int htif_can_recv(void *opaque)
+static size_t htif_can_recv(void *opaque)
{
return 1;
}
@@ -137,7 +137,7 @@ static void uart_rx(void *opaque, const uint8_t *buf, size_t size)
update_irq(s);
}
-static int uart_can_rx(void *opaque)
+static size_t uart_can_rx(void *opaque)
{
SiFiveUARTState *s = opaque;
@@ -112,7 +112,7 @@ static void ccid_card_vscard_send_init(PassthruState *s)
(uint8_t *)&msg, sizeof(msg));
}
-static int ccid_card_vscard_can_read(void *opaque)
+static size_t ccid_card_vscard_can_read(void *opaque)
{
PassthruState *card = opaque;
@@ -421,7 +421,7 @@ static void usb_serial_handle_data(USBDevice *dev, USBPacket *p)
}
}
-static int usb_serial_can_read(void *opaque)
+static size_t usb_serial_can_read(void *opaque)
{
USBSerialState *s = opaque;
@@ -1284,7 +1284,7 @@ static void usbredir_do_attach(void *opaque)
* chardev callbacks
*/
-static int usbredir_chardev_can_read(void *opaque)
+static size_t usbredir_chardev_can_read(void *opaque)
{
USBRedirDevice *dev = opaque;
@@ -182,7 +182,7 @@ typedef void IOReadHandler(void *opaque, const uint8_t *buf, size_t size);
* is called again. aio_notify() or qemu_notify_event() can be used to kick
* the event loop.
*/
-typedef int IOCanReadHandler(void *opaque);
+typedef size_t IOCanReadHandler(void *opaque);
/**
* qemu_set_fd_handler: Register a file descriptor with the main loop
@@ -4038,7 +4038,7 @@ cleanup:
free_cmdline_args(args, nb_args);
}
-static int monitor_can_read(void *opaque)
+static size_t monitor_can_read(void *opaque)
{
Monitor *mon = opaque;
@@ -683,7 +683,7 @@ err:
return ret < 0 ? ret : -EIO;
}
-static int compare_chr_can_read(void *opaque)
+static size_t compare_chr_can_read(void *opaque)
{
return COMPARE_READ_LEN_MAX;
}
@@ -114,7 +114,7 @@ static void redirector_to_filter(NetFilterState *nf,
}
}
-static int redirector_chr_can_read(void *opaque)
+static size_t redirector_chr_can_read(void *opaque)
{
return REDIRECTOR_MAX_LEN;
}
@@ -712,7 +712,7 @@ struct GuestFwd {
Slirp *slirp;
};
-static int guestfwd_can_read(void *opaque)
+static size_t guestfwd_can_read(void *opaque)
{
struct GuestFwd *fwd = opaque;
return slirp_socket_can_recv(fwd->slirp, fwd->server, fwd->port);
@@ -665,7 +665,7 @@ static void qtest_read(void *opaque, const uint8_t *buf, size_t size)
qtest_process_inbuf(chr, inbuf);
}
-static int qtest_can_read(void *opaque)
+static size_t qtest_can_read(void *opaque)
{
return 1024;
}
@@ -161,7 +161,7 @@ typedef struct XtensaSimConsole {
static XtensaSimConsole *sim_console;
-static int sim_console_can_read(void *opaque)
+static size_t sim_console_can_read(void *opaque)
{
XtensaSimConsole *p = opaque;
Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- backends/rng-egd.c | 4 ++-- chardev/char-mux.c | 2 +- gdbstub.c | 2 +- hw/arm/pxa2xx.c | 2 +- hw/arm/strongarm.c | 2 +- hw/char/bcm2835_aux.c | 2 +- hw/char/cadence_uart.c | 4 ++-- hw/char/cmsdk-apb-uart.c | 2 +- hw/char/digic-uart.c | 2 +- hw/char/escc.c | 6 +++--- hw/char/etraxfs_ser.c | 2 +- hw/char/exynos4210_uart.c | 2 +- hw/char/grlib_apbuart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/ipoctal232.c | 4 ++-- hw/char/lm32_juart.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/mcf_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/parallel.c | 2 +- hw/char/pl011.c | 4 ++-- hw/char/sclpconsole-lm.c | 2 +- hw/char/sclpconsole.c | 4 ++-- hw/char/serial.c | 4 ++-- hw/char/sh_serial.c | 4 ++-- hw/char/spapr_vty.c | 2 +- hw/char/stm32f2xx_usart.c | 2 +- hw/char/terminal3270.c | 2 +- hw/char/virtio-console.c | 2 +- hw/char/xen_console.c | 2 +- hw/char/xilinx_uartlite.c | 2 +- hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/misc/ivshmem.c | 2 +- hw/riscv/riscv_htif.c | 2 +- hw/riscv/sifive_uart.c | 2 +- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-serial.c | 2 +- hw/usb/redirect.c | 2 +- include/qemu/main-loop.h | 2 +- monitor.c | 2 +- net/colo-compare.c | 2 +- net/filter-mirror.c | 2 +- net/slirp.c | 2 +- qtest.c | 2 +- target/xtensa/xtensa-semi.c | 2 +- 45 files changed, 54 insertions(+), 54 deletions(-)