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
fe1e8604
Commit
fe1e8604
authored
Sep 10, 2005
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: clean up whitespace and formatting in drivers/char/keyboard.c
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
d344c5e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
54 deletions
+55
-54
drivers/char/keyboard.c
drivers/char/keyboard.c
+55
-54
No files found.
drivers/char/keyboard.c
View file @
fe1e8604
...
@@ -159,11 +159,11 @@ static int sysrq_alt;
...
@@ -159,11 +159,11 @@ static int sysrq_alt;
*/
*/
int
getkeycode
(
unsigned
int
scancode
)
int
getkeycode
(
unsigned
int
scancode
)
{
{
struct
list_head
*
node
;
struct
list_head
*
node
;
struct
input_dev
*
dev
=
NULL
;
struct
input_dev
*
dev
=
NULL
;
list_for_each
(
node
,
&
kbd_handler
.
h_list
)
{
list_for_each
(
node
,
&
kbd_handler
.
h_list
)
{
struct
input_handle
*
handle
=
to_handle_h
(
node
);
struct
input_handle
*
handle
=
to_handle_h
(
node
);
if
(
handle
->
dev
->
keycodesize
)
{
if
(
handle
->
dev
->
keycodesize
)
{
dev
=
handle
->
dev
;
dev
=
handle
->
dev
;
break
;
break
;
...
@@ -181,11 +181,11 @@ int getkeycode(unsigned int scancode)
...
@@ -181,11 +181,11 @@ int getkeycode(unsigned int scancode)
int
setkeycode
(
unsigned
int
scancode
,
unsigned
int
keycode
)
int
setkeycode
(
unsigned
int
scancode
,
unsigned
int
keycode
)
{
{
struct
list_head
*
node
;
struct
list_head
*
node
;
struct
input_dev
*
dev
=
NULL
;
struct
input_dev
*
dev
=
NULL
;
unsigned
int
i
,
oldkey
;
unsigned
int
i
,
oldkey
;
list_for_each
(
node
,
&
kbd_handler
.
h_list
)
{
list_for_each
(
node
,
&
kbd_handler
.
h_list
)
{
struct
input_handle
*
handle
=
to_handle_h
(
node
);
struct
input_handle
*
handle
=
to_handle_h
(
node
);
if
(
handle
->
dev
->
keycodesize
)
{
if
(
handle
->
dev
->
keycodesize
)
{
dev
=
handle
->
dev
;
dev
=
handle
->
dev
;
...
@@ -220,7 +220,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
...
@@ -220,7 +220,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
*/
*/
static
void
kd_nosound
(
unsigned
long
ignored
)
static
void
kd_nosound
(
unsigned
long
ignored
)
{
{
struct
list_head
*
node
;
struct
list_head
*
node
;
list_for_each
(
node
,
&
kbd_handler
.
h_list
)
{
list_for_each
(
node
,
&
kbd_handler
.
h_list
)
{
struct
input_handle
*
handle
=
to_handle_h
(
node
);
struct
input_handle
*
handle
=
to_handle_h
(
node
);
...
@@ -237,12 +237,12 @@ static DEFINE_TIMER(kd_mksound_timer, kd_nosound, 0, 0);
...
@@ -237,12 +237,12 @@ static DEFINE_TIMER(kd_mksound_timer, kd_nosound, 0, 0);
void
kd_mksound
(
unsigned
int
hz
,
unsigned
int
ticks
)
void
kd_mksound
(
unsigned
int
hz
,
unsigned
int
ticks
)
{
{
struct
list_head
*
node
;
struct
list_head
*
node
;
del_timer
(
&
kd_mksound_timer
);
del_timer
(
&
kd_mksound_timer
);
if
(
hz
)
{
if
(
hz
)
{
list_for_each_prev
(
node
,
&
kbd_handler
.
h_list
)
{
list_for_each_prev
(
node
,
&
kbd_handler
.
h_list
)
{
struct
input_handle
*
handle
=
to_handle_h
(
node
);
struct
input_handle
*
handle
=
to_handle_h
(
node
);
if
(
test_bit
(
EV_SND
,
handle
->
dev
->
evbit
))
{
if
(
test_bit
(
EV_SND
,
handle
->
dev
->
evbit
))
{
if
(
test_bit
(
SND_TONE
,
handle
->
dev
->
sndbit
))
{
if
(
test_bit
(
SND_TONE
,
handle
->
dev
->
sndbit
))
{
...
@@ -499,9 +499,9 @@ static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs)
...
@@ -499,9 +499,9 @@ static void fn_dec_console(struct vc_data *vc, struct pt_regs *regs)
if
(
want_console
!=
-
1
)
if
(
want_console
!=
-
1
)
cur
=
want_console
;
cur
=
want_console
;
for
(
i
=
cur
-
1
;
i
!=
cur
;
i
--
)
{
for
(
i
=
cur
-
1
;
i
!=
cur
;
i
--
)
{
if
(
i
==
-
1
)
if
(
i
==
-
1
)
i
=
MAX_NR_CONSOLES
-
1
;
i
=
MAX_NR_CONSOLES
-
1
;
if
(
vc_cons_allocated
(
i
))
if
(
vc_cons_allocated
(
i
))
break
;
break
;
}
}
...
@@ -568,7 +568,7 @@ static void fn_compose(struct vc_data *vc, struct pt_regs *regs)
...
@@ -568,7 +568,7 @@ static void fn_compose(struct vc_data *vc, struct pt_regs *regs)
static
void
fn_spawn_con
(
struct
vc_data
*
vc
,
struct
pt_regs
*
regs
)
static
void
fn_spawn_con
(
struct
vc_data
*
vc
,
struct
pt_regs
*
regs
)
{
{
if
(
spawnpid
)
if
(
spawnpid
)
if
(
kill_proc
(
spawnpid
,
spawnsig
,
1
))
if
(
kill_proc
(
spawnpid
,
spawnsig
,
1
))
spawnpid
=
0
;
spawnpid
=
0
;
}
}
...
@@ -894,11 +894,11 @@ static inline unsigned char getleds(void)
...
@@ -894,11 +894,11 @@ static inline unsigned char getleds(void)
static
void
kbd_bh
(
unsigned
long
dummy
)
static
void
kbd_bh
(
unsigned
long
dummy
)
{
{
struct
list_head
*
node
;
struct
list_head
*
node
;
unsigned
char
leds
=
getleds
();
unsigned
char
leds
=
getleds
();
if
(
leds
!=
ledstate
)
{
if
(
leds
!=
ledstate
)
{
list_for_each
(
node
,
&
kbd_handler
.
h_list
)
{
list_for_each
(
node
,
&
kbd_handler
.
h_list
)
{
struct
input_handle
*
handle
=
to_handle_h
(
node
);
struct
input_handle
*
handle
=
to_handle_h
(
node
);
input_event
(
handle
->
dev
,
EV_LED
,
LED_SCROLLL
,
!!
(
leds
&
0x01
));
input_event
(
handle
->
dev
,
EV_LED
,
LED_SCROLLL
,
!!
(
leds
&
0x01
));
input_event
(
handle
->
dev
,
EV_LED
,
LED_NUML
,
!!
(
leds
&
0x02
));
input_event
(
handle
->
dev
,
EV_LED
,
LED_NUML
,
!!
(
leds
&
0x02
));
...
@@ -1104,8 +1104,9 @@ static void kbd_keycode(unsigned int keycode, int down,
...
@@ -1104,8 +1104,9 @@ static void kbd_keycode(unsigned int keycode, int down,
else
else
clear_bit
(
keycode
,
key_down
);
clear_bit
(
keycode
,
key_down
);
if
(
rep
&&
(
!
vc_kbd_mode
(
kbd
,
VC_REPEAT
)
||
(
tty
&&
if
(
rep
&&
(
!
L_ECHO
(
tty
)
&&
tty
->
driver
->
chars_in_buffer
(
tty
)))))
{
(
!
vc_kbd_mode
(
kbd
,
VC_REPEAT
)
||
(
tty
&&
!
L_ECHO
(
tty
)
&&
tty
->
driver
->
chars_in_buffer
(
tty
))))
{
/*
/*
* Don't repeat a key if the input buffers are not empty and the
* Don't repeat a key if the input buffers are not empty and the
* characters get aren't echoed locally. This makes key repeat
* characters get aren't echoed locally. This makes key repeat
...
@@ -1130,7 +1131,8 @@ static void kbd_keycode(unsigned int keycode, int down,
...
@@ -1130,7 +1131,8 @@ static void kbd_keycode(unsigned int keycode, int down,
type
=
KTYP
(
keysym
);
type
=
KTYP
(
keysym
);
if
(
type
<
0xf0
)
{
if
(
type
<
0xf0
)
{
if
(
down
&&
!
raw_mode
)
to_utf8
(
vc
,
keysym
);
if
(
down
&&
!
raw_mode
)
to_utf8
(
vc
,
keysym
);
return
;
return
;
}
}
...
@@ -1166,8 +1168,6 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
...
@@ -1166,8 +1168,6 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
schedule_console_callback
();
schedule_console_callback
();
}
}
static
char
kbd_name
[]
=
"kbd"
;
/*
/*
* When a keyboard (or other input device) is found, the kbd_connect
* When a keyboard (or other input device) is found, the kbd_connect
* function is called. The function then looks at the device, and if it
* function is called. The function then looks at the device, and if it
...
@@ -1182,9 +1182,10 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
...
@@ -1182,9 +1182,10 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
int
i
;
int
i
;
for
(
i
=
KEY_RESERVED
;
i
<
BTN_MISC
;
i
++
)
for
(
i
=
KEY_RESERVED
;
i
<
BTN_MISC
;
i
++
)
if
(
test_bit
(
i
,
dev
->
keybit
))
break
;
if
(
test_bit
(
i
,
dev
->
keybit
))
break
;
if
(
(
i
==
BTN_MISC
)
&&
!
test_bit
(
EV_SND
,
dev
->
evbit
))
if
(
i
==
BTN_MISC
&&
!
test_bit
(
EV_SND
,
dev
->
evbit
))
return
NULL
;
return
NULL
;
if
(
!
(
handle
=
kmalloc
(
sizeof
(
struct
input_handle
),
GFP_KERNEL
)))
if
(
!
(
handle
=
kmalloc
(
sizeof
(
struct
input_handle
),
GFP_KERNEL
)))
...
@@ -1193,7 +1194,7 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
...
@@ -1193,7 +1194,7 @@ static struct input_handle *kbd_connect(struct input_handler *handler,
handle
->
dev
=
dev
;
handle
->
dev
=
dev
;
handle
->
handler
=
handler
;
handle
->
handler
=
handler
;
handle
->
name
=
kbd_name
;
handle
->
name
=
"kbd"
;
input_open_device
(
handle
);
input_open_device
(
handle
);
kbd_refresh_leds
(
handle
);
kbd_refresh_leds
(
handle
);
...
...
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