Commit c375a87e authored by Alessandro Rubini's avatar Alessandro Rubini

sdbfs/userspace: trivially indent dirs in sdb-read

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 60548518
...@@ -38,13 +38,15 @@ static int do_read(struct sdbfs *fs, int offset, void *buf, int count) ...@@ -38,13 +38,15 @@ static int do_read(struct sdbfs *fs, int offset, void *buf, int count)
} }
/* Boring ascii representation of a device */ /* 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_product *p;
struct sdb_component *c; struct sdb_component *c;
static int warned;
int i;
c = &d->sdb_component; c = &d->sdb_component;
p = &c->product; p = &c->product;
static int warned;
if (!opt_long) { if (!opt_long) {
printf("%.19s\n", p->name); printf("%.19s\n", p->name);
...@@ -57,10 +59,13 @@ static void list_device(struct sdb_device *d) ...@@ -57,10 +59,13 @@ static void list_device(struct sdb_device *d)
warned = 1; 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(p->vendor_id), ntohl(p->device_id),
ntohll(c->addr_first), ntohll(c->addr_last), ntohll(c->addr_first), ntohll(c->addr_last));
p->name); for (i = 0; i < depth; i++)
printf(" ");
printf("%.19s\n", p->name);
} }
/* The following three function perform the real work, main() is just glue */ /* The following three function perform the real work, main() is just glue */
...@@ -70,7 +75,7 @@ static void do_list(struct sdbfs *fs) ...@@ -70,7 +75,7 @@ static void do_list(struct sdbfs *fs)
int new = 1; int new = 1;
while ( (d = sdbfs_scan(fs, new)) != NULL) { while ( (d = sdbfs_scan(fs, new)) != NULL) {
list_device(d); list_device(d, fs->depth);
new = 0; new = 0;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment