Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e91c473f
Commit
e91c473f
authored
Jun 20, 2003
by
Neil Brown
Committed by
Vojtech Pavlik
Jun 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: Three fixes for the uinput userspace input device driver.
parent
2ce738e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
drivers/input/misc/uinput.c
drivers/input/misc/uinput.c
+3
-2
No files found.
drivers/input/misc/uinput.c
View file @
e91c473f
...
@@ -49,11 +49,11 @@ static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned i
...
@@ -49,11 +49,11 @@ static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned i
udev
=
(
struct
uinput_device
*
)
dev
->
private
;
udev
=
(
struct
uinput_device
*
)
dev
->
private
;
udev
->
head
=
(
udev
->
head
+
1
)
%
UINPUT_BUFFER_SIZE
;
udev
->
buff
[
udev
->
head
].
type
=
type
;
udev
->
buff
[
udev
->
head
].
type
=
type
;
udev
->
buff
[
udev
->
head
].
code
=
code
;
udev
->
buff
[
udev
->
head
].
code
=
code
;
udev
->
buff
[
udev
->
head
].
value
=
value
;
udev
->
buff
[
udev
->
head
].
value
=
value
;
do_gettimeofday
(
&
udev
->
buff
[
udev
->
head
].
time
);
do_gettimeofday
(
&
udev
->
buff
[
udev
->
head
].
time
);
udev
->
head
=
(
udev
->
head
+
1
)
%
UINPUT_BUFFER_SIZE
;
wake_up_interruptible
(
&
udev
->
waitq
);
wake_up_interruptible
(
&
udev
->
waitq
);
...
@@ -82,6 +82,7 @@ static int uinput_create_device(struct uinput_device *udev)
...
@@ -82,6 +82,7 @@ static int uinput_create_device(struct uinput_device *udev)
udev
->
dev
->
event
=
uinput_dev_event
;
udev
->
dev
->
event
=
uinput_dev_event
;
udev
->
dev
->
upload_effect
=
uinput_dev_upload_effect
;
udev
->
dev
->
upload_effect
=
uinput_dev_upload_effect
;
udev
->
dev
->
erase_effect
=
uinput_dev_erase_effect
;
udev
->
dev
->
erase_effect
=
uinput_dev_erase_effect
;
udev
->
dev
->
private
=
udev
;
init_waitqueue_head
(
&
(
udev
->
waitq
));
init_waitqueue_head
(
&
(
udev
->
waitq
));
...
@@ -264,7 +265,7 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t
...
@@ -264,7 +265,7 @@ static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t
return
-
ENODEV
;
return
-
ENODEV
;
while
((
udev
->
head
!=
udev
->
tail
)
&&
while
((
udev
->
head
!=
udev
->
tail
)
&&
(
retval
+
sizeof
(
struct
uinput_device
)
<=
count
))
{
(
retval
+
sizeof
(
struct
input_event
)
<=
count
))
{
if
(
copy_to_user
(
buffer
+
retval
,
&
(
udev
->
buff
[
udev
->
tail
]),
if
(
copy_to_user
(
buffer
+
retval
,
&
(
udev
->
buff
[
udev
->
tail
]),
sizeof
(
struct
input_event
)))
return
-
EFAULT
;
sizeof
(
struct
input_event
)))
return
-
EFAULT
;
udev
->
tail
=
(
udev
->
tail
+
1
)
%
UINPUT_BUFFER_SIZE
;
udev
->
tail
=
(
udev
->
tail
+
1
)
%
UINPUT_BUFFER_SIZE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment