Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC - Software
Commits
774e8734
Commit
774e8734
authored
Jul 23, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: improve code readabilty (only code style)
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
bbc146b4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
speclib.c
tools/speclib.c
+18
-17
No files found.
tools/speclib.c
View file @
774e8734
...
...
@@ -83,7 +83,7 @@ static int spec_check_id(int bus, int dev)
static
int
spec_scan
(
int
*
bus
,
int
*
devfn
)
{
struct
dirent
**
namelist
;
int
n
,
i
,
found
=
0
;
int
n
,
i
,
found
=
0
,
ret
;
int
my_bus
,
my_devfn
;
// Automatic search for the first availabe card
...
...
@@ -92,27 +92,28 @@ static int spec_scan(int *bus, int *devfn)
{
perror
(
"scandir"
);
exit
(
-
1
);
}
else
{
for
(
i
=
0
;
i
<
n
;
i
++
)
}
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
!
found
&&
sscanf
(
namelist
[
i
]
->
d_name
,
"0000:%02x:%02x.0"
,
&
my_bus
,
&
my_devfn
)
==
2
)
ret
=
sscanf
(
namelist
[
i
]
->
d_name
,
"0000:%02x:%02x.0"
,
&
my_bus
,
&
my_devfn
);
if
(
!
found
&&
ret
==
2
)
{
if
(
*
bus
>=
0
)
my_bus
=
*
bus
;
if
(
*
devfn
>=
0
)
my_devfn
=
*
devfn
;
if
(
*
bus
>=
0
)
my_bus
=
*
bus
;
if
(
*
devfn
>=
0
)
my_devfn
=
*
devfn
;
if
(
spec_check_id
(
my_bus
,
my_devfn
)
>
0
)
{
*
bus
=
my_bus
;
*
devfn
=
my_devfn
;
found
=
1
;
}
}
free
(
namelist
[
i
]);
}
free
(
namelist
);
}
if
(
!
found
)
{
...
...
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