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
28e347de
Commit
28e347de
authored
Oct 06, 2003
by
Stephen Hemminger
Committed by
David S. Miller
Oct 06, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IRDA]: Fix BUG() in irlmp seq file code.
parent
1105dc16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
net/irda/irlmp.c
net/irda/irlmp.c
+24
-22
No files found.
net/irda/irlmp.c
View file @
28e347de
...
...
@@ -1787,22 +1787,21 @@ struct irlmp_iter_state {
#define LSAP_START_TOKEN ((void *)1)
#define LINK_START_TOKEN ((void *)2)
static
void
*
irlmp_seq_hb_idx
(
struct
irlmp_iter_state
*
iter
,
hashbin_t
*
bin
,
loff_t
*
off
)
static
void
*
irlmp_seq_hb_idx
(
struct
irlmp_iter_state
*
iter
,
loff_t
*
off
)
{
void
*
element
;
spin_lock_irqsave
(
&
bin
->
hb_spinlock
,
iter
->
flags
);
for
(
element
=
hashbin_get_first
(
bin
);
spin_lock_irqsave
(
&
iter
->
hash
bin
->
hb_spinlock
,
iter
->
flags
);
for
(
element
=
hashbin_get_first
(
iter
->
hash
bin
);
element
!=
NULL
;
element
=
hashbin_get_next
(
bin
))
{
element
=
hashbin_get_next
(
iter
->
hash
bin
))
{
if
(
!
off
||
*
off
--
==
0
)
{
/* NB: hashbin left locked */
iter
->
hashbin
=
bin
;
return
element
;
}
}
spin_unlock_irqrestore
(
&
bin
->
hb_spinlock
,
iter
->
flags
);
spin_unlock_irqrestore
(
&
iter
->
hashbin
->
hb_spinlock
,
iter
->
flags
);
iter
->
hashbin
=
NULL
;
return
NULL
;
}
...
...
@@ -1813,18 +1812,19 @@ static void *irlmp_seq_start(struct seq_file *seq, loff_t *pos)
void
*
v
;
loff_t
off
=
*
pos
;
iter
->
hashbin
=
NULL
;
if
(
off
--
==
0
)
return
LSAP_START_TOKEN
;
v
=
irlmp_seq_hb_idx
(
iter
,
irlmp
->
unconnected_lsaps
,
&
off
);
iter
->
hashbin
=
irlmp
->
unconnected_lsaps
;
v
=
irlmp_seq_hb_idx
(
iter
,
&
off
);
if
(
v
)
return
v
;
if
(
off
--
==
0
)
return
LINK_START_TOKEN
;
return
irlmp_seq_hb_idx
(
iter
,
irlmp
->
links
,
&
off
);
iter
->
hashbin
=
irlmp
->
links
;
return
irlmp_seq_hb_idx
(
iter
,
&
off
);
}
static
void
*
irlmp_seq_next
(
struct
seq_file
*
seq
,
void
*
v
,
loff_t
*
pos
)
...
...
@@ -1833,27 +1833,29 @@ static void *irlmp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*
pos
;
if
(
v
==
LSAP_START_TOKEN
)
{
v
=
irlmp_seq_hb_idx
(
iter
,
irlmp
->
unconnected_lsaps
,
NULL
);
if
(
v
==
LSAP_START_TOKEN
)
{
/* start of list of lsaps */
iter
->
hashbin
=
irlmp
->
unconnected_lsaps
;
v
=
irlmp_seq_hb_idx
(
iter
,
NULL
);
return
v
?
v
:
LINK_START_TOKEN
;
}
if
(
v
==
LINK_START_TOKEN
)
return
irlmp_seq_hb_idx
(
iter
,
irlmp
->
links
,
NULL
)
;
ASSERT
(
iter
->
hashbin
!=
NULL
,
return
NULL
;
);
if
(
v
==
LINK_START_TOKEN
)
{
/* start of list of links */
iter
->
hashbin
=
irlmp
->
links
;
return
irlmp_seq_hb_idx
(
iter
,
NULL
);
}
v
=
hashbin_get_next
(
iter
->
hashbin
);
if
(
v
)
return
v
;
spin_unlock_irqrestore
(
&
iter
->
hashbin
->
hb_spinlock
,
iter
->
flags
);
if
(
v
==
NULL
)
{
/* no more in this hash bin */
spin_unlock_irqrestore
(
&
iter
->
hashbin
->
hb_spinlock
,
iter
->
flags
);
if
(
iter
->
hashbin
==
irlmp
->
unconnected_lsaps
)
v
=
LINK_START_TOKEN
;
if
(
iter
->
hashbin
==
irlmp
->
unconnected_lsaps
)
{
iter
->
hashbin
=
NULL
;
return
LINK_START_TOKEN
;
}
return
NULL
;
return
v
;
}
static
void
irlmp_seq_stop
(
struct
seq_file
*
seq
,
void
*
v
)
...
...
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