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
nexedi
linux
Commits
4516c818
Commit
4516c818
authored
Jan 05, 2010
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: serio - use list_first_entry() helper
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
ddf1ffbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
20 deletions
+11
-20
drivers/input/serio/serio.c
drivers/input/serio/serio.c
+11
-20
No files found.
drivers/input/serio/serio.c
View file @
4516c818
...
...
@@ -230,14 +230,12 @@ static void serio_free_event(struct serio_event *event)
static
void
serio_remove_duplicate_events
(
struct
serio_event
*
event
)
{
struct
list_head
*
node
,
*
next
;
struct
serio_event
*
e
;
struct
serio_event
*
e
,
*
next
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
serio_event_lock
,
flags
);
list_for_each_safe
(
node
,
next
,
&
serio_event_list
)
{
e
=
list_entry
(
node
,
struct
serio_event
,
node
);
list_for_each_entry_safe
(
e
,
next
,
&
serio_event_list
,
node
)
{
if
(
event
->
object
==
e
->
object
)
{
/*
* If this event is of different type we should not
...
...
@@ -247,7 +245,7 @@ static void serio_remove_duplicate_events(struct serio_event *event)
if
(
event
->
type
!=
e
->
type
)
break
;
list_del_init
(
node
);
list_del_init
(
&
e
->
node
);
serio_free_event
(
e
);
}
}
...
...
@@ -258,23 +256,18 @@ static void serio_remove_duplicate_events(struct serio_event *event)
static
struct
serio_event
*
serio_get_event
(
void
)
{
struct
serio_event
*
event
;
struct
list_head
*
node
;
struct
serio_event
*
event
=
NULL
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
serio_event_lock
,
flags
);
if
(
list_empty
(
&
serio_event_list
))
{
spin_unlock_irqrestore
(
&
serio_event_lock
,
flags
);
return
NULL
;
if
(
!
list_empty
(
&
serio_event_list
))
{
event
=
list_first_entry
(
&
serio_event_list
,
struct
serio_event
,
node
);
list_del_init
(
&
event
->
node
);
}
node
=
serio_event_list
.
next
;
event
=
list_entry
(
node
,
struct
serio_event
,
node
);
list_del_init
(
node
);
spin_unlock_irqrestore
(
&
serio_event_lock
,
flags
);
return
event
;
}
...
...
@@ -331,16 +324,14 @@ static void serio_handle_event(void)
*/
static
void
serio_remove_pending_events
(
void
*
object
)
{
struct
list_head
*
node
,
*
next
;
struct
serio_event
*
event
;
struct
serio_event
*
event
,
*
next
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
serio_event_lock
,
flags
);
list_for_each_safe
(
node
,
next
,
&
serio_event_list
)
{
event
=
list_entry
(
node
,
struct
serio_event
,
node
);
list_for_each_entry_safe
(
event
,
next
,
&
serio_event_list
,
node
)
{
if
(
event
->
object
==
object
)
{
list_del_init
(
node
);
list_del_init
(
&
event
->
node
);
serio_free_event
(
event
);
}
}
...
...
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