[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] Fix input-linux reading from device

From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH v2] Fix input-linux reading from device
Date: Mon, 27 Mar 2017 12:11:39 +0200

On So, 2017-03-26 at 11:53 +0200, Javier Celaya wrote:
> The evdev devices in input-linux.c are read in blocks of one whole
> event. If there are not enough bytes available, they are discarded,
> instead of being kept for the next read operation. This results in
> lost events, of even non-working devices.

Have you seen this happening in practice?

> +    struct input_event event;
> +    int         to_be_read;

I'd suggest to store offset (i.e. bytes already read) instead, should
make the whole logic a bit simpler and easier to read.

> +            } else if (rc > 0){

checkpatch.pl complains here:
ERROR: space required before the open brace '{'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]