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
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
Show 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 {
...
@@ -1787,22 +1787,21 @@ struct irlmp_iter_state {
#define LSAP_START_TOKEN ((void *)1)
#define LSAP_START_TOKEN ((void *)1)
#define LINK_START_TOKEN ((void *)2)
#define LINK_START_TOKEN ((void *)2)
static
void
*
irlmp_seq_hb_idx
(
struct
irlmp_iter_state
*
iter
,
static
void
*
irlmp_seq_hb_idx
(
struct
irlmp_iter_state
*
iter
,
loff_t
*
off
)
hashbin_t
*
bin
,
loff_t
*
off
)
{
{
void
*
element
;
void
*
element
;
spin_lock_irqsave
(
&
bin
->
hb_spinlock
,
iter
->
flags
);
spin_lock_irqsave
(
&
iter
->
hash
bin
->
hb_spinlock
,
iter
->
flags
);
for
(
element
=
hashbin_get_first
(
bin
);
for
(
element
=
hashbin_get_first
(
iter
->
hash
bin
);
element
!=
NULL
;
element
!=
NULL
;
element
=
hashbin_get_next
(
bin
))
{
element
=
hashbin_get_next
(
iter
->
hash
bin
))
{
if
(
!
off
||
*
off
--
==
0
)
{
if
(
!
off
||
*
off
--
==
0
)
{
/* NB: hashbin left locked */
/* NB: hashbin left locked */
iter
->
hashbin
=
bin
;
return
element
;
return
element
;
}
}
}
}
spin_unlock_irqrestore
(
&
bin
->
hb_spinlock
,
iter
->
flags
);
spin_unlock_irqrestore
(
&
iter
->
hashbin
->
hb_spinlock
,
iter
->
flags
);
iter
->
hashbin
=
NULL
;
return
NULL
;
return
NULL
;
}
}
...
@@ -1813,18 +1812,19 @@ static void *irlmp_seq_start(struct seq_file *seq, loff_t *pos)
...
@@ -1813,18 +1812,19 @@ static void *irlmp_seq_start(struct seq_file *seq, loff_t *pos)
void
*
v
;
void
*
v
;
loff_t
off
=
*
pos
;
loff_t
off
=
*
pos
;
iter
->
hashbin
=
NULL
;
if
(
off
--
==
0
)
if
(
off
--
==
0
)
return
LSAP_START_TOKEN
;
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
)
if
(
v
)
return
v
;
return
v
;
if
(
off
--
==
0
)
if
(
off
--
==
0
)
return
LINK_START_TOKEN
;
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
)
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)
...
@@ -1833,27 +1833,29 @@ static void *irlmp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*
pos
;
++*
pos
;
if
(
v
==
LSAP_START_TOKEN
)
{
if
(
v
==
LSAP_START_TOKEN
)
{
/* start of list of lsaps */
v
=
irlmp_seq_hb_idx
(
iter
,
irlmp
->
unconnected_lsaps
,
NULL
);
iter
->
hashbin
=
irlmp
->
unconnected_lsaps
;
v
=
irlmp_seq_hb_idx
(
iter
,
NULL
);
return
v
?
v
:
LINK_START_TOKEN
;
return
v
?
v
:
LINK_START_TOKEN
;
}
}
if
(
v
==
LINK_START_TOKEN
)
if
(
v
==
LINK_START_TOKEN
)
{
/* start of list of links */
return
irlmp_seq_hb_idx
(
iter
,
irlmp
->
links
,
NULL
)
;
iter
->
hashbin
=
irlmp
->
links
;
return
irlmp_seq_hb_idx
(
iter
,
NULL
);
ASSERT
(
iter
->
hashbin
!=
NULL
,
return
NULL
;
);
}
v
=
hashbin_get_next
(
iter
->
hashbin
);
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
;
iter
->
hashbin
=
NULL
;
return
LINK_START_TOKEN
;
}
}
return
NULL
;
return
v
;
}
}
static
void
irlmp_seq_stop
(
struct
seq_file
*
seq
,
void
*
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