Unwind a bit more cruft - we only have one type of device now.
This commit is contained in:
parent
62a4bb5509
commit
246449f3e3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71879
@ -75,7 +75,7 @@ struct file_list {
|
||||
#define ISDUP 32
|
||||
|
||||
struct device {
|
||||
int d_type; /* DEVICE, bus adaptor */
|
||||
int d_done; /* processed */
|
||||
char *d_name; /* name of device (e.g. rk11) */
|
||||
int d_count; /* device count */
|
||||
#define QUES -1 /* -1 means '?' */
|
||||
|
@ -277,7 +277,6 @@ Device_spec:
|
||||
op->op_line = yyline;
|
||||
opt = op;
|
||||
/* and the device part */
|
||||
cur.d_type = DEVICE;
|
||||
cur.d_name = $2;
|
||||
cur.d_count = UNKNOWN;
|
||||
} |
|
||||
@ -291,7 +290,6 @@ Device_spec:
|
||||
op->op_line = yyline;
|
||||
opt = op;
|
||||
/* and the device part */
|
||||
cur.d_type = DEVICE;
|
||||
cur.d_name = $2;
|
||||
cur.d_count = $3;
|
||||
if (cur.d_count == 0)
|
||||
@ -319,7 +317,6 @@ newdev(struct device *dp)
|
||||
memset(np, 0, sizeof(*np));
|
||||
*np = *dp;
|
||||
np->d_name = dp->d_name;
|
||||
np->d_type = dp->d_type;
|
||||
np->d_count = dp->d_count;
|
||||
np->d_next = 0;
|
||||
if (curp == 0)
|
||||
|
@ -68,8 +68,7 @@ headers(void)
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
if (eq(dp->d_name, fl->f_needs)) {
|
||||
match++;
|
||||
if ((dp->d_type & TYPEMASK) == DEVICE)
|
||||
dp->d_type |= DEVDONE;
|
||||
dp->d_done |= DEVDONE;
|
||||
}
|
||||
}
|
||||
if (fl->f_flags & NEED_COUNT)
|
||||
@ -77,11 +76,9 @@ headers(void)
|
||||
}
|
||||
}
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
if ((dp->d_type & TYPEMASK) == DEVICE) {
|
||||
if (!(dp->d_type & DEVDONE))
|
||||
errx(1, "Error: device \"%s\" is unknown",
|
||||
dp->d_name);
|
||||
}
|
||||
if (!(dp->d_done & DEVDONE))
|
||||
errx(1, "Error: device \"%s\" is unknown",
|
||||
dp->d_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -480,8 +480,7 @@ read_files(void)
|
||||
goto invis;
|
||||
for (dp = dtab; dp != 0; save_dp = dp, dp = dp->d_next)
|
||||
if (eq(dp->d_name, wd)) {
|
||||
if (std && dp->d_type == DEVICE &&
|
||||
dp->d_count <= 0)
|
||||
if (std && dp->d_count <= 0)
|
||||
dp->d_count = 1;
|
||||
goto nextparam;
|
||||
}
|
||||
@ -493,7 +492,6 @@ read_files(void)
|
||||
if (std) {
|
||||
dp = (struct device *) malloc(sizeof *dp);
|
||||
bzero(dp, sizeof *dp);
|
||||
dp->d_type = DEVICE;
|
||||
dp->d_name = ns(wd);
|
||||
dp->d_count = 1;
|
||||
save_dp->d_next = dp;
|
||||
|
Loading…
Reference in New Issue
Block a user