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
fb8004d3
Commit
fb8004d3
authored
Mar 30, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
silicom: unobfuscate get_{status,master}_port_fn()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
7e1be8a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
48 deletions
+19
-48
drivers/staging/silicom/bp_mod.c
drivers/staging/silicom/bp_mod.c
+19
-48
No files found.
drivers/staging/silicom/bp_mod.c
View file @
fb8004d3
...
...
@@ -1728,62 +1728,33 @@ int gpio6_clear_fn(bpctl_dev_t *pbpctl_dev)
}
#endif
/*BYPASS_DEBUG */
static
bpctl_dev_t
*
get_status_port_fn
(
bpctl_dev_t
*
pbpctl_
dev
)
static
bpctl_dev_t
*
lookup_port
(
bpctl_dev_t
*
dev
)
{
int
idx_dev
=
0
;
if
(
pbpctl_dev
==
NULL
)
return
NULL
;
if
((
pbpctl_dev
->
func
==
0
)
||
(
pbpctl_dev
->
func
==
2
))
{
for
(
idx_dev
=
0
;
((
bpctl_dev_arr
[
idx_dev
].
pdev
!=
NULL
)
&&
(
idx_dev
<
device_num
));
idx_dev
++
)
{
if
((
bpctl_dev_arr
[
idx_dev
].
bus
==
pbpctl_dev
->
bus
)
&&
(
bpctl_dev_arr
[
idx_dev
].
slot
==
pbpctl_dev
->
slot
)
&&
((
bpctl_dev_arr
[
idx_dev
].
func
==
1
)
&&
(
pbpctl_dev
->
func
==
0
)))
{
return
&
(
bpctl_dev_arr
[
idx_dev
]);
bpctl_dev_t
*
p
;
int
n
;
for
(
n
=
0
,
p
=
bpctl_dev_arr
;
n
<
device_num
&&
p
->
pdev
;
n
++
)
{
if
(
p
->
bus
==
dev
->
bus
&&
p
->
slot
==
dev
->
slot
&&
p
->
func
==
(
dev
->
func
^
1
))
return
p
;
}
if
((
bpctl_dev_arr
[
idx_dev
].
bus
==
pbpctl_dev
->
bus
)
&&
(
bpctl_dev_arr
[
idx_dev
].
slot
==
pbpctl_dev
->
slot
)
&&
((
bpctl_dev_arr
[
idx_dev
].
func
==
3
)
&&
(
pbpctl_dev
->
func
==
2
)))
{
return
NULL
;
}
return
&
(
bpctl_dev_arr
[
idx_dev
]);
}
}
static
bpctl_dev_t
*
get_status_port_fn
(
bpctl_dev_t
*
pbpctl_dev
)
{
if
(
pbpctl_dev
)
{
if
(
pbpctl_dev
->
func
==
0
||
pbpctl_dev
->
func
==
2
)
return
lookup_port
(
pbpctl_dev
);
}
return
NULL
;
}
static
bpctl_dev_t
*
get_master_port_fn
(
bpctl_dev_t
*
pbpctl_dev
)
{
int
idx_dev
=
0
;
if
(
pbpctl_dev
==
NULL
)
return
NULL
;
if
((
pbpctl_dev
->
func
==
1
)
||
(
pbpctl_dev
->
func
==
3
))
{
for
(
idx_dev
=
0
;
((
bpctl_dev_arr
[
idx_dev
].
pdev
!=
NULL
)
&&
(
idx_dev
<
device_num
));
idx_dev
++
)
{
if
((
bpctl_dev_arr
[
idx_dev
].
bus
==
pbpctl_dev
->
bus
)
&&
(
bpctl_dev_arr
[
idx_dev
].
slot
==
pbpctl_dev
->
slot
)
&&
((
bpctl_dev_arr
[
idx_dev
].
func
==
0
)
&&
(
pbpctl_dev
->
func
==
1
)))
{
return
&
(
bpctl_dev_arr
[
idx_dev
]);
}
if
((
bpctl_dev_arr
[
idx_dev
].
bus
==
pbpctl_dev
->
bus
)
&&
(
bpctl_dev_arr
[
idx_dev
].
slot
==
pbpctl_dev
->
slot
)
&&
((
bpctl_dev_arr
[
idx_dev
].
func
==
2
)
&&
(
pbpctl_dev
->
func
==
3
)))
{
return
&
(
bpctl_dev_arr
[
idx_dev
]);
}
}
if
(
pbpctl_dev
)
{
if
(
pbpctl_dev
->
func
==
1
||
pbpctl_dev
->
func
==
3
)
return
lookup_port
(
pbpctl_dev
);
}
return
NULL
;
}
...
...
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