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
a2c48d59
Commit
a2c48d59
authored
Mar 28, 2003
by
Jean Tourrilhes
Committed by
Linus Torvalds
Mar 28, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] : IrDA timer fix
o [FEATURE] Make IrDA timers use mod_timer instead of add+del_timer
parent
5a0b3027
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
net/irda/timer.c
net/irda/timer.c
+7
-9
No files found.
net/irda/timer.c
View file @
a2c48d59
...
...
@@ -39,8 +39,8 @@ static void irlap_query_timer_expired(void* data);
static
void
irlap_final_timer_expired
(
void
*
data
);
static
void
irlap_wd_timer_expired
(
void
*
data
);
static
void
irlap_backoff_timer_expired
(
void
*
data
);
static
void
irlap_media_busy_expired
(
void
*
data
);
/*
* Function irda_start_timer (timer, timeout)
*
...
...
@@ -50,19 +50,18 @@ static void irlap_media_busy_expired(void* data);
void
irda_start_timer
(
struct
timer_list
*
ptimer
,
int
timeout
,
void
*
data
,
TIMER_CALLBACK
callback
)
{
del_timer
(
ptimer
);
ptimer
->
data
=
(
unsigned
long
)
data
;
/*
* For most architectures void * is the same as unsigned long, but
* at least we try to use void * as long as possible. Since the
* timer functions use unsigned long, we cast the function here
*/
ptimer
->
function
=
(
void
(
*
)(
unsigned
long
))
callback
;
ptimer
->
expires
=
jiffies
+
timeout
;
ptimer
->
data
=
(
unsigned
long
)
data
;
add_timer
(
ptimer
);
/* Set new value for timer (update or add timer).
* We use mod_timer() because it's more efficient and also
* safer with respect to race conditions - Jean II */
mod_timer
(
ptimer
,
jiffies
+
timeout
);
}
void
irlap_start_slot_timer
(
struct
irlap_cb
*
self
,
int
timeout
)
...
...
@@ -136,8 +135,7 @@ void irlmp_start_idle_timer(struct lap_cb *self, int timeout)
void
irlmp_stop_idle_timer
(
struct
lap_cb
*
self
)
{
/* If timer is activated, kill it! */
if
(
timer_pending
(
&
self
->
idle_timer
))
del_timer
(
&
self
->
idle_timer
);
del_timer
(
&
self
->
idle_timer
);
}
/*
...
...
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