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
5b48a707
Commit
5b48a707
authored
Sep 18, 2003
by
Vojtech Pavlik
Committed by
Vojtech Pavlik
Sep 18, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input.h, keyboard.c, evdev.c:
Fix the INPUT_KEYCODE macro and its usage.
parent
3ff4090c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
drivers/char/keyboard.c
drivers/char/keyboard.c
+1
-1
drivers/input/evdev.c
drivers/input/evdev.c
+5
-7
include/linux/input.h
include/linux/input.h
+1
-1
No files found.
drivers/char/keyboard.c
View file @
5b48a707
...
@@ -205,7 +205,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
...
@@ -205,7 +205,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
INPUT_KEYCODE
(
dev
,
scancode
)
=
keycode
;
INPUT_KEYCODE
(
dev
,
scancode
)
=
keycode
;
for
(
i
=
0
;
i
<
dev
->
keycodemax
;
i
++
)
for
(
i
=
0
;
i
<
dev
->
keycodemax
;
i
++
)
if
(
INPUT_KEYCODE
(
dev
,
scancode
)
==
oldkey
)
if
(
keycode
==
oldkey
)
break
;
break
;
if
(
i
==
dev
->
keycodemax
)
if
(
i
==
dev
->
keycodemax
)
clear_bit
(
oldkey
,
dev
->
keybit
);
clear_bit
(
oldkey
,
dev
->
keybit
);
...
...
drivers/input/evdev.c
View file @
5b48a707
...
@@ -208,7 +208,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -208,7 +208,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
struct
evdev
*
evdev
=
list
->
evdev
;
struct
evdev
*
evdev
=
list
->
evdev
;
struct
input_dev
*
dev
=
evdev
->
handle
.
dev
;
struct
input_dev
*
dev
=
evdev
->
handle
.
dev
;
struct
input_absinfo
abs
;
struct
input_absinfo
abs
;
int
i
,
t
,
u
;
int
i
,
t
,
u
,
v
;
if
(
!
evdev
->
exist
)
return
-
ENODEV
;
if
(
!
evdev
->
exist
)
return
-
ENODEV
;
...
@@ -239,14 +239,12 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -239,14 +239,12 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case
EVIOCSKEYCODE
:
case
EVIOCSKEYCODE
:
if
(
get_user
(
t
,
((
int
*
)
arg
)
+
0
))
return
-
EFAULT
;
if
(
get_user
(
t
,
((
int
*
)
arg
)
+
0
))
return
-
EFAULT
;
if
(
t
<
0
||
t
>
dev
->
keycodemax
||
!
dev
->
keycodesize
)
return
-
EINVAL
;
if
(
t
<
0
||
t
>
dev
->
keycodemax
||
!
dev
->
keycodesize
)
return
-
EINVAL
;
if
(
get_user
(
v
,
((
int
*
)
arg
)
+
1
))
return
-
EFAULT
;
u
=
INPUT_KEYCODE
(
dev
,
t
);
u
=
INPUT_KEYCODE
(
dev
,
t
);
if
(
get_user
(
INPUT_KEYCODE
(
dev
,
t
),
((
int
*
)
arg
)
+
1
))
return
-
EFAULT
;
INPUT_KEYCODE
(
dev
,
t
)
=
v
;
for
(
i
=
0
;
i
<
dev
->
keycodemax
;
i
++
)
if
(
v
==
u
)
break
;
for
(
i
=
0
;
i
<
dev
->
keycodemax
;
i
++
)
if
(
INPUT_KEYCODE
(
dev
,
t
)
==
u
)
break
;
if
(
i
==
dev
->
keycodemax
)
clear_bit
(
u
,
dev
->
keybit
);
if
(
i
==
dev
->
keycodemax
)
clear_bit
(
u
,
dev
->
keybit
);
set_bit
(
INPUT_KEYCODE
(
dev
,
t
),
dev
->
keybit
);
set_bit
(
v
,
dev
->
keybit
);
return
0
;
return
0
;
case
EVIOCSFF
:
case
EVIOCSFF
:
...
...
include/linux/input.h
View file @
5b48a707
...
@@ -751,7 +751,7 @@ struct ff_effect {
...
@@ -751,7 +751,7 @@ struct ff_effect {
#define LONG(x) ((x)/BITS_PER_LONG)
#define LONG(x) ((x)/BITS_PER_LONG)
#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
((dev->keycodesize ==
1
) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
((dev->keycodesize ==
2
) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
#define init_input_dev(dev) do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0)
#define init_input_dev(dev) do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0)
...
...
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