core: fix reading subset of available events
authorKent Gibson <warthog618@gmail.com>
Sat, 12 Sep 2020 08:11:05 +0000 (16:11 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 14 Sep 2020 08:30:40 +0000 (10:30 +0200)
commit02dae47d81db615c374c471c1256674d12b0342f
treefcc57aa684cbe0a3281fa9e054fa7f242eb39cbe
parent82378fa05e7ee8cc43065da21a8ea00d556f6a8a
core: fix reading subset of available events

Only read the requested number of events from the kernel rather than
reading up to 16 and quietly discarding any surplus.

The previous behavour is particularly bad for reading single events as
userspace must read the events as quickly as they arrive, effectively
negating the presence of the kernel event kfifo.

Fixes: 44921ecc9a00 ("core: provide functions for reading multiple line events at once")
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
lib/core.c