aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorAndreas Schulz <ats@FreeBSD.org>1994-11-20 13:39:07 +0000
committerAndreas Schulz <ats@FreeBSD.org>1994-11-20 13:39:07 +0000
commitdc0b56513d8721c1c415b90bc39e0d7c5048a0a6 (patch)
tree42475ec9fbbfb203acf30029159dc2d35501a26f /usr.sbin/config
parent07c2d0802d8c73821615a446a8c5a61f581b9751 (diff)
downloadsrc-dc0b56513d8721c1c415b90bc39e0d7c5048a0a6.tar.gz
src-dc0b56513d8721c1c415b90bc39e0d7c5048a0a6.zip
Put a simple algorithmus in there that checks the last generated prototype
for ioconf.c with the current and suppress the generation if they are equal. This now prevents all the warnings from the c-compiler about sio or snd or two adaptecs. This works only if the sio lines are grouped together in the config files, but it is better than nothing.
Notes
Notes: svn path=/head/; revision=4698
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/mkioconf.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c
index 822f80cc4c55..2757443dee60 100644
--- a/usr.sbin/config/mkioconf.c
+++ b/usr.sbin/config/mkioconf.c
@@ -605,6 +605,8 @@ i386_ioconf()
register int uba_n, slave;
int dev_id;
FILE *fp;
+ static struct device olddev;
+ struct device *old = &olddev;
fp = fopen(path("ioconf.c"), "w");
if (fp == 0) {
@@ -638,8 +640,9 @@ i386_ioconf()
if (mp == 0 || mp == TO_NEXUS ||
!eq(mp->d_name, "isa"))
continue;
- fprintf(fp, "extern struct isa_driver %3.3sdriver;",
- dp->d_name);
+ if(!old->d_name || strcmp(old->d_name, dp->d_name))
+ fprintf(fp, "extern struct isa_driver %3.3sdriver;",
+ dp->d_name);
if(eq(dp->d_name, "wdc")) seen_wdc++;
if(eq(dp->d_name, "fdc")) seen_fdc++;
if (dp->d_irq == 2)
@@ -647,9 +650,15 @@ i386_ioconf()
fprintf(stderr, "remapped irq 2 to irq 9, please update your config file\n");
dp->d_irq = 9;
}
- if (dp->d_vec != NULL && dp->d_vec->id != NULL)
- fprintf(fp, " inthand2_t %s;", shandler(dp));
+ if (dp->d_vec != NULL && dp->d_vec->id != NULL) {
+ char buf[32];
+
+ strcpy(buf, shandler(old));
+ if(!old->d_name || strcmp(buf, shandler(dp)))
+ fprintf(fp, " inthand2_t %s;", shandler(dp));
+ }
fprintf(fp, "\n");
+ old = dp;
}
#ifdef STATCLOCK
dev_id = 2;