diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-04 19:30:56 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-04 19:30:56 +0000 |
commit | e3d438608f212120e42a6447bf89f354816ac4ff (patch) | |
tree | 0ef9e295d96f14d2180ea27daa273afdb5b093d1 /sys/arch/macppc | |
parent | a258f20b10975f2a073d3fbeb33358967ff5298c (diff) |
make findblkmajor() and findblkname() MI; ok miod
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r-- | sys/arch/macppc/macppc/autoconf.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/sys/arch/macppc/macppc/autoconf.c b/sys/arch/macppc/macppc/autoconf.c index c9e66479e8d..8d08350b7ad 100644 --- a/sys/arch/macppc/macppc/autoconf.c +++ b/sys/arch/macppc/macppc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.26 2007/05/04 03:44:44 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.27 2007/05/04 19:30:55 deraadt Exp $ */ /* * Copyright (c) 1996, 1997 Per Fogelstrom * Copyright (c) 1995 Theo de Raadt @@ -37,7 +37,7 @@ * from: Utah Hdr: autoconf.c 1.31 91/01/21 * * from: @(#)autoconf.c 8.1 (Berkeley) 6/10/93 - * $Id: autoconf.c,v 1.26 2007/05/04 03:44:44 deraadt Exp $ + * $Id: autoconf.c,v 1.27 2007/05/04 19:30:55 deraadt Exp $ */ /* @@ -293,35 +293,10 @@ diskconf(void) dumpconf(); } -static struct { - char *name; - int maj; -} nam2blk[] = { +struct nam2blk nam2blk[] = { { "wd", 0 }, { "sd", 2 }, { "ofdisk", 4 }, { "raid", 19 }, + { NULL, -1 } }; - -int -findblkmajor(struct device *dv) -{ - char *name = dv->dv_xname; - int i; - - for (i = 0; i < sizeof(nam2blk)/sizeof(nam2blk[0]); i++) - if (!strncmp(name, nam2blk[i].name, strlen(nam2blk[i].name))) - return (nam2blk[i].maj); - return (-1); -} - -char * -findblkname(int maj) -{ - int i; - - for (i = 0; i < sizeof(nam2blk)/sizeof(nam2blk[0]); i++) - if (nam2blk[i].maj == maj) - return (nam2blk[i].name); - return (NULL); -} |