Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FPGA Configuration Space
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
FPGA Configuration Space
Commits
c946598e
Commit
c946598e
authored
May 22, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdbfs/userspace: trivially indent dirs in sdb-read
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
4879a26b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
sdb-read.c
sdbfs/userspace/sdb-read.c
+11
-6
No files found.
sdbfs/userspace/sdb-read.c
View file @
c946598e
...
...
@@ -38,13 +38,15 @@ static int do_read(struct sdbfs *fs, int offset, void *buf, int count)
}
/* Boring ascii representation of a device */
static
void
list_device
(
struct
sdb_device
*
d
)
static
void
list_device
(
struct
sdb_device
*
d
,
int
depth
)
{
struct
sdb_product
*
p
;
struct
sdb_component
*
c
;
static
int
warned
;
int
i
;
c
=
&
d
->
sdb_component
;
p
=
&
c
->
product
;
static
int
warned
;
if
(
!
opt_long
)
{
printf
(
"%.19s
\n
"
,
p
->
name
);
...
...
@@ -57,10 +59,13 @@ static void list_device(struct sdb_device *d)
warned
=
1
;
}
printf
(
"%016llx:%08x @ %08llx-%08llx %.19s
\n
"
,
/* hack: show directory level looking at the internals */
printf
(
"%016llx:%08x @ %08llx-%08llx "
,
ntohll
(
p
->
vendor_id
),
ntohl
(
p
->
device_id
),
ntohll
(
c
->
addr_first
),
ntohll
(
c
->
addr_last
),
p
->
name
);
ntohll
(
c
->
addr_first
),
ntohll
(
c
->
addr_last
));
for
(
i
=
0
;
i
<
depth
;
i
++
)
printf
(
" "
);
printf
(
"%.19s
\n
"
,
p
->
name
);
}
/* The following three function perform the real work, main() is just glue */
...
...
@@ -70,7 +75,7 @@ static void do_list(struct sdbfs *fs)
int
new
=
1
;
while
(
(
d
=
sdbfs_scan
(
fs
,
new
))
!=
NULL
)
{
list_device
(
d
);
list_device
(
d
,
fs
->
depth
);
new
=
0
;
}
}
...
...
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