projects
/
platform
/
upstream
/
libevdev.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7889b46
)
Fix queue_num_free_elements
author
Peter Hutterer
<peter.hutterer@who-t.net>
Sun, 9 Jun 2013 10:11:39 +0000
(20:11 +1000)
committer
Peter Hutterer
<peter.hutterer@who-t.net>
Thu, 27 Jun 2013 00:41:54 +0000
(10:41 +1000)
Return 0 for an unallocated queue, and return the actual number of events (rather than one too
little).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libevdev/libevdev-int.h
patch
|
blob
|
history
diff --git
a/libevdev/libevdev-int.h
b/libevdev/libevdev-int.h
index
43cfe8a
..
5d3502a
100644
(file)
--- a/
libevdev/libevdev-int.h
+++ b/
libevdev/libevdev-int.h
@@
-208,7
+208,10
@@
queue_size(struct libevdev *dev)
static inline size_t
queue_num_free_elements(struct libevdev *dev)
{
- return dev->queue_size - dev->queue_next - 1;
+ if (dev->queue_size == 0)
+ return 0;
+
+ return dev->queue_size - dev->queue_next;
}
static inline struct input_event *