diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-06-10 15:16:15 +0200 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-12-05 23:04:09 +0700 |
commit | 774a3437ffa538cd1c82d6944f94476b44f26731 (patch) | |
tree | 72a09764ed5de7a41712784a903661ec7a93544d /drivers/hid/hid-roccat-koneplus.c | |
parent | 2c89e7383bd49866a075435ecaee36d90d6b3983 (diff) | |
download | kernel_samsung_aries-774a3437ffa538cd1c82d6944f94476b44f26731.zip kernel_samsung_aries-774a3437ffa538cd1c82d6944f94476b44f26731.tar.gz kernel_samsung_aries-774a3437ffa538cd1c82d6944f94476b44f26731.tar.bz2 |
HID: uhid: allow poll()'ing on uhid devices
As long as the internal buffer is not empty, we return POLLIN to
user-space.
uhid->head and uhid->tail are no atomics so the comparison may return
inexact results. However, this doesn't matter here as user-space would
need to poll() in two threads simultaneously to trigger this. And in this
case it doesn't matter if a cached result is returned or the exact new
result as user-space does not know which thread returns first from poll()
and the following read(). So it is safe to compare the values without
locking.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat-koneplus.c')
0 files changed, 0 insertions, 0 deletions